Skip to content
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

Perl_yyparse: Assertion `( (((PL_curcop == &PL_compiling ? PL_compiling.cop_hints : PL_curcop->cop_hints) & 0x1c000000) >> 26) == (0x1c000000 >> 26) && (((PL_curcop == &PL_compiling ? PL_compiling.cop #15553

Closed
p5pRT opened this issue Aug 24, 2016 · 7 comments

Comments

@p5pRT
Copy link

p5pRT commented Aug 24, 2016

Migrated from rt.perl.org#129073 (status was 'resolved')

Searchable as RT129073$

@p5pRT
Copy link
Author

p5pRT commented Aug 24, 2016

From @geeknik

Perl v5.25.4-10-g8d168aa

./perl -e '%{p{};sub p}()'

perl​: perly.y​:791​: int Perl_yyparse(int)​: Assertion `( (((PL_curcop == &PL_compiling ? PL_compiling.cop_hints : PL_curcop->cop_hints) & 0x1c000000) >> 26) == (0x1c000000 >> 26) && (((PL_curcop == &PL_compiling ? PL_compiling.cop_hints : PL_curcop->cop_hints) & 0x00020000) ? Perl_feature_is_enabled( ("" "signatures" ""), (sizeof("signatures")-1)) : (0)) )' failed.

#0 0x00007ffff6cf2067 in __GI_raise (sig=sig@​entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c​:56
#1 0x00007ffff6cf3448 in __GI_abort () at abort.c​:89
#2 0x00007ffff6ceb266 in __assert_fail_base (fmt=0x7ffff6e24238 "%s%s%s​:%u​: %s%sAssertion `%s' failed.\n%n",
  assertion=assertion@​entry=0xd6cd00 <.str50> "( (((PL_curcop == &PL_compiling ? PL_compiling.cop_hints : PL_curcop->cop_hints) & 0x1c000000) >> 26) == (0x1c000000 >> 26) && (((PL_curcop == &PL_compiling ? PL_compiling.cop_hints : PL_curcop->cop_h"..., file=file@​entry=0xd72f50 "perly.y", line=line@​entry=791,
  function=function@​entry=0xd6c9a0 <__PRETTY_FUNCTION__.Perl_yyparse> "int Perl_yyparse(int)") at assert.c​:92
#3 0x00007ffff6ceb312 in __GI___assert_fail (
  assertion=0xd6cd00 <.str50> "( (((PL_curcop == &PL_compiling ? PL_compiling.cop_hints : PL_curcop->cop_hints) & 0x1c000000) >> 26) == (0x1c000000 >> 26) && (((PL_curcop == &PL_compiling ? PL_compiling.cop_hints : PL_curcop->cop_h"..., file=0xd72f50 "perly.y", line=791,
  function=0xd6c9a0 <__PRETTY_FUNCTION__.Perl_yyparse> "int Perl_yyparse(int)") at assert.c​:101
#4 0x00000000006b9683 in Perl_yyparse (gramtype=<optimized out>) at perly.y​:791
#5 0x000000000059c502 in S_parse_body (env=<optimized out>, xsinit=<optimized out>) at perl.c​:2373
#6 0x000000000059289d in perl_parse (my_perl=<optimized out>, xsinit=<optimized out>, argc=<optimized out>, argv=<optimized out>, env=<optimized out>) at perl.c​:1689
#7 0x00000000004de836 in main (argc=<optimized out>, argv=<optimized out>, env=<optimized out>) at perlmain.c​:121

@p5pRT
Copy link
Author

p5pRT commented Aug 25, 2016

From @cpansprout

On Wed Aug 24 16​:27​:33 2016, brian.carpenter@​gmail.com wrote​:

Perl v5.25.4-10-g8d168aa

./perl -e '%{p{};sub p}()'

With a simple ‘{sub f}’, the lexer emits a semicolon before the closing brace. Excerpt from -DpT output​:

Reading a token​:
### 1​:LEX_NORMAL/XBLOCK "}\n"
### forced token​:
### <== '}'

### <== ';'

(A ‘forced token’ is a pending token that will be emitted the next time yylex is called.)

With %{p{}; before it, it behaves differently​:

Reading a token​:
### 1​:LEX_NORMAL/XBLOCK "}()\n"
### 1​:LEX_NORMAL/XOPERATOR "()\n"
### <== '('

I have not looked into why.

BTW, perl interprets %{p{foo}} as %p{foo}, and the parser starts to read the %{p{... as a key/value slice.

--

Father Chrysostomos

@p5pRT
Copy link
Author

p5pRT commented Aug 25, 2016

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Sep 4, 2016

From @cpansprout

This is now fixed in bdc377e.

--

Father Chrysostomos

@p5pRT
Copy link
Author

p5pRT commented Sep 4, 2016

@cpansprout - Status changed from 'open' to 'resolved'

@p5pRT p5pRT closed this as completed Sep 4, 2016
@p5pRT
Copy link
Author

p5pRT commented Sep 8, 2016

From @mauke

Am 05.09.2016 um 00​:58 schrieb Father Chrysostomos via RT​:

This is now fixed in bdc377e.

+ if (!parser->error_count) {
+ assert(FEATURE_SIGNATURES_IS_ENABLED);
+ }

Why not assert(parser->error_count || FEATURE_SIGNATURES_IS_ENABLED); ?

--
Lukas Mai <plokinom@​gmail.com>

@p5pRT
Copy link
Author

p5pRT commented Sep 8, 2016

From @cpansprout

On Wed Sep 07 23​:06​:18 2016, plokinom@​gmail.com wrote​:

Am 05.09.2016 um 00​:58 schrieb Father Chrysostomos via RT​:

This is now fixed in bdc377e.

+ if (!parser->error_count) {
+ assert(FEATURE_SIGNATURES_IS_ENABLED);
+ }

Why not assert(parser->error_count || FEATURE_SIGNATURES_IS_ENABLED); ?

I figured it would be harder to read that way. It would fail under the same circumstances anyway, so it’s equivalent.

--

Father Chrysostomos

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant