Ticket #261 (closed bug: fixed)

Opened 6 years ago

Last modified 6 years ago

pge segfaulting on feather.perl6.nl (linux)

Reported by: coke Owned by:
Priority: normal Milestone:
Component: none Version:
Severity: medium Keywords:
Cc: Language:
Patch status: applied Platform:

Description

Revision: 36286 ; no local changes.

$ perl Configure.pl && make

dies with:

make[1]: Entering directory `/home/coke/sandbox/parrot/compilers/pge'
/home/coke/bin/perl -MExtUtils::Command -e rm_f PGE.pbc ../../runtime/parrot/library/PGE.pbc
/home/coke/bin/perl -e "" >PGE/builtins_gen.pir
../../parrot -o PGE.pbc --output-pbc PGE.pir
../../parrot ../../runtime/parrot/library/PGE/Perl6Grammar.pir  --output=PGE/builtins_gen.pir PGE/builtins.pg
make[1]: *** [PGE.pbc] Segmentation fault
make[1]: *** Deleting file `PGE.pbc'
make[1]: Leaving directory `/home/coke/sandbox/parrot/compilers/pge'
make: *** [compilers.dummy] Error 2

running inside gdb, I don't get a segfault, I get:

(gdb) run ../../runtime/parrot/library/PGE/Perl6Grammar.pir  --output=PGE/builtins_gen.pir PGE/builtins.pg
Starting program: /home/coke/sandbox/parrot/parrot ../../runtime/parrot/library/PGE/Perl6Grammar.pir  --output=PGE/builtins_gen.pir PGE/builtins.pg
[Thread debugging using libthread_db enabled]
warning: Lowest section in /usr/lib/libicudata.so.34 is .hash at 00000094
PackFile_unpack: This is not a valid Parrot bytecode file
Parrot VM: Can't unpack packfile PGE.pir.
Unable to append PBC to the current directory
current instr.: 'parrot;PGE;Perl6Grammar;Compiler;__onload' pc 22 (../../runtime/parrot/library/PGE/Perl6Grammar.pir:72)
called from Sub 'parrot;PGE;Perl6Grammar;Compiler;main' pc -1 ((unknown file):-1)

Attachments

exec_test.patch Download (0.6 KB) - added by doughera 6 years ago.

Change History

  Changed 6 years ago by coke

cotto++ reminds me that the PGE build is a two step process and we need to manually re-run the step to get the actual segfault.

  Changed 6 years ago by coke

Looks like the segfault started happening in r36176.

Here's the backtrace from that version:

#0  0x080b48a8 in ?? ()
#1  0xb7d518be in Parrot_NCI_invoke (interp=0x804f040, pmc=0x80e1370, next=0x0)
    at ./src/pmc/nci.pmc:310
#2  0xb7bc8872 in Parrot_pcc_invoke_from_sig_object (interp=0x804f040,
    sub_obj=0x80e1370, sig_obj=0x80ec1f8) at src/inter_call.c:2866
#3  0xb7bdb74a in Parrot_mmd_multi_dispatch_from_c_args (interp=0x804f040,
    name=0xb7ea1d5f "cmp", sig=0xb7ea1a29 "PP->I") at src/multidispatch.c:456
#4  0xb7d19297 in Parrot_default_cmp (interp=0x804f040, pmc=0x815bfa0,
    value=0x8124ca0) at ./src/pmc/default.pmc:2439
#5  0xb7b705d1 in Parrot_lt_p_ic_ic (cur_opcode=0xb6c8665c, interp=0x804f040)
    at src/ops/cmp.ops:299
#6  0xb7c08390 in runops_slow_core (interp=0x804f040, pc=0xb6c8665c)
    at src/runops_cores.c:228
#7  0xb7bcf0b0 in runops_int (interp=0x804f040, offset=562)
    at src/interpreter.c:978
#8  0xb7bcfab1 in runops (interp=0x804f040, offs=562) at src/inter_run.c:108
#9  0xb7bcfe72 in runops_args (interp=0x804f040, sub=0x80efb28, obj=0x815c0d8,
    meth_unused=0x807b004, sig=0xb7ef1edf "S", ap=0xbfb0cf74 "\024Óõ·¨Ï°¿ ¤Ô·")
    at src/inter_run.c:248
#10 0xb7bd0886 in Parrot_run_meth_fromc_args (interp=0x804f040, sub=0x80efb28,
    obj=0x815c0d8, meth=0x807b004, sig=0xb7ef1edf "S") at src/inter_run.c:455
#11 0xb7e0184d in Parrot_Object_get_string (interp=0x804f040, pmc=0x815c0d8)
    at ./src/pmc/object.c:2993
#12 0xb7b53730 in Parrot_set_s_p (cur_opcode=0xb6c8c3b4, interp=0x804f040)
    at src/ops/set.ops:148
#13 0xb7c08390 in runops_slow_core (interp=0x804f040, pc=0xb6c8c3b4)
    at src/runops_cores.c:228
#14 0xb7bcf0b0 in runops_int (interp=0x804f040, offset=22)
    at src/interpreter.c:978
#15 0xb7bcfab1 in runops (interp=0x804f040, offs=22) at src/inter_run.c:108
#16 0xb7bcfe72 in runops_args (interp=0x804f040, sub=0x80f0d28, obj=0x80b0c48,
    meth_unused=0x0, sig=0xb7e9cee7 "P",
    ap=0xbfb0d12c "\034Á¿·h¿\021\b\024:ç¶") at src/inter_run.c:248
#17 0xb7bd0d26 in Parrot_runops_fromc_args (interp=0x804f040, sub=0x80f0d28,
    sig=0xb7e9cee7 "P") at src/inter_run.c:315
#18 0xb7bfe909 in run_sub (interp=0x804f040, sub_pmc=0x80f0d28)
    at src/packfile.c:636
#19 0xb7bfece7 in do_1_sub_pragma (interp=0x804f040, sub_pmc=0x80f0d28,
    action=PBC_MAIN) at src/packfile.c:729
#20 0xb7bfef31 in do_sub_pragmas (interp=0x804f040, self=0x810cff8,
    action=PBC_MAIN, eval_pmc=0x0) at src/packfile.c:867
#21 0xb7bff013 in PackFile_fixup_subs (interp=0x804f040, what=PBC_MAIN,
    eval=0x0) at src/packfile.c:4476
#22 0xb7e6e253 in imcc_run_pbc (interp=0x804f040, obj_file=0, output_file=0x0,
    argc=3, argv=0xbfb0d378) at compilers/imcc/main.c:821
#23 0xb7e6ee6c in imcc_run (interp=0x804f040,
    sourcefile=0xbfb0d98e "../../runtime/parrot/library/PGE/Perl6Grammar.pir",
    argc=3, argv=0xbfb0d378) at compilers/imcc/main.c:1111
#24 0x08048978 in main (argc=3, argv=0xbfb0d378) at src/main.c:61

  Changed 6 years ago by coke

rurban++ for suggesting checking the diff between the config_lib.pasm in both versions;

diff ../r36175_config_lib.pasm ../r36176_config.pasm
106,107c106,107
<       set P0["configdate"], "Tue Feb  3 20:30:54 2009 GMT"
<       set P0["configuration_steps"], "ARRAY(0x849e758)"
---
>       set P0["configdate"], "Mon Feb  2 17:45:17 2009 GMT"
>       set P0["configuration_steps"], "ARRAY(0x84a33a0)"
141d140
<       set P0["has_exec_protect"], "1"
363c362
<       set P0["revision"], "36175"
---
>       set P0["revision"], "36176"

  Changed 6 years ago by coke

Wish there was some way other than a manual comment to note that I just closed #302 as a duplicate of this ticket.

  Changed 6 years ago by coke

FYI, r36176 was committed by fperrad.

  Changed 6 years ago by gerd

Between parrot-0.9.0 and svn-revision 36488 the segfault starts to occurrence general under the OS Fedora. With parrot-0.9.0 the segfault occurrences only on 64-bit computers by using optimization.

follow-up: ↓ 8   Changed 6 years ago by doughera

Does the attached patch fix it? (exec_test.patch)

Changed 6 years ago by doughera

in reply to: ↑ 7   Changed 6 years ago by Infinoid

Replying to doughera:

Does the attached patch fix it? (exec_test.patch)

Thanks, good catch. Applied as r36636.

I'm hearing some promising noises as a result of this and r36635. @OP, can you confirm whether feather builds successfully now?

  Changed 6 years ago by jkeenan

I observed the following make failure at r36644 on my own Linux/i386 box:

make -C compilers/pct
make[1]: Entering directory `/topdir/compilers/pct'
../../parrot -o ../../runtime/parrot/library/PCT.pbc --output-pbc PCT.pir
../../parrot -o ../../runtime/parrot/library/PCT/PAST.pbc --output-pbc src/PAST.pir
../../parrot -o ../../runtime/parrot/library/PCT/Grammar.pbc --output-pbc src/PCT/Grammar.pir
../../parrot -o ../../runtime/parrot/library/PCT/HLLCompiler.pbc --output-pbc src/PCT/HLLCompiler.pir
make[1]: Leaving directory `/topdir/compilers/pct'
make -C compilers/pge
make[1]: Entering directory `/topdir/compilers/pge'
/usr/local/bin/perl -MExtUtils::Command -e rm_f PGE.pbc ../../runtime/parrot/library/PGE.pbc
/usr/local/bin/perl -e "" >PGE/builtins_gen.pir
../../parrot -o PGE.pbc --output-pbc PGE.pir
../../parrot ../../runtime/parrot/library/PGE/Perl6Grammar.pir  --output=PGE/builtins_gen.pir PGE/builtins.pg
argument doesn't hash
current instr.: 'parrot;P6metaclass;register' pc 511 (runtime/parrot/library/P6object.pir:292)
called from Sub 'parrot;PGE;Match;' pc 18 (compilers/pge/PGE/Match.pir:18)
called from Sub 'parrot;PGE;Perl6Grammar;Compiler;__onload' pc 22 (../../runtime/parrot/library/PGE/Perl6Grammar.pir:72)
called from Sub 'parrot;PGE;Perl6Grammar;Compiler;main' pc -1 ((unknown file):-1)
make[1]: *** [PGE.pbc] Error 1
make[1]: Leaving directory `/topdir/compilers/pge'
make: *** [compilers.dummy] Error 2

  Changed 6 years ago by rurban

  • status changed from new to closed
  • resolution set to fixed
  • patch set to applied

The last error "argument doesn't hash" is caused by an incomplete make realclean, missing to cleanup

src/call/*.str and src/call/*o.

Do either this or update to the latest revision to get the fixed Makefile.

  Changed 6 years ago by coke

I can verify that the original segfault no longer appears, though I have no idea which revision fixed it.

Note: See TracTickets for help on using tickets.