Closed p5pRT closed 21 years ago
Yes\, I *know* the regexp is incorrect. (at least\, for what I wanted it to do - brainfart.) But it shouldn't lead to a segfault - or should it?
bash-2.03$ perl -lne 'print if /\b(\w+)\s+$1\b/' files.tex *** some lines of text here ***
[main] D:\usr\local\bin\perl.exe 1028 (0) handle_exceptions: Exception: STATUS_ACCESS_VIOLATION [main] perl 1028 (0) handle_exceptions: Dumping stack trace to perl.exe.core
Things to note: Different files die on different lines\, but I cannot see anything in common with the lines it barfs on. Further investigation shows that changing the line it blows up on and the line above makes no difference - it seems to be based on the line number in a file\, but then on one file it dies on line 28\, on another\, line 19\, on another\, line 68. `Simple' files\, like `foo bar\nbaz bar\nfoo quux\n...\<repeat for 50 lines>' work fine. There's no commonality about what's in $1 either. Real hair-tearing-out stuff. No attempt yet to verify on other platforms - sorry\, I'm trapped at work.
For those of you who like that sort of thing\, here's the stack trace: [main] perl 1074 (0) exception: trapped! [main] perl 1074 (0) exception: code 0xC0000005 at 0x61053637 [main] perl 1074 (0) exception: ax 0x43 bx 0xA037110 cx 0x42 dx 0x0 [main] perl 1074 (0) exception: si 0xA037110 di 0x1 bp 0x248FBC0 sp 0x248FBB8 [main] perl 1074 (0) exception: exception is: STATUS_ACCESS_VIOLATION [main] perl 1074 (0) stack: Stack trace: [main] perl 1074 (0) stack: frame 0: sp = 0x248F9CC\, pc = 0x6100A2C3 [main] perl 1074 (0) stack: frame 1: sp = 0x248FA08\, pc = 0x77F84C92 [main] perl 1074 (0) stack: frame 2: sp = 0x248FA2C\, pc = 0x77F7967F [main] perl 1074 (0) stack: frame 3: sp = 0x248FAB8\, pc = 0x77F6626E [main] perl 1074 (0) stack: frame 4: sp = 0x248FBC0\, pc = 0x61A0A924 [main] perl 1074 (0) stack: frame 5: sp = 0x248FBE0\, pc = 0x619FA516 [main] perl 1074 (0) stack: frame 6: sp = 0x248FC10\, pc = 0x619F9A2F [main] perl 1074 (0) stack: frame 7: sp = 0x248FC3C\, pc = 0x61A09303 [main] perl 1074 (0) stack: frame 8: sp = 0x248FD44\, pc = 0x61A015AB [main] perl 1074 (0) stack: frame 9: sp = 0x248FD70\, pc = 0x61A00F6D [main] perl 1074 (0) stack: frame 10: sp = 0x248FD78\, pc = 0x619C2BFF [main] perl 1074 (0) stack: frame 11: sp = 0x248FD84\, pc = 0x61A1C433 [main] perl 1074 (0) stack: frame 12: sp = 0x248FD94\, pc = 0x61A1C383 [main] perl 1074 (0) stack: frame 13: sp = 0x248FDC4\, pc = 0x619C292D [main] perl 1074 (0) stack: frame 14: sp = 0x248FEF8\, pc = 0x4010BC [main] perl 1074 (0) stack: frame 15: sp = 0x248FF08\, pc = 0x61004402 [main] perl 1074 (0) stack: End of stack trace (more stack frames may be present)
Enjoy\, Simon
scozens@pwj.co.jp writes:
bash-2.03$ perl -lne 'print if /\b(\w+)\s+$1\b/' files.tex
What is "wrong" about this REx?
Different files die on different lines\, but I cannot see anything
in common with the lines it barfs on. Further investigation shows that changing the line it blows up on and the line above makes no difference - it seems to be based on the line number in a file\, but then on one file it dies on line 28\, on another\, line 19\, on another\, line 68.
This looks pretty similar to a bug Larry found\, but cannot be the same bug. However\, without a test file this report is useless.
Hope this helps\, Ilya
scozens@pwj.co.jp writes:
bash-2.03$ perl -lne 'print if /\b(\w+)\s+$1\b/' files.tex
I see: you used $1 instead of \1. Then it is the same bug as one which Larry reported. You may want to apply the patch I sent a week ago nevertheless.
http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/1999-11/msg00025.html
Ilya
Migrated from rt.perl.org#1771 (status was 'resolved')
Searchable as RT1771$