[issue12905] multiple errors in test_socket on OpenBSD
STINNER Victor
report at bugs.python.org
Tue Sep 6 23:06:43 CEST 2011
STINNER Victor <victor.stinner at haypocalc.com> added the comment:
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).
----------
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12905>
_______________________________________
More information about the Python-bugs-list
mailing list