[issue12905] multiple errors in test_socket on OpenBSD

STINNER Victor report at bugs.python.org
Tue Sep 6 22:58:04 CEST 2011


STINNER Victor <victor.stinner at haypocalc.com> added the comment:

> I tried the following script on OpenBSD 5 with Python 3.3: ...

Bad news: the script doesn't hang if Python is build without threads.

Short C program to test interrupted syscalls:
-------------                                                                                                    
#include <signal.h>
#include <stdio.h>
#include <pthread.h>

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

void _noop()
{
}

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

pthread_t thread1;
pthread_create(&thread1, NULL, (void *) _noop, &dummy);
pthread_join(thread1, NULL);


signal(s, handler);
siginterrupt(s, 1);
alarm(1);
printf("read...\n");
n = read(0, buffer, 1024);
printf("read->%i\n", n);
return 0;
}
-------------

read() is interrupted after 1 second, it works.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12905>
_______________________________________


More information about the Python-bugs-list mailing list