unmatched source-file tag -> death
Status: Beta
Brought to you by:
worden
A user recently got "connection was reset" messages from his page.
I got the same when I URL-hacked through to history and then did a
compare of the offending version!
The problem was apparently an unmatched source-file tag.
http://lalashan.mcmaster.ca/theobio/bio_708_2013/index.php?title=Aneesh_Bose&diff=1376&oldid=1362
shows the fix.
http://lalashan.mcmaster.ca/theobio/bio_708_2013/index.php?title=Aneesh_Bose&diff=1362&oldid=1361
should give an example of the error.
Anonymous
Hmm, when I load the offending diff I get weird stuff in php_errors_log:
[20-Feb-2013 20:52:43 UTC] 8239 begin: /theobio/bio_708_2013/index.php?title=Aneesh_Bose&diff=1362&oldid=1361
[20-Feb-2013 20:52:43 UTC] 12956 begin: /theobio/bio_708_2013/index.php?title=Aneesh_Bose&diff=1362&oldid=1361
[20-Feb-2013 20:52:44 UTC] 12568 begin: /theobio/bio_708_2013/index.php?title=Aneesh_Bose&diff=1362&oldid=1361
[20-Feb-2013 20:52:44 UTC] 4248 begin: /theobio/bio_708_2013/index.php?title=Aneesh_Bose&diff=1362&oldid=1361
[20-Feb-2013 20:52:44 UTC] 3508 begin: /theobio/bio_708_2013/index.php?title=Aneesh_Bose&diff=1362&oldid=1361
[20-Feb-2013 20:52:45 UTC] 3191 begin: /theobio/bio_708_2013/index.php?title=Aneesh_Bose&diff=1362&oldid=1361
[20-Feb-2013 20:52:45 UTC] 8165 begin: /theobio/bio_708_2013/index.php?title=Aneesh_Bose&diff=1362&oldid=1361
If it begins and doesn't end, I usually expect an error to show up here. And why begin 7 times in quick succession?
Well, the errors are just showing up in error_log instead:
[Wed Feb 20 15:52:43 2013] [notice] child pid 8239 exit signal Segmentation fault (11)
[Wed Feb 20 15:52:44 2013] [notice] child pid 12568 exit signal Segmentation fault (11)
[Wed Feb 20 15:52:44 2013] [notice] child pid 12956 exit signal Segmentation fault (11)
[Wed Feb 20 15:52:45 2013] [notice] child pid 3508 exit signal Segmentation fault (11)
[Wed Feb 20 15:52:45 2013] [notice] child pid 4248 exit signal Segmentation fault (11)
[Wed Feb 20 15:52:46 2013] [notice] child pid 3191 exit signal Segmentation fault (11)
[Wed Feb 20 15:52:46 2013] [notice] child pid 8165 exit signal Segmentation fault (11)
so that's helpful.
I'm going to experiment with the buggy page to see what crashes it and what doesn't.
So the buggy page is missing a </source-file> tag, which looks like it would cause a .R source file to extend until the end of the following .csv source file. I'm considering the possibility that the syntax highlighter crashes on the .csv data.
I have found that I can remove 8 lines of the csv data and get the page to render okay. And yes, in that page the .R syntax highlighting extends until the end of the .csv.
Changing from <source-file filename='Assignment4.R'> to <source-file filename='Assignment4.txt'> stops it from crashing. Strangely, I thought <source-file filename='Assignment4.R' lang="txt"> would do the same thing, but it still crashes in that case. I don't know why.
But this does suggest that the syntax highlighter is crashing.
That page text also crashes in MW 1.19.
Setting the memory limit to 20M (https://www.mediawiki.org/wiki/Manual:Errors_and_symptoms#Fatal_error:Allowed_memory_size_of_nnnnnnn_bytes_exhausted.28tried_to_allocate_nnnnnnnn_bytes.29) gets me an error report instead of a segfault:
[20-Feb-2013 22:00:05 UTC] PHP Fatal error: Allowed memory size of 20971520 bytes exhausted (tried to allocate 30720 bytes) in /net/theobio-inside/2/yushan/1/local/workingwiki/WorkingWiki/WWStorage.php on line 557
while setting the memory_limit to 100M brings us back to getting a segfault instead. So I think the memory limit is not helpful.
I don't see how to fix this bug short of debugging the syntax highlighter. Except that WW could detect that it's flowing two source files together and refuse to display it. It would be good to warn about the error for sure, but in general I try to display things even when I also warn about them, so that wouldn't fix this crash.
However, when we go to displaying files one-by-one in separate server round-trips, the bug will be confined to the one (conjoined) source file, leaving the rest of the page visible, and much easier for the page's editor to recognize and fix. In that case if there were a warning that the two tags are stuck together, it would be visible, so it would be useful.
See also https://sourceforge.net/p/workingwiki/bugs/266/. Note that if WW were to assume a closing </source-file> just before the opening of the next one when it's omitted, rather than scooping up text until the next closing tag, this particular crash wouldn't happen.
Last edit: Lee Worden 2013-02-20
Marking this closed now that #266 is done. With that fix, the above link doesn't produce crashes any more.