Re: [perl #39776] [BUG] PGE core dump

2006-08-03 Thread Chip Salzenberg
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 [EMAIL PROTECTED]


[perl #39776] [BUG] PGE core dump

2006-07-10 Thread via RT
# 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_PATHHOMELANGLANGUAGELD_LIBRARY_PATH
LOGDIRPATHPERL5LIBSHELL


Re: [perl #39776] [BUG] PGE core dump

2006-07-10 Thread Patrick R. Michaud
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)
 ...
 pruby.pg is available at http://tewk.com/pruby.pg

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