Created attachment 6739 [details] Example program, library and test script The following steps cause a segmentation fault to occur in gdb: 1. The debugged process loads a library dynamically (using dlload); 2. The user sets a tracepoint in a function in the library and starts the trace experiment; 3. The debugged process unloads the library (dlclose); 4. The user stops the trace; 5. The user issues the tfind command until no more traceframes are found 5. The user issues the "info tracepoints" The attached archive contains a simple example program and scripts, which allow to reproduce the problem. To run the scenario launch run-test.sh.
I don't see segfault on GDB 7.5 and head as below. GDB is configured as 'i686-pc-linux-gnu'. $ ./run-test.sh make: Nothing to be done for `all'. Process ./bar created; pid = 26552 Listening on port 7777 Python Exception <type 'exceptions.ImportError'> No module named gdb: warning: Could not load the Python gdb module from `/usr/local/share/gdb/python'. warning: Limited Python support is available from the _gdb module. Remote debugging from host 127.0.0.1 0x4ce4c2b0 in _start () from /lib/ld-linux.so.2 Breakpoint 1 at 0x8048662: file bar.c, line 35. Loading libfoo.so Breakpoint 1, main () at bar.c:35 35 printf("\t%i\n", foo_ptr()); Tracepoint 2 at 0xb7ffb416: file foo.c, line 5. Breakpoint 3 at 0x804867f: file bar.c, line 37. 1 Unloading libfoo.so warning: Temporarily disabling breakpoints for unloaded shared library "./libfoo.so" Breakpoint 3, main () at bar.c:37 37 return EXIT_SUCCESS; Found trace frame 0, tracepoint 2 No trace frame found Num Type Disp Enb Address What 2 tracepoint keep y <PENDING> foo Killing all inferiors
I'm sorry, I selected the incorrect version on the list above... The bug occurs on gdb 7.2: GNU gdb (Ubuntu/Linaro 7.2-1ubuntu11) 7.2 (...) This GDB was configured as "x86_64-linux-gnu". I tried to reproduce the problem on gdb 7.5 by changing the scenario a bit, but gdb didn't crash. Perhaps the bug is already fixed.