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

  • 2
    the "how to align" example has been corrected, but if someone notices it degrading again, i'd really like to hear about it. – barbara beeton Jan 12 '17 at 13:37
  • Please, add examples when you find them – egreg Jan 13 '17 at 17:02
  • All answers (but not the question itself) to tex.stackexchange.com/q/50483 seem to have been hit. – Dai Bowen Jan 15 '17 at 17:10
  • presumably a duplicate of this unanswered bug report from 2015 meta.tex.stackexchange.com/questions/5978/… – David Carlisle Jan 16 '17 at 19:59
  • 3
    @DavidCarlisle Yes, but maybe prodding the Powers is better – egreg Jan 16 '17 at 20:38
  • 3
    @egreg sure, I just thought the powers like to be reminded that it was flagged before.... – David Carlisle Jan 16 '17 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. – Andrew Swann Jan 24 '17 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 Feb 1 '17 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. – barbara beeton Feb 9 '17 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 Feb 10 '17 at 4:11
  • 3
    I'm looking into it this week – m0sa Feb 13 '17 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 Feb 18 '17 at 0:48
  • 14
    Just want to say "thanks" to those who are diligently going through old answers and fixing this (specially @barbarabeeton). – Loop Space Mar 19 '17 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. Jun 9 '17 at 16:49
  • 1
    @TH. I fix posts when I happen to find them, not searching for them. – egreg Jun 9 '17 at 17:12

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
    The option is appealing! Would it be possible that edits to those posts aren't bumped to the top page? – egreg Apr 26 '17 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 Apr 26 '17 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. – barbara beeton Apr 26 '17 at 12:44
  • 5
    thank you for doing the research and 'fessing up. – barbara beeton Apr 26 '17 at 12:46
  • Thanks, I appended some details to the question – egreg Apr 26 '17 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. .. – David Carlisle Apr 26 '17 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. – David Carlisle Apr 26 '17 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.) – barbara beeton Apr 26 '17 at 15:14
  • @NickCraver: Please, please, take a look at this: chat.stackexchange.com/transcript/message/37326048#37326048 Looks like a DB collation error. – Paulo Cereda May 11 '17 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 May 11 '17 at 15:23
  • 2
    @NickCraver Can we hope for the queue to be activated? – egreg May 27 '17 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. – ShreevatsaR Jun 18 '17 at 0:48
  • 2
    @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 Jun 18 '17 at 1:12
  • @NickCraver Was your profile inspired by this image? – LCarvalho Jun 18 '17 at 11:55

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...

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.

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.

  • 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. – barbara beeton Feb 17 '17 at 13:12
  • that would be awesome – m0sa Feb 17 '17 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! – barbara beeton Feb 17 '17 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. – barbara beeton Feb 17 '17 at 16:09
  • @m0sa: What does "bake" mean here? – Werner Feb 17 '17 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 Feb 17 '17 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? – David Carlisle Mar 20 '17 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. – David Carlisle Mar 20 '17 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 – David Carlisle Mar 22 '17 at 10:54
  • 2
    @barbarabeeton Hats off to your incredible effort ! – percusse Mar 25 '17 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. – barbara beeton Mar 25 '17 at 18:27
  • 2
    @m0sa still no news? – David Carlisle Apr 1 '17 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 Apr 6 '17 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? – David Carlisle Apr 25 '17 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. – ShreevatsaR Jun 18 '17 at 0:49

You must log in to answer this question.

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