[OpenAFS-devel] 1.2.9: Pthreads and signals combination is broken.

Harald Barth haba@pdc.kth.se
Thu, 08 May 2003 09:36:04 +0200 (CEST)


> Clearly you found the calls. From your own diff:
> +  AFS_SIGSET_CLEAR();

Used in butc. Used for the rx server thread. Not used in the 1.2.9
fileserver.

Is it used anywhere else? The AFS_SIGSET_CLEAR/AFS_SIGSET_RESTORE pair was
converted to some kind of unbalanced thing 

http://www.openafs.org/cgi-bin/cvsweb.cgi/openafs/src/viced/viced.c.diff?r1=1.11.2.4&r2=1.11.2.5

and then removed completely from the helper threads.

http://www.openafs.org/cgi-bin/cvsweb.cgi/openafs/src/viced/viced.c.diff?r1=1.11.2.5&r2=1.11.2.6

Mattiasa pointed me to

http://www.opengroup.org/onlinepubs/007904975/xrat/xsh_chap02.html#tag_03_02_03_02

which leads to that Tru64 5.0 is not following 1003.1-2001. I think it is
1003.1c-1995 and that might give back an EINTR from sigwait().

1003.1-2001 says
>In particular, in none of the functions flockfile(),
>pthread_cond_timedwait(), pthread_cond_wait(), pthread_join(),
>pthread_mutex_lock(), and sigwait() did providing [EINTR] returns add
>value, or even particularly make sense.

Of the above mentioned calls, sigwait() is in fact the only one which
I could see that EINTR makes some kind of sense (you waited for
something else and then you got this strange signal), so I do not
completely agree (but now it is a standard, dammit :-)

Harald.