This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients neologix, rpointel, vstinner
Date 2011-09-06.21:06:42
SpamBayes Score 1.0936516e-05
Marked as misclassified No
Message-id <1315343203.5.0.24644450982.issue12905@psf.upfronthosting.co.za>
In-reply-to
Content
Oh, siginterrupt(SIGALRM, 0) doesn't work in a program linked to pthread. Example:
--------
#include <signal.h>
#include <stdio.h>

void
handler(int signum)
{ printf("HANDLER!\n"); }

int main()
{
int s = SIGALRM;
char buffer[1024];
int n;

signal(s, handler);
siginterrupt(s, 0);
alarm(1);
printf("read...\n");
n = read(0, buffer, 1024);
printf("read->%i\n", n);
return 0;
}
--------
This program ends after 1 second with "read->-1" if it is linked to pthread (bug!), it hangs if it is not linked to pthread (ok).
History
Date User Action Args
2011-09-06 21:06:43vstinnersetrecipients: + vstinner, neologix, rpointel
2011-09-06 21:06:43vstinnersetmessageid: <1315343203.5.0.24644450982.issue12905@psf.upfronthosting.co.za>
2011-09-06 21:06:42vstinnerlinkissue12905 messages
2011-09-06 21:06:42vstinnercreate