[Parrot] #744: Assertion Failure with steme and rakudo (was: GC Segfault with steme and rakudo)

Parrot parrot-tickets at lists.parrot.org
Wed Nov 18 18:57:49 UTC 2009


#744: Assertion Failure with steme and rakudo
-------------------------+--------------------------------------------------
 Reporter:  tene         |       Owner:  whiteknight
     Type:  bug          |      Status:  new        
 Priority:  normal       |   Milestone:             
Component:  hll_interop  |     Version:  1.2.0      
 Severity:  medium       |    Keywords:             
     Lang:               |       Patch:             
 Platform:               |  
-------------------------+--------------------------------------------------
Description changed by tene:

Old description:

> 1) Have an installed Rakudo available.
>
> 2) Build steme, from http://github.com/tene/steme
>
> 3) Create the following files:
> {{{
> [sweeks at kweh steme]$ cat nap.scm
> (hllimport (perl6 Naptime))
> (nap)
>
> [sweeks at kweh steme]$ cat Naptime.pm
> module Naptime {
>     sub nap is export {
>         say "zZzZzZz…"
>     }
> }
> }}}
> 4) Try to run it with and without GC
> {{{
> [sweeks at kweh steme]$ parrot -G steme.pbc nap.scm
> zZzZzZz…
> [sweeks at kweh steme]$ parrot steme.pbc nap.scm
> Segmentation fault
> }}}
> 5) Here is a backtrace with --gc-debug
> {{{
> [sweeks at kweh steme]$ gdb parrot
> GNU gdb Fedora (6.8-29.fc10)
> Copyright (C) 2008 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later
> <http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.  Type "show
> copying"
> and "show warranty" for details.
> This GDB was configured as "x86_64-redhat-linux-gnu"...
> (gdb) run --gc-debug steme.pbc nap.scm
> Starting program: /home/sweeks/parrot/bin/parrot --gc-debug steme.pbc
> nap.scm
> [Thread debugging using libthread_db enabled]
> [New Thread 0x7ffff7a1b700 (LWP 8072)]
>
> Program received signal SIGSEGV, Segmentation fault.
> 0x00007ffff7b3a4aa in Parrot_gc_mark_PObj_alive (interp=0x608080,
> obj=0x1) at src/gc/api.c:142
> 142         if (PObj_is_live_or_free_TESTALL(obj))
> Missing separate debuginfos, use: debuginfo-install glibc-2.9-3.x86_64
> gmp-4.2.2-8.fc10.x86_64 libgcc-4.3.2-7.x86_64 libicu-4.0-3.fc10.x86_64
> libstdc++-4.3.2-7.x86_64 ncurses-libs-5.6-20.20080927.fc10.x86_64
> readline-5.2-13.fc9.x86_64
> (gdb) bt
> #0  0x00007ffff7b3a4aa in Parrot_gc_mark_PObj_alive (interp=0x608080,
> obj=0x1) at src/gc/api.c:142
> #1  0x00007ffff7bad241 in mark_context (interp=0x608080, ctx=0xb023f0) at
> src/sub.c:118
> #2  0x00007ffff7c74c8d in Parrot_Continuation_mark (interp=0x608080,
> pmc=0xacce70) at ./src/pmc/continuation.pmc:92
> #3  0x00007ffff7b3cd57 in mark_special (interp=0x608080, obj=0xacce70) at
> src/gc/mark_sweep.c:460
> #4  0x00007ffff7b3a513 in Parrot_gc_mark_PObj_alive (interp=0x608080,
> obj=0xacce70) at src/gc/api.c:162
> #5  0x00007ffff7bad16b in mark_context (interp=0x608080, ctx=0xa516d0) at
> src/sub.c:91
> #6  0x00007ffff7c74c8d in Parrot_Continuation_mark (interp=0x608080,
> pmc=0x335f620) at ./src/pmc/continuation.pmc:92
> #7  0x00007ffff7b3cd57 in mark_special (interp=0x608080, obj=0x335f620)
> at src/gc/mark_sweep.c:460
> #8  0x00007ffff7b3a513 in Parrot_gc_mark_PObj_alive (interp=0x608080,
> obj=0x335f620) at src/gc/api.c:162
> #9  0x00007ffff7bad16b in mark_context (interp=0x608080, ctx=0xab92e0) at
> src/sub.c:91
> #10 0x00007ffff7c74c8d in Parrot_Continuation_mark (interp=0x608080,
> pmc=0x335f5f0) at ./src/pmc/continuation.pmc:92
> #11 0x00007ffff7b3cd57 in mark_special (interp=0x608080, obj=0x335f5f0)
> at src/gc/mark_sweep.c:460
> #12 0x00007ffff7b3a513 in Parrot_gc_mark_PObj_alive (interp=0x608080,
> obj=0x335f5f0) at src/gc/api.c:162
> #13 0x00007ffff7bad16b in mark_context (interp=0x608080, ctx=0x9b1310) at
> src/sub.c:91
> #14 0x00007ffff7b3dd40 in Parrot_gc_trace_root (interp=0x608080,
> trace=GC_TRACE_FULL) at src/gc/mark_sweep.c:195
> #15 0x00007ffff7b3c0a2 in gc_ms_trace_active_PMCs (interp=0x608080,
> trace=GC_TRACE_FULL) at src/gc/gc_ms.c:286
> #16 0x00007ffff7b3c300 in gc_ms_mark_and_sweep (interp=0x608080, flags=1)
> at src/gc/gc_ms.c:207
> #17 0x00007ffff7b395dd in Parrot_gc_mark_and_sweep (interp=0x608080,
> flags=1) at src/gc/api.c:776
> #18 0x00007ffff7b3bf32 in gc_ms_more_traceable_objects (interp=0x608080,
> pool=0x609770) at src/gc/gc_ms.c:374
> #19 0x00007ffff7b3b94b in gc_ms_get_free_object (interp=0x608080,
> pool=0x609770) at src/gc/gc_ms.c:437
> #20 0x00007ffff7b39ff1 in Parrot_gc_new_pmc_header (interp=0x608080,
> flags=1024) at src/gc/api.c:258
> #21 0x00007ffff7ba1b33 in get_new_pmc_header (interp=0x608080,
> base_type=50, flags=1024) at src/pmc.c:402
> #22 0x00007ffff7ba20fe in pmc_new (interp=0x608080, base_type=50) at
> src/pmc.c:119
> #23 0x00007ffff7b90d7d in Parrot_oo_new_object_attrs (interp=0x608080,
> class_=0x8c1750) at src/oo.c:356
> #24 0x00007ffff7ccc4f9 in Parrot_Class_instantiate (interp=0x608080,
> pmc=0x8c1750, init=0x68afa0) at ./src/pmc/class.pmc:1237
> #25 0x00007ffff7ada016 in Parrot_new_p_sc (cur_opcode=0x7ffff793c780,
> interp=0x608080) at src/ops/pmc.ops:59
> #26 0x00007ffff7ba5238 in runops_slow_core (interp=0x608080,
> pc=0x7ffff793c780) at src/runcore/cores.c:462
> #27 0x00007ffff7ba3f30 in runops_int (interp=0x608080, offset=5006) at
> src/runcore/main.c:987
> #28 0x00007ffff7b4c34a in runops (interp=0x608080, offs=5006) at
> src/call/ops.c:107
> #29 0x00007ffff7b4c726 in runops_args (interp=0x608080, sub=0xac2010,
> obj=0x68afa0, meth_unused=0x0, sig=0x7ffff7d7459f "P", ap=0x7fffffffda20)
> at src/call/ops.c:256
> #30 0x00007ffff7b4dadc in Parrot_runops_fromc_args (interp=0x608080,
> sub=0xac2010, sig=0x7ffff7d7459f "P") at src/call/ops.c:325
> #31 0x00007ffff7b9a093 in run_sub (interp=0x608080, sub_pmc=0xac2010) at
> src/packfile.c:686
> #32 0x00007ffff7b9a2d6 in do_1_sub_pragma (interp=0x608080,
> sub_pmc=0xac2010, action=PBC_LOADED) at src/packfile.c:748
> #33 0x00007ffff7b9a639 in do_sub_pragmas (interp=0x608080, self=0xb03940,
> action=PBC_LOADED, eval_pmc=0x0) at src/packfile.c:932
> #34 0x00007ffff7b9a7cd in PackFile_append_pbc (interp=0x608080,
> filename=0xb06120
> "/home/sweeks/parrot/lib/1.2.0-devel/languages/perl6/perl6.pbc") at
> src/packfile.c:4816
> #35 0x00007ffff7b9a85d in compile_or_load_file (interp=0x608080,
> path=0xaec368, file_type=PARROT_RUNTIME_FT_PBC) at src/packfile.c:4693
> #36 0x00007ffff7b9ad9d in Parrot_load_language (interp=0x608080,
> lang_name=0xaee018) at src/packfile.c:4789
> #37 0x00007ffff7ae7107 in Parrot_load_language_s
> (cur_opcode=0x7ffff79bf8b8, interp=0x608080) at src/ops/core.ops:176
> #38 0x00007ffff7ba5238 in runops_slow_core (interp=0x608080,
> pc=0x7ffff79bf8b8) at src/runcore/cores.c:462
> #39 0x00007ffff7ba3f30 in runops_int (interp=0x608080, offset=19825) at
> src/runcore/main.c:987
> #40 0x00007ffff7b4c34a in runops (interp=0x608080, offs=19825) at
> src/call/ops.c:107
> #41 0x00007ffff7b4c726 in runops_args (interp=0x608080, sub=0x6f4370,
> obj=0x68afa0, meth_unused=0x0, sig=0x7ffff7d6fa5b "vP",
> ap=0x7fffffffded0) at src/call/ops.c:256
> #42 0x00007ffff7b4dadc in Parrot_runops_fromc_args (interp=0x608080,
> sub=0x6f4370, sig=0x7ffff7d6fa5b "vP") at src/call/ops.c:325
> #43 0x00007ffff7b27a91 in Parrot_runcode (interp=0x608080, argc=2,
> argv=0x7fffffffe1d8) at src/embed.c:1015
> #44 0x00007ffff7d4411d in imcc_run_pbc (interp=0x608080, obj_file=0,
> output_file=0x0, argc=2, argv=0x7fffffffe1d8) at
> compilers/imcc/main.c:806
> #45 0x00007ffff7d44d81 in imcc_run (interp=0x608080,
> sourcefile=0x7fffffffe4fa "steme.pbc", argc=2, argv=0x7fffffffe1d8) at
> compilers/imcc/main.c:1097
> #46 0x0000000000400b24 in main (argc=2, argv=0x7fffffffe1d8) at
> src/main.c:61
> }}}

New description:

 1) Have an installed Rakudo available.

 2) Build steme, from http://github.com/tene/steme

 3) Create the following files:
 {{{
 [sweeks at kweh steme]$ cat nap.scm
 (hllimport (perl6 Naptime))
 (nap)

 [sweeks at kweh steme]$ cat Naptime.pm
 module Naptime {
     sub nap is export {
         say "zZzZzZz…"
     }
 }
 }}}
 4) Try to run nap.scm
 {{{
 [sweeks at kweh steme]$ parrot steme.pbc nap.scm
 src/call/context.c:699: failed assertion 'Parrot_pcc_get_regs_used(interp,
 ctx, REGNO_INT) > idx'
 Backtrace - Obtained 18 stack frames (max trace depth is 32).
 /home/sweeks/parrot/lib/libparrot.so.1.8.0 [0x7f9a331ffdf6]
 /home/sweeks/parrot/lib/libparrot.so.1.8.0(Parrot_confess+0x8b)
 [0x7f9a331ffdcb]
 /home/sweeks/parrot/lib/libparrot.so.1.8.0(Parrot_pcc_get_INTVAL_reg+0x90)
 [0x7f9a33225fd0]
 /home/sweeks/parrot/lib/libparrot.so.1.8.0 [0x7f9a33221d5b]
 /home/sweeks/parrot/lib/libparrot.so.1.8.0 [0x7f9a3321e61a]
 /home/sweeks/parrot/lib/libparrot.so.1.8.0(Parrot_pcc_fill_params_from_op+0xa0)
 [0x7f9a3321ece0]
 /home/sweeks/parrot/lib/libparrot.so.1.8.0 [0x7f9a33159691]
 /home/sweeks/parrot/lib/libparrot.so.1.8.0 [0x7f9a33285370]
 /home/sweeks/parrot/lib/libparrot.so.1.8.0 [0x7f9a33283956]
 /home/sweeks/parrot/lib/libparrot.so.1.8.0 [0x7f9a33224e0e]
 /home/sweeks/parrot/lib/libparrot.so.1.8.0(Parrot_pcc_invoke_from_sig_object+0x215)
 [0x7f9a3321b665]
 /home/sweeks/parrot/lib/libparrot.so.1.8.0(Parrot_pcc_invoke_sub_from_c_args+0x16f)
 [0x7f9a3321ae4f]
 /home/sweeks/parrot/lib/libparrot.so.1.8.0(Parrot_runcode+0x180)
 [0x7f9a331fb8b0]
 /home/sweeks/parrot/lib/libparrot.so.1.8.0 [0x7f9a3344cd9e]
 /home/sweeks/parrot/lib/libparrot.so.1.8.0(imcc_run+0x3de)
 [0x7f9a3344d9ee]
 parrot [0x400b50]
 /lib64/libc.so.6(__libc_start_main+0xfd) [0x387b21ea2d]
 parrot [0x4009d9]
 Aborted
 }}}
 5) Here is a backtrace
 {{{
 [sweeks at kweh steme]$ gdb ./steme
 ...
 (gdb) run nap.scm
 Starting program: /home/sweeks/src/steme/steme nap.scm
 [Thread debugging using libthread_db enabled]
 src/call/context.c:699: failed assertion 'Parrot_pcc_get_regs_used(interp,
 ctx, REGNO_INT) > idx'
 Backtrace - Obtained 16 stack frames (max trace depth is 32).
 /home/sweeks/src/parrot/blib/lib/libparrot.so.1.8.0 [0x7ffff7aecdf6]
 /home/sweeks/src/parrot/blib/lib/libparrot.so.1.8.0(Parrot_confess+0x8b)
 [0x7ffff7aecdcb]
 /home/sweeks/src/parrot/blib/lib/libparrot.so.1.8.0(Parrot_pcc_get_INTVAL_reg+0x90)
 [0x7ffff7b12fd0]
 /home/sweeks/src/parrot/blib/lib/libparrot.so.1.8.0 [0x7ffff7b0ed5b]
 /home/sweeks/src/parrot/blib/lib/libparrot.so.1.8.0 [0x7ffff7b0b61a]
 /home/sweeks/src/parrot/blib/lib/libparrot.so.1.8.0(Parrot_pcc_fill_params_from_op+0xa0)
 [0x7ffff7b0bce0]
 /home/sweeks/src/parrot/blib/lib/libparrot.so.1.8.0 [0x7ffff7a46691]
 /home/sweeks/src/parrot/blib/lib/libparrot.so.1.8.0 [0x7ffff7b71d70]
 /home/sweeks/src/parrot/blib/lib/libparrot.so.1.8.0 [0x7ffff7b70956]
 /home/sweeks/src/parrot/blib/lib/libparrot.so.1.8.0 [0x7ffff7b11e0e]
 /home/sweeks/src/parrot/blib/lib/libparrot.so.1.8.0(Parrot_pcc_invoke_from_sig_object+0x215)
 [0x7ffff7b08665]
 /home/sweeks/src/parrot/blib/lib/libparrot.so.1.8.0(Parrot_pcc_invoke_sub_from_c_args+0x16f)
 [0x7ffff7b07e4f]
 /home/sweeks/src/parrot/blib/lib/libparrot.so.1.8.0(Parrot_runcode+0x180)
 [0x7ffff7ae88b0]
 /home/sweeks/src/steme/steme [0x400d55]
 /lib64/libc.so.6(__libc_start_main+0xfd) [0x387b21ea2d]
 /home/sweeks/src/steme/steme [0x400b29]

 Program received signal SIGABRT, Aborted.
 0x000000387b2332f5 in raise () from /lib64/libc.so.6
 Missing separate debuginfos, use: debuginfo-install glibc-2.10.1-5.x86_64
 gmp-4.2.4-6.fc11.x86_64 libgcc-4.4.1-2.fc11.x86_64
 libicu-4.0.1-5.fc11.x86_64 libstdc++-4.4.1-2.fc11.x86_64 ncurses-
 libs-5.7-2.20090207.fc11.x86_64 nss-softokn-freebl-3.12.4-3.fc11.x86_64
 readline-5.2-14.fc11.x86_64
 (gdb) bt
 #0  0x000000387b2332f5 in raise () from /lib64/libc.so.6
 #1  0x000000387b234b20 in abort () from /lib64/libc.so.6
 #2  0x00007ffff7aecdd0 in Parrot_confess (cond=0x7ffff7d685b0
 "Parrot_pcc_get_regs_used(interp, ctx, REGNO_INT) > idx",
 file=0x7ffff7d68568 "src/call/context.c", line=699) at
 src/exceptions.c:588
 #3  0x00007ffff7b12fd0 in Parrot_pcc_get_INTVAL_reg (interp=0x657010,
 ctx=0x90fb90, idx=1) at src/call/context.c:699
 #4  0x00007ffff7b0ed5b in intval_param_from_op (interp=0x657010,
 raw_params=0x7ffff74f0440, param_index=3) at src/call/args.c:2545
 #5  0x00007ffff7b0b61a in fill_params (interp=0x657010,
 call_object=0x90fd48, raw_sig=0x75ae20, arg_info=0x7ffff74f0440,
 accessor=0x7ffff7ffaec0) at src/call/args.c:1264
 #6  0x00007ffff7b0bce0 in Parrot_pcc_fill_params_from_op (interp=0x657010,
 call_object=0x90fd48, raw_sig=0x75ae20, raw_params=0x7ffff74f0440) at
 src/call/args.c:1450
 #7  0x00007ffff7a46691 in Parrot_get_params_pc (cur_opcode=0x7ffff74f0440,
 interp=0x657010) at src/ops/core.ops:564
 #8  0x00007ffff7b71d70 in runops_fast_core (interp=0x657010,
 runcore=0x7200e0, pc=0x7ffff74f0440) at src/runcore/cores.c:666
 #9  0x00007ffff7b70956 in runops_int (interp=0x657010, offset=19814) at
 src/runcore/main.c:546
 #10 0x00007ffff7b11e0e in runops (interp=0x657010, offs=19814) at
 src/call/ops.c:97
 #11 0x00007ffff7b08665 in Parrot_pcc_invoke_from_sig_object
 (interp=0x657010, sub_obj=0x75a0d8, call_object=0x9299a0) at
 src/call/pcc.c:296
 #12 0x00007ffff7b07e4f in Parrot_pcc_invoke_sub_from_c_args
 (interp=0x657010, sub_obj=0x75a0d8, sig=0x7ffff7d6674a "P->") at
 src/call/pcc.c:74
 #13 0x00007ffff7ae88b0 in Parrot_runcode (interp=0x657010, argc=2,
 argv=0x7fffffffe108) at src/embed.c:825
 #14 0x0000000000400d55 in main ()
 }}}

--

-- 
Ticket URL: <https://trac.parrot.org/parrot/ticket/744#comment:9>
Parrot <https://trac.parrot.org/parrot/>
Parrot Development


More information about the parrot-dev mailing list