On 07/09/18 19:17, Andrew Donnellan wrote:
After installing all the debug symbols required, I see the following gdb
backtrace and valgrind output:
(gdb) run /usr/share/doc/pinpoint/examples/introduction.pin
Starting program: /usr/bin/pinpoint
/usr/share/doc/pinpoint/examples/introduction.pin
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffe77d7700 (LWP 32504)]
[New Thread 0x7fffe6fd6700 (LWP 32505)]
Thread 1 "pinpoint" received signal SIGSEGV, Segmentation fault.
__GI___pthread_mutex_lock (mutex=0x20) at ../nptl/pthread_mutex_lock.c:67
67 ../nptl/pthread_mutex_lock.c: No such file or directory.
(gdb) bt
#0 __GI___pthread_mutex_lock (mutex=0x20) at
../nptl/pthread_mutex_lock.c:67
#1 0x00007ffff41f325a in XrmQGetResource () from
/usr/lib/x86_64-linux-gnu/libX11.so.6
Googling for this led me to a few other Debian bug reports that appear
to show segfaults in the XrmQGetResource() path, e.g.
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=700015
#700015 suggests that there's a missing call to XInitThreads() which
results in uninitialised mutexes.
To verify this, I did the same thing suggested at
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=700015#10 and invoked
XInitThreads() manually in gdb:
(gdb) break main
Breakpoint 1 at 0x5490: file pinpoint.c, line 191.
(gdb) run /usr/share/doc/pinpoint/examples/introduction.pin
Starting program: /usr/bin/pinpoint
/usr/share/doc/pinpoint/examples/introduction.pin
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Breakpoint 1, main (argc=2, argv=0x7fffffffddd8) at pinpoint.c:191
191 pinpoint.c: No such file or directory.
(gdb) call XInitThreads()
$1 = 1
(gdb) continue
It appears that this fixes the problem.
I haven't looked as far as figuring out where the right place to put
this XInitThreads() call would be - maybe pinpoint itself, maybe one of
its graphics libraries, or maybe the libraries aren't being invoked
properly...
--
Andrew Donnellan OzLabs, ADL Canberra
[email protected] IBM Australia Limited