Skip to content

Instantly share code, notes, and snippets.

@MasterDuke17
Last active July 29, 2021 12:35
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 MasterDuke17/434a6db06998d04e351368d3edaea42f to your computer and use it in GitHub Desktop.
Save MasterDuke17/434a6db06998d04e351368d3edaea42f to your computer and use it in GitHub Desktop.
[dan@alexandria perl6]$ MVM_JIT_DISABLE=1 gdb --args ./install/bin/raku -e 'use MONKEY-SEE-NO-EVAL; use YAMLish; my $buf = buf8.allocate(100_000); my $raku = $buf.raku; my $yaml = save-yaml $buf; for ^5 { say $_; try EVAL $raku; load-yaml $yaml }'
GNU gdb (GDB) 10.2
Copyright (C) 2021 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-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./install/bin/raku...
(gdb) b MVM_panic
Function "MVM_panic" not defined.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (MVM_panic) pending.
(gdb) r
Starting program: /home/dan/Source/perl6/install/bin/raku -e use\ MONKEY-SEE-NO-EVAL\;\ use\ YAMLish\;\ my\ \$buf\ =\ buf8.allocate\(100_000\)\;\ my\ \$raku\ =\ \$buf.raku\;\ my\ \$yaml\ =\ save-yaml\ \$buf\;\ for\ \^5\ \{\ say\ \$_\;\ try\ EVAL\ \$raku\;\ load-yaml\ \$yaml\ \}
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0x7ffff6cfc640 (LWP 2181725)]
0
1
Thread 1 "raku" hit Breakpoint 1, MVM_panic (exitCode=1, messageFormat=0x7ffff79e6940 "Tried to garbage-collect a locked mutex") at src/core/exceptions.c:853
853 MVM_NO_RETURN void MVM_panic(MVMint32 exitCode, const char *messageFormat, ...) {
(gdb) bt
#0 MVM_panic (exitCode=1, messageFormat=0x7ffff79e6940 "Tried to garbage-collect a locked mutex") at src/core/exceptions.c:853
#1 0x00007ffff78afc0d in gc_free (tc=0x55555555a0d0, obj=0x55557414a030) at src/6model/reprs/ReentrantMutex.c:46
#2 0x00007ffff785a69b in MVM_gc_collect_free_gen2_unmarked (executing_thread=0x55555555a0d0, tc=0x55555555a0d0, global_destruction=0) at src/gc/collect.c:767
#3 0x00007ffff7851327 in finish_gc (tc=0x55555555a0d0, gen=1 '\001', is_coordinator=1 '\001') at src/gc/orchestrate.c:232
#4 0x00007ffff78519ea in run_gc (tc=0x55555555a0d0, what_to_do=0 '\000') at src/gc/orchestrate.c:447
#5 0x00007ffff785209f in MVM_gc_enter_from_allocator (tc=0x55555555a0d0) at src/gc/orchestrate.c:598
#6 0x00007ffff7852b29 in MVM_gc_allocate_nursery (tc=0x55555555a0d0, size=48) at src/gc/allocation.c:37
#7 0x00007ffff77d9b4c in fastcreate (tc=0x55555555a0d0, cur_op=0x7ffff102abc4 "#") at src/core/interp.c:92
#8 0x00007ffff7807076 in MVM_interp_run (tc=0x55555555a0d0, initial_invoke=0x7ffff7967256 <toplevel_initial_invoke>, invoke_data=0x555555609048, outer_runloop=0x0) at src/core/interp.c:6077
#9 0x00007ffff79673d0 in MVM_vm_run_file (instance=0x555555559590, filename=0x555555559520 "/home/dan/Source/perl6/install/share/perl6/runtime/perl6.moarvm") at src/moar.c:504
#10 0x00005555555557ce in main (argc=<optimized out>, argv=0x7fffffffe218) at src/vm/moar/runner/main.c:472
(gdb) f 1
#1 0x00007ffff78afc0d in gc_free (tc=0x55555555a0d0, obj=0x55557414a030) at src/6model/reprs/ReentrantMutex.c:46
46 MVM_panic(1, "Tried to garbage-collect a locked mutex");
(gdb) p *rm
$1 = {common = {header = {sc_forward_u = {forwarder = 0x0, sc = {sc_idx = 0, idx = 0}, st = 0x0}, owner = 1, flags1 = 0 '\000', flags2 = 2 '\002', size = 48}, st = 0x5555555b2fc0}, body = {mutex = 0x555572f906d0, holder_id = 1,
lock_count = 2}}
(gdb) p *rm->body.mutex
$2 = {__data = {__lock = 1, __count = 0, __owner = 2181714, __nusers = 1, __kind = 0, __spins = 0, __elision = 0, __list = {__prev = 0x0, __next = 0x0}}, __size = "\001\000\000\000\000\000\000\000RJ!\000\001", '\000' <repeats 26 times>,
__align = 1}
(gdb)
[dan@alexandria perl6]$ rr replay
GNU gdb (GDB) 10.2
Copyright (C) 2021 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-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /home/dan/.local/share/rr/raku-2/mmap_hardlink_3_rakudo...
Really redefine built-in command "restart"? (y or n) [answered Y; input not from terminal]
Remote debugging using 127.0.0.1:2675
Reading symbols from /lib64/ld-linux-x86-64.so.2...
(No debugging symbols found in /lib64/ld-linux-x86-64.so.2)
0x00007fd13fe65090 in _start () from /lib64/ld-linux-x86-64.so.2
(rr) b MVM_panic
Function "MVM_panic" not defined.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (MVM_panic) pending.
(rr) continue
Continuing.
0
1
[New Thread 2194193.2194194]
Thread 1 hit Breakpoint 1, MVM_panic (exitCode=1, messageFormat=0x7fd13f871940 "Tried to garbage-collect a locked mutex") at src/core/exceptions.c:853
853 MVM_NO_RETURN void MVM_panic(MVMint32 exitCode, const char *messageFormat, ...) {
(rr) f 1
#1 0x00007fd13f73ac0d in gc_free (tc=0x55e790466100, obj=0x55e7aee15e50) at src/6model/reprs/ReentrantMutex.c:46
46 MVM_panic(1, "Tried to garbage-collect a locked mutex");
(rr) watch -l rm->body.mutex
Hardware watchpoint 2: -location rm->body.mutex
(rr) reverse-continue
Continuing.
Thread 1 hit Hardware watchpoint 2: -location rm->body.mutex
Old value = (uv_mutex_t *) 0x55e7aab33050
New value = (uv_mutex_t *) 0x0
0x00007fd13f73aa4b in initialize_mutex (tc=0x55e790466100, rm=0x55e7aee15e68) at src/6model/reprs/ReentrantMutex.c:9
9 rm->mutex = MVM_malloc(sizeof(uv_mutex_t));
(rr) bt
#0 0x00007fd13f73aa4b in initialize_mutex (tc=0x55e790466100, rm=0x55e7aee15e68) at src/6model/reprs/ReentrantMutex.c:9
#1 0x00007fd13f73ab95 in initialize (tc=0x55e790466100, st=0x55e7904beff0, root=0x55e7aee15e50, data=0x55e7aee15e68) at src/6model/reprs/ReentrantMutex.c:33
#2 0x00007fd13f6ff6b7 in MVM_repr_alloc_init (tc=0x55e790466100, type=0x55e7904ca780) at src/6model/reprconv.c:20
#3 0x00007fd13f71b7fa in initialize (tc=0x55e790466100, st=0x55e7904beb40, root=0x55e790503b40, data=0x55e790503b58) at src/6model/reprs/MVMCompUnit.c:25
#4 0x00007fd13f6ff6b7 in MVM_repr_alloc_init (tc=0x55e790466100, type=0x55e7904ca6f0) at src/6model/reprconv.c:20
#5 0x00007fd13f69ef22 in MVM_cu_from_bytes (tc=0x55e790466100, bytes=0x55e7af9dd890 "MOARVM\r\n\a", size=1701384) at src/core/compunit.c:15
#6 0x00007fd13f6b2917 in MVM_load_bytecode_buffer_to_cu (tc=0x55e790466100, buf=0x55e7acfa0688, res=0x55e79057c620) at src/core/loadbytecode.c:73
#7 0x00007fd13f68b53d in MVM_interp_run (tc=0x55e790466100, initial_invoke=0x7fd13f7f2256 <toplevel_initial_invoke>, invoke_data=0x55e790515078, outer_runloop=0x0) at src/core/interp.c:5142
#8 0x00007fd13f7f23d0 in MVM_vm_run_file (instance=0x55e7904655c0, filename=0x55e790465550 "/home/dan/Source/perl6/install/share/perl6/runtime/perl6.moarvm") at src/moar.c:504
#9 0x000055e78f1e17ce in main (argc=<optimized out>, argv=0x7fff1f218958) at src/vm/moar/runner/main.c:472
(rr)
[dan@alexandria perl6]$ rr replay
GNU gdb (GDB) 10.2
Copyright (C) 2021 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-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /home/dan/.local/share/rr/raku-2/mmap_hardlink_3_rakudo...
Really redefine built-in command "restart"? (y or n) [answered Y; input not from terminal]
Remote debugging using 127.0.0.1:10379
Reading symbols from /lib64/ld-linux-x86-64.so.2...
(No debugging symbols found in /lib64/ld-linux-x86-64.so.2)
0x00007fd13fe65090 in _start () from /lib64/ld-linux-x86-64.so.2
(rr) b MVM_panic
Function "MVM_panic" not defined.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (MVM_panic) pending.
(rr) continue
Continuing.
0
1
[New Thread 2194193.2194194]
Thread 1 hit Breakpoint 1, MVM_panic (exitCode=1, messageFormat=0x7fd13f871940 "Tried to garbage-collect a locked mutex") at src/core/exceptions.c:853
853 MVM_NO_RETURN void MVM_panic(MVMint32 exitCode, const char *messageFormat, ...) {
(rr) watch -l (MVMuint64*)rm->body.mutex->__data
No symbol "rm" in current context.
(rr) f 1
#1 0x00007fd13f73ac0d in gc_free (tc=0x55e790466100, obj=0x55e7aee15e50) at src/6model/reprs/ReentrantMutex.c:46
46 MVM_panic(1, "Tried to garbage-collect a locked mutex");
(rr) watch -l (MVMuint64*)rm->body.mutex->__data
Hardware watchpoint 2: -location (MVMuint64*)rm->body.mutex->__data
(rr) reverse-continue
Continuing.
Thread 1 hit Hardware watchpoint 2: -location (MVMuint64*)rm->body.mutex->__data
Old value = (MVMuint64 *) 0x1
New value = (MVMuint64 *) 0x0
0x00007fd13f23944f in pthread_mutex_lock () from /usr/lib/libpthread.so.0
(rr) bt
#0 0x00007fd13f23944f in pthread_mutex_lock () from /usr/lib/libpthread.so.0
#1 0x00007fd13f84b6b9 in uv_mutex_lock (mutex=<optimized out>) at 3rdparty/libuv/src/unix/thread.c:331
#2 0x00007fd13f73ae26 in MVM_reentrantmutex_lock (tc=0x55e790466100, rm=0x55e7aee15e50) at src/6model/reprs/ReentrantMutex.c:143
#3 0x00007fd13f6a3ccf in instrumentation_level_barrier (tc=0x55e790466100, static_frame=0x55e7934ea160) at src/core/frame.c:102
#4 0x00007fd13f6a4a28 in MVM_frame_invoke (tc=0x55e790466100, static_frame=0x55e7934ea160, callsite=0x7fd13fdec840 <null_args_callsite>, args=0x55e7905f09d0, outer=0x55e793dafeb8, code_ref=0x55e7ae2f8a18, spesh_cand=-1)
at src/core/frame.c:408
#5 0x00007fd13f71a4fe in invoke_handler (tc=0x55e790466100, invokee=0x55e7ae2f8a18, callsite=0x7fd13fdec840 <null_args_callsite>, args=0x55e7905f09d0) at src/6model/reprs/MVMCode.c:10
#6 0x00007fd13f66b659 in MVM_interp_run (tc=0x55e790466100, initial_invoke=0x7fd13f7f2256 <toplevel_initial_invoke>, invoke_data=0x55e790515078, outer_runloop=0x0) at src/core/interp.c:1105
#7 0x00007fd13f7f23d0 in MVM_vm_run_file (instance=0x55e7904655c0, filename=0x55e790465550 "/home/dan/Source/perl6/install/share/perl6/runtime/perl6.moarvm") at src/moar.c:504
#8 0x000055e78f1e17ce in main (argc=<optimized out>, argv=0x7fff1f218958) at src/vm/moar/runner/main.c:472
(rr) reverse-continue
Continuing.
Thread 1 hit Hardware watchpoint 2: -location (MVMuint64*)rm->body.mutex->__data
Old value = (MVMuint64 *) 0x0
New value = (MVMuint64 *) 0x1
0x00007fd13f23ac8b in __pthread_mutex_unlock_usercnt () from /usr/lib/libpthread.so.0
(rr) reverse-continue
Continuing.
Thread 1 hit Hardware watchpoint 2: -location (MVMuint64*)rm->body.mutex->__data
Old value = (MVMuint64 *) 0x1
New value = (MVMuint64 *) 0x0
0x00007fd13f23944f in pthread_mutex_lock () from /usr/lib/libpthread.so.0
(rr) reverse-continue
Continuing.
Thread 1 hit Hardware watchpoint 2: -location (MVMuint64*)rm->body.mutex->__data
Old value = (MVMuint64 *) 0x0
New value = (MVMuint64 *) 0x55e2cd2ceef3
0x00007fd13f238b6e in pthread_mutex_init () from /usr/lib/libpthread.so.0
(rr) bt
#0 0x00007fd13f238b6e in pthread_mutex_init () from /usr/lib/libpthread.so.0
#1 0x00007fd13f84b5eb in uv_mutex_init (mutex=<optimized out>) at 3rdparty/libuv/src/unix/thread.c:284
#2 0x00007fd13f73aa5d in initialize_mutex (tc=0x55e790466100, rm=0x55e7aee15e68) at src/6model/reprs/ReentrantMutex.c:10
#3 0x00007fd13f73ab95 in initialize (tc=0x55e790466100, st=0x55e7904beff0, root=0x55e7aee15e50, data=0x55e7aee15e68) at src/6model/reprs/ReentrantMutex.c:33
#4 0x00007fd13f6ff6b7 in MVM_repr_alloc_init (tc=0x55e790466100, type=0x55e7904ca780) at src/6model/reprconv.c:20
#5 0x00007fd13f71b7fa in initialize (tc=0x55e790466100, st=0x55e7904beb40, root=0x55e790503b40, data=0x55e790503b58) at src/6model/reprs/MVMCompUnit.c:25
#6 0x00007fd13f6ff6b7 in MVM_repr_alloc_init (tc=0x55e790466100, type=0x55e7904ca6f0) at src/6model/reprconv.c:20
#7 0x00007fd13f69ef22 in MVM_cu_from_bytes (tc=0x55e790466100, bytes=0x55e7af9dd890 "MOARVM\r\n\a", size=1701384) at src/core/compunit.c:15
#8 0x00007fd13f6b2917 in MVM_load_bytecode_buffer_to_cu (tc=0x55e790466100, buf=0x55e7acfa0688, res=0x55e79057c620) at src/core/loadbytecode.c:73
#9 0x00007fd13f68b53d in MVM_interp_run (tc=0x55e790466100, initial_invoke=0x7fd13f7f2256 <toplevel_initial_invoke>, invoke_data=0x55e790515078, outer_runloop=0x0) at src/core/interp.c:5142
#10 0x00007fd13f7f23d0 in MVM_vm_run_file (instance=0x55e7904655c0, filename=0x55e790465550 "/home/dan/Source/perl6/install/share/perl6/runtime/perl6.moarvm") at src/moar.c:504
#11 0x000055e78f1e17ce in main (argc=<optimized out>, argv=0x7fff1f218958) at src/vm/moar/runner/main.c:472
(rr)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment