-
Notifications
You must be signed in to change notification settings - Fork 584
COREDUMP: lexer does not restore its state correctly #3904
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
From @tobezHi, The following coredumps 5.005_03, 5.6.0, and 5.6.1 on FreeBSD (perl on perl -e '{s//${}/; //}' Here is the stacktrace with -DDEBUGGING (I modified 5.6.1 so that #0 0x80a437c in Perl_saferealloc (where=0x8142680, size=4294962233) at util.c:127 \Anton. Perl Info
|
From @floatingatollLinux perl (@10209, 5.6.0): syntax error at -e line 1, near "${" Linux, solaris perl (5.5.3): syntax error at -e line 1, near "${" I don't have any FreeBSD boxen to test this on. Could someone give a try under a recent devel version? It appears to be similar to R. |
From @nwc10
Program received signal SIGSEGV, Segmentation fault. That's DEVEL10155 on FreeBSD 4.3-STABLE Nicholas Clark |
From @jhiFrom libc realloc() to isatty()...recursively? I think the heap is
|
From @nwc10Probably. I guess I'm not awake enough to be thinking too well. Here's (gdb) where 4294961977 is 0xffffeb39 I need to breakpoint before the call into Perl_sv_grow, else the stack is (gdb) call Perl_sv_dump(sv) Not sure if this is helpful. My excuse for stopping is that it's past Is going SEGV for wacko input a reportable bug in BSD's realloc()? Nicholas Clark |
From [Unknown Contact. See original ticket]Nick> Is going SEGV for wacko input a reportable bug in BSD's realloc()? Yes. However, the following patch contains a belt & braces avoidance of The patch adds saving PL_bufend to sublex_push(), so that future ways of --spider Inline Patch--- toke.c.DIST Sat May 26 22:42:45 2001
+++ toke.c Mon May 28 06:14:12 2001
@@ -1043,6 +1043,7 @@
SAVEI32(PL_lex_inwhat);
SAVECOPLINE(PL_curcop);
SAVEPPTR(PL_bufptr);
+ SAVEPPTR(PL_bufend);
SAVEPPTR(PL_oldbufptr);
SAVEPPTR(PL_oldoldbufptr);
SAVEPPTR(PL_last_lop);
@@ -3227,8 +3228,16 @@
else
PL_lex_brackstack[PL_lex_brackets++] = XOPERATOR;
s = skipspace(s);
- if (*s == '}')
+ if (*s == '}') {
+ if (PL_expect == XREF && PL_lex_state == LEX_INTERPNORMAL) {
+ PL_expect = XTERM;
+ /* This hack is to get the ${} in the message. */
+ PL_bufptr = s+1;
+ yyerror("syntax error");
+ break;
+ }
OPERATOR(HASHBRACK);
+ }
/* This hack serves to disambiguate a pair of curlies
* as being a block or an anon hash. Normally, expectation
* determines that, but in cases where we're not in a |
From @TuxSounds very familiar. Your approach sounds more generaic than I used in patch |
Migrated from rt.perl.org#6874 (status was 'resolved')
Searchable as RT6874$
The text was updated successfully, but these errors were encountered: