Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[perl #39776] [BUG] PGE core dump

6 views
Skip to first unread message

Kevin Tew

unread,
Jul 9, 2006, 10:15:07 PM7/9/06
to bugs-bi...@rt.perl.org
# New Ticket Created by Kevin Tew
# Please include the string: [perl #39776]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=39776 >


---
osname= darwin
osvers= 8.0
arch= darwin-thread-multi-2level
cc= cc
---
Flags:
category=core
severity=critical
ack=no
---
Original stack trace

../../parrot ../../compilers/pge/pgc.pir
--output=lib/pruby_grammar_gen.pir lib/pruby.pg
Method 'reduce' not found
current instr.: 'parrot;PGE::Exp::Quant;reduce' pc 4358
(compilers/pge/PGE/Exp.pir:402)
called from Sub 'parrot;PGE::Exp::Alt;reduce' pc 5056
(compilers/pge/PGE/Exp.pir:818)
called from Sub 'parrot;PGE::Exp::Group;reduce' pc 4624
(compilers/pge/PGE/Exp.pir:571)
called from Sub 'parrot;PGE::Exp::Quant;reduce' pc 4358
(compilers/pge/PGE/Exp.pir:402)
called from Sub 'parrot;PGE::Exp::Concat;reduce' pc 4098
(compilers/pge/PGE/Exp.pir:316)
called from Sub 'parrot;PGE::Exp;root_pir' pc 3609
(compilers/pge/PGE/Exp.pir:69)
called from Sub 'parrot;PGE::P6Regex;compile_p6regex' pc 6254
(compilers/pge/PGE/P6Regex.pir:128)
called from Sub 'parrot;PGE::P6Grammar;regex_stmt' pc 622
(../../compilers/pge/pgc.pir:336)
called from Sub 'parrot;PGE::P6Grammar;compile_p6grammar' pc 345
(../../compilers/pge/pgc.pir:225)
called from Sub 'parrot;PGE::P6Grammar;main' pc 135
(../../compilers/pge/pgc.pir:111)

Stack trace after adding debug statements
The first VAR1 dump is self
the second VAR1 dump is exp0
pruby.pg is available at http://tewk.com/pruby.pg

henrys:~/srcs/parrot/languages/pruby tewk$ vi
../../compilers/pge/PGE/Exp.pir
henrys:~/srcs/parrot/languages/pruby tewk$ ../../parrot
../../compilers/pge/pgc.pir --output=lib/pruby_grammar_gen.pir lib/pruby.pg
"VAR1" => PMC 'PGE::Exp::Quant' => "+" @ 19537 {
<min> => 1
<max> => 2147483647
<type> => "postfix:+"
<backtrack> => 3
[0] => undef
}
"VAR1" => undef
71 - Undef
Method 'reduce' not found
current instr.: 'parrot;PGE::Exp::Quant;reduce' pc 4397
(compilers/pge/PGE/Exp.pir:414)
called from Sub 'parrot;PGE::Exp::Alt;reduce' pc 5095
(compilers/pge/PGE/Exp.pir:830)
called from Sub 'parrot;PGE::Exp::Group;reduce' pc 4663
(compilers/pge/PGE/Exp.pir:583)
called from Sub 'parrot;PGE::Exp::Quant;reduce' pc 4397
(compilers/pge/PGE/Exp.pir:414)
called from Sub 'parrot;PGE::Exp::Concat;reduce' pc 4098
(compilers/pge/PGE/Exp.pir:316)
called from Sub 'parrot;PGE::Exp;root_pir' pc 3609
(compilers/pge/PGE/Exp.pir:69)
called from Sub 'parrot;PGE::P6Regex;compile_p6regex' pc 6293
(compilers/pge/PGE/P6Regex.pir:128)
called from Sub 'parrot;PGE::P6Grammar;regex_stmt' pc 622
(../../compilers/pge/pgc.pir:336)
called from Sub 'parrot;PGE::P6Grammar;compile_p6grammar' pc 345
(../../compilers/pge/pgc.pir:225)
called from Sub 'parrot;PGE::P6Grammar;main' pc 135
(../../compilers/pge/pgc.pir:111)


---
Summary of my parrot 0.4.5 (r13225) configuration:
configdate='Sun Jul 9 19:13:58 2006'
Platform:
osname=darwin, archname=darwin-thread-multi-2level
jitcapable=1, jitarchname=ppc-darwin,
jitosname=DARWIN, jitcpuarch=ppc
execcapable=1
perl=perl
Compiler:
cc='cc', ccflags='-g -pipe -fno-common -no-cpp-precomp
-I/usr/local/include -pipe -fno-common -Wno-long-double -I/sw/include
-I/sw/include',
Linker and Libraries:
ld='c++', ldflags='-L/usr/local/lib -flat_namespace -L/sw/lib
-L/sw/lib',
cc_ldflags='',
libs='-lm -lgmp -lreadline'
Dynamic Linking:
share_ext='.dylib', ld_share_flags='-dynamiclib -undefined suppress',
load_ext='.bundle', ld_load_flags='-bundle -undefined suppress'
Types:
iv=long, intvalsize=4, intsize=4, opcode_t=long, opcode_t_size=4,
ptrsize=4, ptr_alignment=1 byteorder=4321,
nv=double, numvalsize=8, doublesize=8

---
Environment:
DYLD_LIBRARY_PATH HOME LANG LANGUAGE LD_LIBRARY_PATH
LOGDIR PATH PERL5LIB SHELL

Patrick R. Michaud

unread,
Jul 10, 2006, 3:18:21 PM7/10/06
to perl6-i...@perl.org
On Sun, Jul 09, 2006 at 07:15:07PM -0700, Kevin Tew wrote:
> ../../parrot ../../compilers/pge/pgc.pir
> --output=lib/pruby_grammar_gen.pir lib/pruby.pg
> Method 'reduce' not found
> current instr.: 'parrot;PGE::Exp::Quant;reduce' pc 4358
> (compilers/pge/PGE/Exp.pir:402)
> ...

This is probably due to a syntax error in the pruby.pg grammar
itself. In particular, the line

token EXPONENT { ( e | E ) ( + | - )? <PRubyGrammar::DIGITS> }

should probably read

token EXPONENT { ( e | E ) ( \+ | - )? <PRubyGrammar::DIGITS> }

After making this change on my system the grammar appears to
compile correctly.

I totally agree that PGE probably needs to provide better syntax
error checking in situations such as this, thus I'm leaving this
ticket open, or will add a new more descriptive one soon.

Also, FWIW, I think that the grammar will read much more cleanly
if the "PRubyGrammar::" qualifiers are taken out of the rules --
they aren't needed if the initial match call is coded correctly.
(Punie uses these in its grammar, and isn't a good model in this
respect.)

For example, I would write the above EXPONENT token as:

token EXPONENT { ( e | E ) ( \+ | - )? <DIGITS> }

or perhaps better is:

token EXPONENT { <[eE]> <[+\-]>? <DIGITS> }

Thanks,

Pm

Chip Salzenberg

unread,
Aug 3, 2006, 4:38:29 PM8/3/06
to Patrick R. Michaud, perl6-i...@perl.org
On Mon, Jul 10, 2006 at 02:18:21PM -0500, Patrick R. Michaud wrote:
> I totally agree that PGE probably needs to provide better syntax
> error checking in situations such as this, thus I'm leaving this
> ticket open, or will add a new more descriptive one soon.

But why the core dump in this case? Why not a thrown exception?

(I ask to know whether I should try to fix this before 0.4.6)
--
Chip Salzenberg <ch...@pobox.com>

Patrick R. Michaud via RT

unread,
Nov 10, 2006, 1:38:54 PM11/10/06
to perl6-i...@perl.org
If someone could submit a test for this case, that would be great.

The test should check for the case where an unescaped quantifier appears
in a regex, and that PGE correctly returns a meaningful exception as
opposed to "Method 'reduce' not found".

Thanks!

Pm

Patrick R. Michaud via RT

unread,
Jan 13, 2007, 10:58:19 AM1/13/07
to perl6-i...@perl.org
Resolved in r16591.

(Added tests as well as code to throw exception for bare quantifiers.)

Thanks!

Pm

0 new messages