[Parrot] #744: GC Segfault with steme and rakudo

Parrot parrot-tickets at lists.parrot.org
Wed Nov 18 17:07:45 UTC 2009


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

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 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
 }}}

--

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


More information about the parrot-dev mailing list