Ticket #744 (closed bug: fixed)

Opened 6 years ago

Last modified 5 years ago

Assertion Failure with steme and rakudo

Reported by: tene Owned by: whiteknight
Priority: normal Milestone:
Component: hll_interop Version: 1.2.0
Severity: medium Keywords:
Cc: parrot-dev@… Language:
Patch status: Platform:

Description (last modified by tene) (diff)

1) Have an installed Rakudo available.

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

3) Create the following files:

[sweeks@kweh steme]$ cat nap.scm 
(hllimport (perl6 Naptime))
(nap)

[sweeks@kweh steme]$ cat Naptime.pm 
module Naptime {
    sub nap is export {
        say "zZzZzZz…"
    }
}

4) Try to run nap.scm

[sweeks@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@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 ()

Attachments

weird-context-segfault-workaround.patch Download (0.6 KB) - added by tene 5 years ago.
Hide the problem

Change History

Changed 6 years ago by whiteknight

Can you post the generated PIR code?

Changed 5 years ago by japhb

  • component changed from none to hll_interop

Changed 5 years ago by tene

  • cc chromatic@… removed
  • description modified (diff)

Changed 5 years ago by tene

Hide the problem

Changed 5 years ago by tene

  • cc parrot-dev@… added

WhiteKnight provided a patch that hides this problem.

Changed 5 years ago by whiteknight

  • description modified (diff)

Changed 5 years ago by whiteknight

  • owner changed from chromatic to whiteknight

Can we get confirmation that this is still an issue in 1.8.0? mark_context specifically doesn't exist anymore, and that's a major part of the provided backtrace.

Changed 5 years ago by whiteknight

Just got this backtrace confirmation from Tene:

[sweeks@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

I'll try to dig into this issue and see what's causing it.

Changed 5 years ago by tene

  • description modified (diff)
  • summary changed from GC Segfault with steme and rakudo to Assertion Failure with steme and rakudo

Changed 5 years ago by tene

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

This, after the other problem went away, turned out to be two individual problems with steme and rakudo. Closing the ticket.

Note: See TracTickets for help on using tickets.