41

Not the first time it happens on the site, so it's time to raise the problem in Meta.

It is similar, but distinct from ‘double backslash + newline’ collapses to ‘single backslash’ when I hit ‘edit’ (Nov 26 '10); what happens is that code with lines ending with \\ gets randomly transformed, without any intervention, into a single backslash and the following line becomes a continuation of the line previously ending with \\.

The code for sure had double backslashes when it was posted.

See the edit history at https://tex.stackexchange.com/posts/146730/revisions (Nov 24 '13) for the last time I was made aware by it in some code of mine, look at the comment How to typeset row operations on augmented matrix

Other examples:

Update

In view of the provisional answer given below, please only add examples that appear to be affected after February 22, 2015, below this comment.

Latest date (so far) of corrected example: December 20, 2013: https://tex.stackexchange.com/a/150816/579. (Please update this date if a later example is found. The aim is to pinpoint the likely period in which the offending change was applied in order to determine the cause.)

Examples

(empty, for now, hope it remains so)

Update: April 27, 2017

Nick Craver seems to have found the origin of the problem. While he blames himself, I think we shouldn't put him at the wall and fire. ;-)

The proposal he made seems quite appealing, particularly if the items edited while in the specific review queue aren't bumped to the top page. With all candidates collected in a queue, we should be able to get away with the issue soon.

An additional request would be to have two buttons: “Fix” and "Pull off the queue”, the latter for posts that are just false positive.

A good search criterion for a post being included in the list seems to be

it contains a backslash followed by four spaces or a TAB, and has been posted before 2013-12-31

21
  • 2
    the "how to align" example has been corrected, but if someone notices it degrading again, i'd really like to hear about it. Commented Jan 12, 2017 at 13:37
  • Please, add examples when you find them
    – egreg
    Commented Jan 13, 2017 at 17:02
  • All answers (but not the question itself) to tex.stackexchange.com/q/50483 seem to have been hit.
    – Dai Bowen
    Commented Jan 15, 2017 at 17:10
  • presumably a duplicate of this unanswered bug report from 2015 meta.tex.stackexchange.com/questions/5978/… Commented Jan 16, 2017 at 19:59
  • 3
    @DavidCarlisle Yes, but maybe prodding the Powers is better
    – egreg
    Commented Jan 16, 2017 at 20:38
  • 3
    @egreg sure, I just thought the powers like to be reminded that it was flagged before.... Commented Jan 16, 2017 at 21:11
  • I can verify that I have also observed this vanishing of the final backslash and the following newline from answers containing `\\`. It is rather frustrating, and needs to be fixed. I have not been keeping track of answers that I have seen affected. Commented Jan 24, 2017 at 15:43
  • 1
    I don't quite see why this is distinct, as it says in the question, as opposed to worth banging a drum about because of the utter lack of response to earlier attempts to raise the issue.
    – cfr
    Commented Feb 1, 2017 at 3:58
  • @cfr -- although the premise of this question is the same as the other, that one doesn't have the list of examples which is a valuable adjunct. so if any question is to be closed as a duplicate, i'd vote for having the other one closed, pointing to this one. i'm just bothered (very bothered) by the fact that it's gotten no action after so long. Commented Feb 9, 2017 at 23:54
  • @barbarabeeton The worst thing is that it is not distinct. If it was a new problem, you could understand it not having been addressed.
    – cfr
    Commented Feb 10, 2017 at 4:11
  • 3
    I'm looking into it this week
    – m0sa
    Commented Feb 13, 2017 at 11:58
  • 4
    For those interested in searching for mistakes, here's a possible search criteria: tabular code:"\ " created:2015-02-22..2017-01-31. This is based on the fact that (1) \\ is typically associated with tabulars; (2) the code change will have a "control space"; (2) was created after Feb 22, 2015.
    – Werner Mod
    Commented Feb 18, 2017 at 0:48
  • 14
    Just want to say "thanks" to those who are diligently going through old answers and fixing this (specially @barbarabeeton). Commented Mar 19, 2017 at 22:18
  • 3
    Although fixing these posts is an important job, it's making the front page basically unusable. I'm not sure this is a net win. An option to mark edits as minor and thus not bump the post would be extremely useful here. I'd be in favor of waiting until something like this is implemented before fixing all of these.
    – TH.
    Commented Jun 9, 2017 at 16:49
  • 1
    @TH. I fix posts when I happen to find them, not searching for them.
    – egreg
    Commented Jun 9, 2017 at 17:12

4 Answers 4

30

Update: This was almost certainly my fault.

On December 20, 2013 I moved the TeX (and meta) databases to new homes. I'm not sure how the original problem occurred, but TeX and its meta had a very odd database collation. Of the hundreds of databases, it was only those. We didn't recognize this for several years until we started aggregating data across databases for several network screens (think: top bar, achievements, rep, etc.).

The only way to fix this online and permanently (not ending up with a two-off database with a different structure) was to make a new Tex database and migrate things over. This happened by making TeX/meta read-only, moving the data in the background, and swapping the connection over at the end. But it appears that the strange collation the database was on handled double backslashes particularly in an odd way that did not convert to SQL_Latin1_General_CP1_CI_AS cleanly.

I looked back at our internal chat logs, and a hint that this was an issue didn't reach our ears until July 15th, 2015. Unfortunately, we don't keep data forever and by years later, those database backups were long gone.

We can't just fix this because we don't have the data, but we're looking at options to help scale out fixing this quickly, for example possibly a new review queue we can populate with these posts for quick fixing by many. We don't have the data to do this with 100% accuracy, and we can't trust a query would be 100% accurate either, but populating a queue to very quickly.

Before we go down that road, is that an appealing option? There are other uses for such functionality, e.g. when we detect images that are no longer there and posts need some love, etc.

14
  • 16
    The option is appealing! Would it be possible that edits to those posts aren't bumped to the top page?
    – egreg
    Commented Apr 26, 2017 at 12:39
  • @egreg That's a perfectly valid requirement - adding that to the discussion list, we should be able to do that.
    – Nick Craver Mod
    Commented Apr 26, 2017 at 12:42
  • 2
    to echo @egreg, that would be very appealing! we've found another condition that resulted in corrupted code, and i think it's mentioned in a comment somewhere on this page. so we can come up with some additional patterns to search, to populate your database. and not bumping would be really beneficial. some of us will be at the tex users group meeting next week, and i can probably conscript some (reasonably willing) volunteers. Commented Apr 26, 2017 at 12:44
  • 5
    thank you for doing the research and 'fessing up. Commented Apr 26, 2017 at 12:46
  • Thanks, I appended some details to the question
    – egreg
    Commented Apr 26, 2017 at 13:15
  • 9
    The special review list would be helpful but data.stackexchange.com/tex/revision/646030/806504/corruption suggests there are still thousands of these so it will take a while in the web interface. In practice the likelihood of a single backslash followed by four spaces is so small for TeX code that I think you do in fact have the data to fix this in the back end. If you changed all single backslash followed by four spaces to double backslash newline four spaces, it is theoretically possible that you corrupt a couple of answers but you will have fixed over 6000, so a net win. .. Commented Apr 26, 2017 at 13:52
  • 3
    .. Especially if you could put any affected documents in a review queue for quick review by volunteers after an automated fix. (egreg's "fix button" suggestion would also work, either way is quicker than actually making the replacement in the existing browser edit interface, or copying the text to emacs, fixing and copying back. Commented Apr 26, 2017 at 13:52
  • 3
    @DavidCarlisle -- although there are probably some places where the code legitimately has a backslash followed by multiple spaces, i think your proposed automatic fix, with "quick review", is feasible and a good idea. there are also some instances of backslash + tab + lost line ending, though many fewer than the four-space instances. (tab apparently works nicely as a substitute for four spaces to identify code. sigh.) Commented Apr 26, 2017 at 15:14
  • @NickCraver: Please, please, take a look at this: chat.stackexchange.com/transcript/message/37326048#37326048 Looks like a DB collation error. Commented May 11, 2017 at 15:17
  • @NickCraver: Just like the \\-gone-missing, this Unicode character shows it's presence from the first post. I doubt I've seen that before, so just wonder whether this is related.
    – Werner Mod
    Commented May 11, 2017 at 15:23
  • 2
    @NickCraver Can we hope for the queue to be activated?
    – egreg
    Commented May 27, 2017 at 10:20
  • 1
    @NickCraver BTW, I hope you have noticed that because you refused to fix it automatically, members of the community have been manually going through thousands of post and editing them: tex.meta.stackexchange.com/questions/7317/… -- this is thankless work and I've seen such volunteer efforts lead to burnout in other communities. Commented Jun 18, 2017 at 0:48
  • 3
    @ShreevatsaR We're not refusing to fix anything, we just haven't had the time to get to this. My team is responsible for many things and this is one of a sea of them. I also get pinged at a minimum of dozens of times a day across the network and chat...I don't get to every message (there aren't enough hours in the day). I'm really glad the community is stepping up here, but I'd be lying if I said I'll have time to assist in the near future. There's a lot in progress and all of it higher priority - that's the no-BS status of things at the moment.
    – Nick Craver Mod
    Commented Jun 18, 2017 at 1:12
  • @NickCraver Was your profile inspired by this image?
    – LCarvalho
    Commented Jun 18, 2017 at 11:55
15

Based on \\ corruption, I've created a new query

TeX.SX \\ corruption (based on user ID)

which I hope will help anyone to find their own posts affected by this bug!

P.S. The database is updated every sunday, so the query will return also updated Q&A until the database is refreshed...

5

This and the linked question

‘double backslash + newline’ collapses to ‘single backslash’ when I hit ‘edit’

Are two manifestations of the same issue, see

Community effort in fixing the double backslashes issue

For a summary of how this got fixed in the end.

4

I've looked into it and I couldn't find anything specific. The thing is, we don't ever modify markdown w/o recording history. So when you read about rebakes and other stuff we do, those are affecting the conversion from markdown to html, with markdown always staying the same.

To me, this looks like a one off job that somebody ran on the DB that touched post history (where markdown is stored). This would still leave the HTML of the post the same. The same holds true for markdown updates. Everything happens in the rebake.

Recently, however, we did multiple rebakes. One was adding rel="noreferrer" to links in order to mitigate the window.opener vulnerability, and another one was for fixing imgur links to https (which again was only a rebake). Those rebakes then surfaced the markdown change, long after it happened.

So the question that still has no answer is, who touched the post history (and when). Unfortunately I couldn't find the answer to that. But it's definitely not caused by anything that's running in production currently.

23
  • 3
    at least some of us understand the difficulty of tracking something like this down. (in my day job, i've been bedeviled by software that doubles backslashes instead of turning doubles into singles, and similarly trashing code that's supposed to be cut and pasted by end users. the folks in charge here can't figure that out either.) i'll ask on the chat for people finding future instances to check the date of the posting, and report anything later than the original report, meta.tex.stackexchange.com/q/5978, from 22 feb 2015, which was never even acknowledged. Commented Feb 17, 2017 at 13:12
  • that would be awesome
    – m0sa
    Commented Feb 17, 2017 at 13:18
  • please take a look at this set of revisions: tex.stackexchange.com/posts/229149/revisions -- it is dated right around the time of the original report. the initial input wasn't entered as code, and it was edited to make it so. the initial input shows single backslashes, but the side-by-side markdown shows double backslashes in the alleged original. something very fishy there! Commented Feb 17, 2017 at 13:51
  • i've added the dates on which the corrupted entries were reported as having been posted. all predate the 22 feb 2015 date of the initial bug report. Commented Feb 17, 2017 at 16:09
  • @m0sa: What does "bake" mean here?
    – Werner Mod
    Commented Feb 17, 2017 at 18:20
  • Bake: take the latest markdown, generate html, and store it in the db. The html from the db is what is shown to the users.
    – m0sa
    Commented Feb 17, 2017 at 18:56
  • 2
    @barbarabeeton and I have each now fixed several hundred of these posts, but there are hundreds more in the system, it is painful to track them down given the public search tools. Given that this was a system corruption, is there any chance of the stack Exchange team toing a custom search over the back end and producing a list of suspect posts that could be checked manually? Commented Mar 20, 2017 at 20:33
  • 1
    the corruption turned \\<newline> in code sections into \ so the main marker is \ in a code block but searching for code:"\ " is same as code:"\ " spaces are collapsed, also want to avoid false hits for \\ If a seach could be done over the internal files for a regex [^\\]\\ (not-bs,bs, 4 spaces) and the list of matching posts made available it would greatly help fixing this issue. Commented Mar 20, 2017 at 20:35
  • 3
    Please see this query to see an estimate of the size of the problem data.stackexchange.com/tex/revision/646030/806504/corruption The vast majority of the 7322 posts returned by this query will have been corrupted by this change as a single backslash followed by four spaces is very rare. fixing 7000 posts by hand through the web interface using volunteer labour is going to be tricky Commented Mar 22, 2017 at 10:54
  • 2
    @barbarabeeton Hats off to your incredible effort !
    – percusse
    Commented Mar 25, 2017 at 17:55
  • 1
    @percusse -- thanks. it's rather discouraging that whatever happened was not done under any controls that kept a record. i think we may never be entirely free of the mess. Commented Mar 25, 2017 at 18:27
  • 2
    @m0sa still no news? Commented Apr 1, 2017 at 19:58
  • 2
    @DavidCarlisle I'm trying to determine when exactly this happened and why. We're worried about doing a mass update when this may happen again. It will be a bit of time though because I'm going to be digging through historical data.
    – Taryn StaffMod
    Commented Apr 6, 2017 at 17:03
  • 6
    please see the question today tex.stackexchange.com/questions/366530/… Yet another visitor to the site completely confused by the fact that the answers have been completely corrupted. Please is there any possibility of you ever fixing this? Commented Apr 25, 2017 at 6:51
  • 2
    @bluefeet BTW, I hope you have noticed that because you refused to fix it automatically, members of the community have been going through thousands of posts and editing them manually: tex.meta.stackexchange.com/questions/7317/… -- this is thankless work and I've seen such volunteer efforts lead to burnout in other communities. You may not care but I hope you are aware. Commented Jun 18, 2017 at 0:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .