Skip to content

Instantly share code, notes, and snippets.

@dogbert17
Created September 4, 2021 15:27
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/8b4ce8bd13d5ca7696fcc5cf9f5d4be5 to your computer and use it in GitHub Desktop.
Save dogbert17/8b4ce8bd13d5ca7696fcc5cf9f5d4be5 to your computer and use it in GitHub Desktop.
# terminal window 1
dogbert@dogbert-VirtualBox:~/repos/rakudo$ ASAN_OPTIONS="detect_leaks=0" MVM_SPESH_NODELAY=1 make t/09-moar/01-profilers.t
+++ Checking for moar NQP version
'/usr/bin/perl' -I'/home/dogbert/repos/rakudo/tools/lib' -I'/home/dogbert/repos/rakudo/3rdparty/nqp-configure/lib' t/harness5 --moar --fudge --keep-exit-code --verbosity=1 t/09-moar/01-profilers.t
ok 1 - can launch with profiling requested
ok 2 - profiler html output file exists on disk
ok 3 - profiler html output file isn't tiny
<hung !!>
# terminal window 2, connect gdb to process
dogbert@dogbert-VirtualBox:~$ sudo gdb -p 1625259
[sudo] password for dogbert:
GNU gdb (Ubuntu 9.2-0ubuntu1~20.04) 9.2
Copyright (C) 2020 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-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://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".
Attaching to process 1625259
[New LWP 1625260]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x61e00000047c) at ../sysdeps/nptl/futex-internal.h:183
183 ../sysdeps/nptl/futex-internal.h: No such file or directory.
(gdb) info threads
Id Target Id Frame
* 1 Thread 0x7f70d9975bc0 (LWP 1625259) "moar" futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x61e00000047c) at ../sysdeps/nptl/futex-internal.h:183
2 Thread 0x7f70d6cac700 (LWP 1625260) "spesh optimizer" futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x61e000000160) at ../sysdeps/nptl/futex-internal.h:183
(gdb) bt
#0 futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x61e00000047c) at ../sysdeps/nptl/futex-internal.h:183
#1 __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x61e000000428, cond=0x61e000000450) at pthread_cond_wait.c:508
#2 __pthread_cond_wait (cond=0x61e000000450, mutex=0x61e000000428) at pthread_cond_wait.c:647
#3 0x00007f70da8bddbd in uv_cond_wait () from //home/dogbert/repos/rakudo/nqp/MoarVM/../../install/lib/libmoar.so
#4 0x00007f70da7faae3 in MVM_profile_start (tc=0x618000000080, config=0x63200000a680) at src/profiler/profile.c:33
#5 0x00007f70da46a810 in MVM_interp_run (tc=0x61e00000047c, initial_invoke=0x80, invoke_data=0x7ffe06e123c0, outer_runloop=0x7f70d9af3376 <__pthread_cond_wait+534>) at src/core/interp.c:4149
#6 0x00005621edcd8c8c in main (argc=<optimized out>, argv=<optimized out>) at src/main.c:307
(gdb) f 3
#3 0x00007f70da8bddbd in uv_cond_wait () from //home/dogbert/repos/rakudo/nqp/MoarVM/../../install/lib/libmoar.so
(gdb) l
178 in ../sysdeps/nptl/futex-internal.h
(gdb) f 4
#4 0x00007f70da7faae3 in MVM_profile_start (tc=0x618000000080, config=0x63200000a680) at src/profiler/profile.c:33
33 uv_cond_wait(&(tc->instance->cond_spesh_sync), &(tc->instance->mutex_spesh_sync));
(gdb) l
28 tc->instance->profiling_overhead = (MVMuint64) ((e - s) / 1000) * 0.9;
29
30 /* Disable profiling and discard the data we just collected. */
31 uv_mutex_lock(&(tc->instance->mutex_spesh_sync));
32 while (tc->instance->spesh_working != 0)
33 uv_cond_wait(&(tc->instance->cond_spesh_sync), &(tc->instance->mutex_spesh_sync));
34 tc->instance->profiling = 0;
35 MVM_free_null(tc->prof_data->collected_data);
36
37 MVM_profile_instrumented_free_data(tc);
(gdb) t 2
[Switching to thread 2 (Thread 0x7f70d6cac700 (LWP 1625260))]
#0 futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x61e000000160) at ../sysdeps/nptl/futex-internal.h:183
183 ../sysdeps/nptl/futex-internal.h: No such file or directory.
(gdb) bt
#0 futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x61e000000160) at ../sysdeps/nptl/futex-internal.h:183
#1 __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x61e000000108, cond=0x61e000000138) at pthread_cond_wait.c:508
#2 __pthread_cond_wait (cond=0x61e000000138, mutex=0x61e000000108) at pthread_cond_wait.c:647
#3 0x00007f70da8bddbd in uv_cond_wait () from //home/dogbert/repos/rakudo/nqp/MoarVM/../../install/lib/libmoar.so
#4 0x00007f70da516780 in MVM_gc_enter_from_allocator (tc=tc@entry=0x618000000880) at src/gc/orchestrate.c:561
#5 0x00007f70da517281 in MVM_gc_allocate_nursery (tc=0x618000000880, size=240) at src/gc/allocation.c:37
#6 0x00007f70da518270 in MVM_gc_allocate (size=<optimized out>, tc=0x618000000880) at src/gc/allocation.c:94
#7 MVM_gc_allocate_zeroed (size=<optimized out>, tc=0x618000000880) at src/gc/allocation.h:21
#8 MVM_gc_allocate_object (tc=0x618000000880, st=<optimized out>) at src/gc/allocation.c:86
#9 0x00007f70da5720a6 in MVM_repr_alloc_init (tc=tc@entry=0x618000000880, type=<optimized out>) at src/6model/reprconv.c:17
#10 0x00007f70da722a6d in MVM_spesh_candidate_add (tc=tc@entry=0x618000000880, p=0x625002f28c60) at src/6model/reprs/MVMSpeshCandidate.c:269
#11 0x00007f70da705230 in worker (tc=0x618000000880, arg_info=...) at src/spesh/worker.c:29
#12 0x00007f70da4b42c8 in thread_initial_invoke (tc=0x618000000880, data=<optimized out>) at src/core/threads.c:68
#13 0x00007f70da41bb0a in MVM_interp_run (tc=0x61e000000160, tc@entry=0x618000000880, initial_invoke=0x80, initial_invoke@entry=0x7f70da4b4150 <thread_initial_invoke>, invoke_data=0x602000000af0,
outer_runloop=0x7f70d9af3376 <__pthread_cond_wait+534>, outer_runloop@entry=0x0) at src/core/interp.c:180
#14 0x00007f70da4b457a in start_thread (data=0x602000000af0) at src/core/threads.c:101
#15 0x00007f70d9aec609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#16 0x00007f70d9c39293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
(gdb)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment