[Bug 212607] devel/gdb: debugging threaded process broken
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Mon Sep 12 13:55:59 UTC 2016
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=212607
Bug ID: 212607
Summary: devel/gdb: debugging threaded process broken
Product: Ports & Packages
Version: Latest
Hardware: Any
OS: Any
Status: New
Severity: Affects Only Me
Priority: ---
Component: Individual Port(s)
Assignee: freebsd-ports-bugs at FreeBSD.org
Reporter: tijl at FreeBSD.org
CC: luca.pizzamiglio at gmail.com
Flags: maintainer-feedback?(luca.pizzamiglio at gmail.com)
CC: luca.pizzamiglio at gmail.com
I'm running into a problem debugging threaded programs on FreeBSD head amd64
r304294 and i386 r305230.
The following program reproduces it, but not always:
% cat test.c
#include <pthread.h>
void *
thr( void *arg ) {
return( arg );
}
int
main( void ) {
pthread_t pthr[ 4 ];
pthread_create( &pthr[ 0 ], NULL, thr, NULL );
pthread_create( &pthr[ 1 ], NULL, thr, NULL );
pthread_create( &pthr[ 2 ], NULL, thr, NULL );
pthread_create( &pthr[ 3 ], NULL, thr, NULL );
pthread_join( pthr[ 0 ], NULL );
pthread_join( pthr[ 1 ], NULL );
pthread_join( pthr[ 2 ], NULL );
pthread_join( pthr[ 3 ], NULL );
return( 0 );
}
% cc -ggdb -o test test.c -lpthread
% gdb ./test
Reading symbols from ./test...done.
(gdb) b thr
Breakpoint 1 at 0x4007d8: file test.c, line 5.
(gdb) r
Starting program: /usr/home/tijl/test
[New LWP 100221 of process 974]
[New LWP 100222 of process 974]
[Switching to LWP 100221 of process 974]
Thread 2 hit Breakpoint 1, thr (arg=0x0) at test.c:5
5 return( arg );
(gdb) c
Continuing.
[Switching to LWP 100222 of process 974]
Thread 3 hit Breakpoint 1, thr (arg=0x0) at test.c:5
5 return( arg );
(gdb) c
Continuing.
[LWP 100221 of process 974 exited]
[LWP 100222 of process 974 exited]
[New LWP 100223 of process 974]
[Switching to LWP 100223 of process 974]
0x0000000800828990 in ?? () from /lib/libthr.so.3
ptrace: No such process.
At this point gdb seems to be in an inconsistent state.
(gdb) bt
#0 0x0000000800828990 in ?? () from /lib/libthr.so.3
#1 0x0000000000000000 in ?? ()
Backtrace stopped: Cannot access memory at address 0x7fffdfbfc000
(gdb) q
A debugging session is active.
Inferior 1 [process 974] will be killed.
Quit anyway? (y or n) y
Here gdb locks up and has to be killed with SIGKILL.
ports r411099 is the first commit that gives this behaviour.
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the freebsd-ports-bugs
mailing list