Sorry that I was not able to cut this down to a smaller example, but, as explained below, the bug goes away with almost
any seemingly trivial change to my source code.
When I run the script "bug" from the attached tarball, I get the following output:
warning, undefined reference nonmetricunits
warning, undefined reference electroncapture
./a.rb:570:in `block in handle_math': unmatched close parenthesis: /pjy\000\000\000\000\000in|end){align\*?}/
(RegexpError)
from ./a.rb:564:in `each'
from ./a.rb:564:in `handle_math'
from ./a.rb:760:in `parse_para'
from ./a.rb:1048:in `block in <main>'
from ./a.rb:1046:in `each'
from ./a.rb:1046:in `<main>'
In the "unmatched close parenthesis" error message, ruby is quoting line 570 from the file a.rb, but if you
look at line 570, it looks like this:
tex.split(/\\(?:begin|end){#{x}\*?}/).each { |m|
In other words, the first eight characters of my source code have been overwritten with garbage. This error does not
seem to occur on machines with 32-bit pointers.
Strangely, trivial changes to the source code make the error go away. For instance, if I delete the third line of a.rb,
which is a comment, the error goes away.
Information about my system:
$ uname -a
Linux rintintin 2.6.20-15-generic #2 SMP Sun Apr 15 06:17:24 UTC 2007 x86_64 GNU/Linux
$ ruby --version
ruby 1.9.0 (2007-05-07 patchlevel 0) [x86_64-linux]
|