varnishcache / varnish-cache

Varnish Cache source code repository
https://www.varnish-cache.org
Other
3.65k stars 374 forks source link

pthread_cond_{timed,}wait shall not return an error code of [EINTR]. #4058

Closed nigoroll closed 7 months ago

nigoroll commented 7 months ago

Nitpick noticed during review of #4030

https://pubs.opengroup.org/onlinepubs/009604599/functions/pthread_cond_timedwait.html

Piling as a PR because of the freeze

FYI this goes back to eecd409d13f145765de3aeee4984179e0ae008b5

walid-git commented 7 months ago

I found something interesting about this: https://github.com/varnishcache/varnish-cache/commit/43af86cc40ed78a4b41be60fa3542e45ad644285

nigoroll commented 7 months ago

I found something interesting about this: 43af86c

Should we maybe wrap the assertion and make acceptance of EINTR conditional like #if HAVE_SANITIZER_ASAN_INTERFACE_H or #if ENABLE_ASAN?

Note: I am an ASAN noob.

nigoroll commented 7 months ago

bugwash: @Dridi will present something in this area

nigoroll commented 7 months ago

So, I overlooked that it was me who initially added tolerance of EINTR in 0895d2e61f61c2942e6bc4db3347adec7966d6c2, which is embarrassing and I will go back to the elementary school of git.

The question was raised where this originates and I found this in my IRC attic of Mon 09 May 2016:

(10:13:40) phk: when does EINTR even happen ? (10:13:49) slink: on SIGSTOP

It might well have been something observed on Solaris.

so we'll just leave it as is.

dridi commented 7 months ago

Also encountered with sanitizers, see 43af86cc40ed78a4b41be60fa3542e45ad644285 too.