Skip to content

Instantly share code, notes, and snippets.

@dogbert17
Created January 18, 2019 20:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dogbert17/8d0ed18404c2400283504d7b8949c545 to your computer and use it in GitHub Desktop.
Save dogbert17/8d0ed18404c2400283504d7b8949c545 to your computer and use it in GitHub Desktop.
Failure when running t/spec/integration/eval-and-threads.t
PERL6LIB=lib ./perl6-gdb-m t/spec/integration/eval-and-threads.t
...
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff6230700 (LWP 3891)]
1..1
[New Thread 0x7ffff3b3c700 (LWP 3894)]
[New Thread 0x7ffff333b700 (LWP 3895)]
[New Thread 0x7ffff2b3a700 (LWP 3896)]
[New Thread 0x7ffff1c20700 (LWP 3897)]
[Switching to Thread 0x7ffff3b3c700 (LWP 3894)]
Thread 3 "moar" hit Breakpoint 1, MVM_panic (exitCode=1, messageFormat=0x7ffff76f4490 "Tried to garbage-collect a locked mutex") at src/core/exceptions.c:821
821 MVM_NO_RETURN void MVM_panic(MVMint32 exitCode, const char *messageFormat, ...) {
(gdb) bt
#0 MVM_panic (exitCode=1, messageFormat=0x7ffff76f4490 "Tried to garbage-collect a locked mutex") at src/core/exceptions.c:821
#1 0x00007ffff75cde4d in gc_free (tc=0x7fffe80e64f0, obj=0x7fffdc214280) at src/6model/reprs/ReentrantMutex.c:44
#2 0x00007ffff757d80a in MVM_gc_collect_free_gen2_unmarked (tc=0x7fffe80e64f0, global_destruction=0) at src/gc/collect.c:745
#3 0x00007ffff7575468 in finish_gc (tc=0x3540470, gen=1 '\001', is_coordinator=1 '\001') at src/gc/orchestrate.c:231
#4 0x00007ffff75759f4 in run_gc (tc=0x3540470, what_to_do=0 '\000') at src/gc/orchestrate.c:413
#5 0x00007ffff7575e3b in MVM_gc_enter_from_allocator (tc=0x3540470) at src/gc/orchestrate.c:526
#6 0x00007ffff75766ac in MVM_gc_allocate_nursery (tc=0x3540470, size=64) at src/gc/allocation.c:35
#7 0x00007ffff75764a7 in MVM_gc_allocate (tc=0x3540470, size=64) at src/gc/allocation.h:18
#8 0x00007ffff7576735 in MVM_gc_allocate_zeroed (tc=0x3540470, size=64) at src/gc/allocation.c:52
#9 0x00007ffff75768fc in MVM_gc_allocate_object (tc=0x3540470, st=0x670608) at src/gc/allocation.c:89
#10 0x00007ffff7596c47 in MVM_repr_alloc_init (tc=0x3540470, type=0x67a9b0) at src/6model/reprconv.c:17
#11 0x00007ffff75b8503 in MVM_iter (tc=0x3540470, target=0x7ffff1032bb0) at src/6model/reprs/MVMIter.c:204
#12 0x00007ffff751e5f0 in MVM_interp_run (tc=0x3540470, initial_invoke=0x7ffff754af6a <thread_initial_invoke>, invoke_data=0x31969d0) at src/core/interp.c:2776
#13 0x00007ffff754b0b3 in start_thread (data=0x31969d0) at src/core/threads.c:87
#14 0x00007ffff6a456ba in start_thread (arg=0x7ffff3b3c700) at pthread_create.c:333
#15 0x00007ffff706b41d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109
(gdb) info threads
Id Target Id Frame
1 Thread 0x7ffff7fdb700 (LWP 3890) "moar" 0x00007ffff6a4d827 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=0, futex_word=0x353c230) at ../sysdeps/unix/sysv/linux/futex-internal.h:205
2 Thread 0x7ffff6230700 (LWP 3891) "moar" pthread_cond_wait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
* 3 Thread 0x7ffff3b3c700 (LWP 3894) "moar" MVM_panic (exitCode=1, messageFormat=0x7ffff76f4490 "Tried to garbage-collect a locked mutex") at src/core/exceptions.c:821
4 Thread 0x7ffff333b700 (LWP 3895) "moar" pthread_cond_wait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
5 Thread 0x7ffff2b3a700 (LWP 3896) "moar" pthread_cond_wait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
6 Thread 0x7ffff1c20700 (LWP 3897) "moar" pthread_cond_wait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
(gdb) f 1
#1 0x00007ffff75cde4d in gc_free (tc=0x7fffe80e64f0, obj=0x7fffdc214280) at src/6model/reprs/ReentrantMutex.c:44
44 MVM_panic(1, "Tried to garbage-collect a locked mutex");
(gdb) p MVM_dump_backtrace(tc)
at SETTING::src/core/ThreadPoolScheduler.pm6:281 (./CORE.setting.moarvm:)
from SETTING::src/core/Thread.pm6:54 (./CORE.setting.moarvm:THREAD-ENTRY)
$1 = void
@dogbert17
Copy link
Author

Using timotimo++ super patch the following is output:

 at gen/moar/stage2/QAST.nqp:7325  (/home/dogbert/repos/rakudo/install/share/nqp/lib/QAST.moarvm:assemble_and_load)
 from gen/moar/stage2/NQPHLL.nqp:567  (/home/dogbert/repos/rakudo/install/share/nqp/lib/NQPHLL.moarvm:mbc)
 from gen/moar/stage2/NQPHLL.nqp:1948  (/home/dogbert/repos/rakudo/install/share/nqp/lib/NQPHLL.moarvm:execute_stage)
 from gen/moar/stage2/NQPHLL.nqp:1984  (/home/dogbert/repos/rakudo/install/share/nqp/lib/NQPHLL.moarvm:run)
 from gen/moar/stage2/NQPHLL.nqp:1987  (/home/dogbert/repos/rakudo/install/share/nqp/lib/NQPHLL.moarvm:)
 from gen/moar/stage2/NQPHLL.nqp:1973  (/home/dogbert/repos/rakudo/install/share/nqp/lib/NQPHLL.moarvm:compile)
 from SETTING::src/core/ForeignCode.pm6:53  (./CORE.setting.moarvm:EVAL)
 from t/spec/integration/eval-and-threads.t:11  (<ephemeral file>:)
 from t/spec/integration/eval-and-threads.t:10  (<ephemeral file>:)
 from SETTING::src/core/Promise.pm6:255  (./CORE.setting.moarvm:)
 from SETTING::src/core/ThreadPoolScheduler.pm6:860  (./CORE.setting.moarvm:)
 from SETTING::src/core/ThreadPoolScheduler.pm6:248  (./CORE.setting.moarvm:)
 from SETTING::src/core/ThreadPoolScheduler.pm6:242  (./CORE.setting.moarvm:)
 from SETTING::src/core/ThreadPoolScheduler.pm6:239  (./CORE.setting.moarvm:run-one)
 from SETTING::src/core/ThreadPoolScheduler.pm6:281  (./CORE.setting.moarvm:)
 from SETTING::src/core/Thread.pm6:54  (./CORE.setting.moarvm:THREAD-ENTRY)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment