This is the mail archive of the
gdb-prs@sources.redhat.com
mailing list for the GDB project.
Re: threads/1585: pthread_create generates notify to semaphore when run under gdb
- From: Michael Chastain <mec dot gnu at mindspring dot com>
- To: chastain at sourceware dot org
- Cc: gdb-prs at sources dot redhat dot com,
- Date: 28 Aug 2004 15:38:00 -0000
- Subject: Re: threads/1585: pthread_create generates notify to semaphore when run under gdb
- Reply-to: Michael Chastain <mec dot gnu at mindspring dot com>
The following reply was made to PR threads/1585; it has been noted by GNATS.
From: Michael Chastain <mec.gnu@mindspring.com>
To: gdb-gnats@sources.redhat.com, bbr@lampreynetworks.com
Cc:
Subject: Re: threads/1585: pthread_create generates notify to semaphore when
run under gdb
Date: Sat, 28 Aug 2004 11:37:23 -0400
The man page does not match what sem_wait actually does.
Like almost every other system call in the linux kernel, sem_wait can
return EINTR if a signal arrives during the wait time.
This behavior is explicitly allowed by the single unix specification,
version 3.
http://www.opengroup.org/onlinepubs/009695399/functions/sem_wait.html
The gotcha is that when a program runs under gdb, it receives more
signals than when it does not run under gdb. And yes, this is
surprising and annoying.
See the section "Thread Stops" in the gdb manual (gdb 6.1 or later)
for a detailed explanation of this.