develooper Front page | perl.perl5.porters | Postings from April 2015

Re: [perl #123737] S_no_op: Assertion `s >= oldbp' failed. (toke.c:536)

Thread Previous | Thread Next
From:
wolfsage
Date:
April 24, 2015 17:06
Subject:
Re: [perl #123737] S_no_op: Assertion `s >= oldbp' failed. (toke.c:536)
Message ID:
CAJ0K8bi2=fP8C20xXCedUjS+rv1RSQngUS_p6y=nGVTdMaxT=A@mail.gmail.com
On Sun, Mar 22, 2015 at 8:41 PM, Hugo van der Sanden via RT <
perlbug-followup@perl.org> wrote:

> On Tue Mar 17 01:52:36 2015, brian.carpenter@gmail.com wrote:
> > This bugger is back, albeit in a slight different part of toke.c.
>
> I just noticed that the ticket was not reopened, I'll do that now.
>
> Brian's new test case is:
>
> % echo '0$#{' | ./miniperl -c
> Array length found where operator expected at - line 1, near "0$#"
> miniperl: toke.c:539: S_no_op: Assertion `s >= oldbp' failed.
> Aborted (core dumped)
> %
>
>
I'm not sure if the original fix was enough or the right place to fix
things.

Back in 5.18.4, these both worked and reported the correct errors:

  mhorsfall@dory:~$ ~/dpppperls/debug/perl-5.18.4/bin/perl5.18.4 -ce '0$#{'
  Array length found where operator expected at -e line 1, near "0$#"
      (Missing operator before $#?)
  syntax error at -e line 1, near "0$#"
  Missing right curly or square bracket at -e line 1, at end of line
  -e had compilation errors.

  mhorsfall@dory:~$ ~/dpppperls/debug/perl-5.18.4/bin/perl5.18.4 -ce '0${'
  Scalar found where operator expected at -e line 1, near "0$"
      (Missing operator before $?)
  syntax error at -e line 1, near "0$"
  Missing right curly or square bracket at -e line 1, at end of line
  -e had compilation errors.

In 5.19.5 with the following commit, these started panicing:

   good - zero exit from ./perl -Ilib /home/mhorsfall/crash.pl
  a49b10d0a8dde2a4adb5a0a90e7b846b243e2514 is the first bad commit
  commit a49b10d0a8dde2a4adb5a0a90e7b846b243e2514
  Author: Brian Fraser <fraserbn@gmail.com>
  Date:   Sun Sep 1 20:41:26 2013 -0300

      toke.c, scan_ident(): use PEEKSPACE() to skip over whitespace.

      This fixes a number of bugs regarding whitespace and line numbers
      in scan_ident(), such as ${\nfoo\n} not increasing the line number,
      or ${\ntime\n[1]} not working.

      It goes through a number of hoops to get the correct line number for
      warnings emmitted from scan_ident, and reverts CopLINE to its
      original value if scan_ident() is giving up and returning from the
      point of the opening bracket, like in the case of ${\n\nfoo()}.

  :040000 040000 fea9796b35814ce4842f64bf81366bad5ee381ba
0bc66bc8eeb87e6160264cb0ae12e38e45803c1b M    t
  :100644 100644 53ad9f85ce0b819b1cf33fd53bf57c21b43b6c21
682fe67af183d23171c93ecc4499949d3fd2cfe2 M    toke.c
  bisect run success
  That took 742 seconds.

Later in 5.21.5, they started working again in non-debug builds, but begain
reporting errors incorrectly:

("fixed" by:)

  commit 59685a4604d61709c23100c3754f52081ac007f1
  Author: Yves Orton <demerphq@gmail.com>
  Date:   Tue Sep 23 01:34:27 2014 +0200

      add an assert that the length arg for UTF8f is non-negative

      If we dont we will just hit a different more confusing assert
      later. In production builds we zero elen so the args is assumed
      empty.


  mhorsfall@dory:~/p5/perl$ runperls -dm 5.21.5 -e '0${'
   /home/mhorsfall/dpppperls/default/perl-5.21.5/bin/perl5.21.5 -e '0${'
2>&1
  Scalar found where operator expected at -e line 1, near "0$"
      (Missing operator before ?)
  syntax error at -e line 1, near "0$"
  Missing right curly or square bracket at -e line 1, at end of line
  Execution of -e aborted due to compilation errors.
  child exited with value 255

  mhorsfall@dory:~/p5/perl$ runperls -dm 5.21.5 -e '0$#{'
   /home/mhorsfall/dpppperls/default/perl-5.21.5/bin/perl5.21.5 -e '0$#{'
2>&1
  Array length found where operator expected at -e line 1, near "0$#"
      (Missing operator before ?)
  syntax error at -e line 1, near "0$#"
  Missing right curly or square bracket at -e line 1, at end of line
  Execution of -e aborted due to compilation errors.
  child exited with value 255

(Notice that "Missing operator before ?)" doesn't have the identifier
anymore)

The fix for this ticket fixed the first case, but are these individual
fixes needed for each case, or is there some more global fix that covers
them all? (I'm really not sure)

Also, here's another broken one:

  mhorsfall@tworivers:~$ perl -e '0@'
  Array found where operator expected at -e line 1, at end of line
      (Missing operator before ?)
  syntax error at -e line 1, near "0@
  "
  Execution of -e aborted due to compilation errors.

Though that never appeared to report properly. Also the newline after the @
is strange...

In any case, I'm not sure if this needs to remain a blocker for 5.22 if we
don't fix it in time since it's been broken since 5.20...

Cheers,

-- Matthew Horsfall (alh)

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About