[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Potential spiped 1.6.1 release -- please test
- To: Peter Pentchev <roam@ringlet.net>, Graham Percival <gperciva@tarsnap.com>
- Subject: Re: Potential spiped 1.6.1 release -- please test
- From: Colin Percival <cperciva@tarsnap.com>
- Date: Sat, 8 Feb 2020 14:32:54 -0800
- Autocrypt: addr=cperciva@tarsnap.com; prefer-encrypt=mutual; keydata= mQGhBElrAAcRBACDfDys4ZtK+ErCJ1HAzYeteKpm3OEsvT/49AjUTLihkF79HhIKrCQU+1KC zv7BwHCMLb6hq30As9L7iFKG7n5QFLFC4Te/VcITUnWHMG/c3ViLOfJGvi+9/nOEHaM1dVJY D6tEp5yM1nHmVQpo9932j4KGuGFR0LhOK5IHXOSfGwCgxSFDPdgxe2OEjWxjGgY+oV3EafcD +JROXCTjlcQiG/OguQH4Vks3mhHfFnEppLxTkDuYgHZQiUtpcT9ssH5khgqoTyMar05OUdAj ZIhNbWDh4LgTj+7ZmvLhXT5Zxw8LX9d7T36aTB8XDQSenDqEtinMWOb0TCBBLbsB8EFG1WTT ESbZci9jJS5yhtktuZoY/eM8uXMD/3k4FWFO80VRRkELSp+XSy/VlSQjyi/rhl2nQq/oOA9F oJbDaB0yq9VNhxP+uFBzBWSqeIX0t1ZWLtNfVFr4TRP5hihI5ICrg/0OpqgisKsU2NFe9xyO hyJLYmfD8ebpDJ/9k30C7Iju9pVrwLm1QgS4S2fqJRcR+U4WbjvP7CgStCVDb2xpbiBQZXJj aXZhbCA8Y3BlcmNpdmFAdGFyc25hcC5jb20+iGEEExECACEFAklrALYCGwMHCwkIBwMCAQQV AggDBBYCAwECHgECF4AACgkQOM7KaQxqam6/igCgn+z2k3V5ggNppmWrZstt1U2lugsAoL7L wS9V9yLtil3oWmHtwpUqYruEuQINBElrAAcQCAD3ZLMIsP4CIDoJORg+YY0lqLVBgcnF7pFb 4Uy2+KvdWofN+DKH61rZLjgXXkNE9M4EQC1B4lGttBP8IY2gs41y3AUogGdyFbidq99rCBz7 LTsgARHwFxZoaHmXyiZLEU1QZuMqwPZV1mCviRhN5E3rRqYNXVcrnXAAuhBpvNyj/ntHvcDN 2/m+ochiuBYueU4kX3lHya7sOj+mTsndcWmQ9soOUyr8O0r/BG088bMn4qqtUw4dl5/pglXk jbl7uOOPinKf0WVd2r6M0wLPJCD4NPHrCWRLLLAjwfjrtoSRvXxDbXhCdgGBa72+K8eYLzVs hgq7tJOoBWzjVK6XRxR7AAMGB/9Mo3iJ2DxqDecd02KCB5BsFDICbJGhPltU7FwrtbC7djSb XUrwsEVLHi4st4cbdGNCWCrp0BRezXZKohKnNAPFOTK++ZfgeKxrV2sJod+Q9RILF86tQ4XF 7A7Yme5hy92t/WgiU4vc/fWbgP8gV/19f8nunaT2E9NSa70mZFjZNu4iuwThoUUO5CV3Wo0Y UISsnRK8XD1+LR3A2qVyLiFRwh/miC1hgLFCTGCQ3GLxZeZzIpYSlGdQJ0L5lixW5ZQD9r1I 8i/8zhE6qRFAM0upUMI3Gt1Oq2w03DiXrZU0Fu/R8Rm8rlnkQKA+95mRTUq1xL5P5NZIi4gJ Z569OPMFiEkEGBECAAkFAklrAAcCGwwACgkQOM7KaQxqam41igCfbaldnFTu5uAdrnrghESv EI3CAo8AoLkNMks1pThl2BJNRm4CtTK9xZeH
- Cc: spiped@tarsnap.com
- In-reply-to: <20200208210542.GA8965@straylight.m.ringlet.net>
- References: <f6e9d6c4-a55f-1d33-86af-f3ceedacc2c0@tarsnap.com> <20191228114552.GE6207@straylight.m.ringlet.net> <20191228120044.GF6207@straylight.m.ringlet.net> <20191231024816.GA1966@mac> <20200208210542.GA8965@straylight.m.ringlet.net>
On 2020-02-08 13:05, Peter Pentchev wrote:
> Apparently glibc really, really doesn't believe in cancelling a thread
> that has already completed... I'm not really sure what to think about
> that, since, well, the thread hasn't been joined yet, so technically it
> still exists, albeit in a zombie-like state - and a little test program
> of mine shows that even after a thread has exited and pthread_cancel()
> returns ESRCH, a call to pthread_join() will succeed and will provide
> the correct value returned by the thread function. I'm not sure whether
> this is glibc or the Linux kernel or something else - the behavior is
> the same on three systems I've tested it on: [...]
Ok, this is definitely a bug: pthread_cancel is absolutely supposed to
work on threads which have exited but not joined yet.
Can you produce a minimal test case which exhibits this so that it can
be reported upstream (to glibc or Linux kernel folks -- I'm not sure who
but hopefully they can forward to each other if we get it wrong)?
> So I could keep the check for ESRCH as a Debian-specific patch, or you
> could make it conditional on __linux__ or __gnu_linux__ or something
> similar. What do you think?
My general policy with "operating system doesn't do what POSIX says it
should" is to have "#ifdef POSIXFAIL_FOO" in the code and a test as part
of libcperciva/POSIX/posix-cflags.sh which defines that macro on the
appropriate systems (which might just be "anything Linux" for now, but in
the future might depend on the version of glibc).
--
Colin Percival
Security Officer Emeritus, FreeBSD | The power to serve
Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid