Re: __pthread_setcancelstate called unconditionally, crashes at 0

2023-05-11 Thread Florian Weimer
* Sergey Bugaev: > Do user programs in practice rely on the fact that pthread > cancellation does unwinding and so calls object destructors, runs > @finally clauses, etc? I think so, yes. I don't recall introducing a regression in that part of cancellation, so we don't have good usage data unfor

Re: __pthread_setcancelstate called unconditionally, crashes at 0

2023-05-11 Thread Sergey Bugaev
On Thu, May 11, 2023 at 9:12 PM Florian Weimer wrote: > I'd expect __pthread_setcancelstate to act on asynchronous cancellation > if it is enabled. Once you implement that and have a strong symbol > reference to __pthread_setcancelstate, you'd pull in the cancellation > unwinder without additiona

Re: __pthread_setcancelstate called unconditionally, crashes at 0

2023-05-11 Thread Florian Weimer
* Sergey Bugaev: >> If you need async cancellation support, the core cancellation routine >> could be made weak, so that it is linked into the executable only if >> pthread_cancel is ever called. > > Could you please expand on how this all (unwinding, async > cancellation) is relevant? Clearly cal

Re: __pthread_setcancelstate called unconditionally, crashes at 0

2023-05-11 Thread Sergey Bugaev
On Thu, May 11, 2023 at 8:44 PM Florian Weimer wrote: > Apparently, Hurd does not support async cancellation? Then > __pthread_setcancelstate never has to unwind, so you just turn it into a > non-weak symbol. It does in theory, htl/pt-cancel.c has a PTHREAD_CANCEL_ASYNCHRONOUS branch that calls i

Re: __pthread_setcancelstate called unconditionally, crashes at 0

2023-05-11 Thread Florian Weimer
* Samuel Thibault: > Florian Weimer, le jeu. 11 mai 2023 19:44:42 +0200, a ecrit: >> * Sergey Bugaev: >> > Clearly __pthread_setcancelstate has been pragma weak'd, and used here >> > without a check. This is a statically linked x86_64-gnu (so, Hurd and >> > HTL) executable. Commit 93d78ec1cba68184

Re: __pthread_setcancelstate called unconditionally, crashes at 0

2023-05-11 Thread Samuel Thibault
Florian Weimer, le jeu. 11 mai 2023 19:44:42 +0200, a ecrit: > * Sergey Bugaev: > > Clearly __pthread_setcancelstate has been pragma weak'd, and used here > > without a check. This is a statically linked x86_64-gnu (so, Hurd and > > HTL) executable. Commit 93d78ec1cba68184931b75bef29afd3aed30f43a >

Re: __pthread_setcancelstate called unconditionally, crashes at 0

2023-05-11 Thread Florian Weimer
* Sergey Bugaev: > Clearly __pthread_setcancelstate has been pragma weak'd, and used here > without a check. This is a statically linked x86_64-gnu (so, Hurd and > HTL) executable. Commit 93d78ec1cba68184931b75bef29afd3aed30f43a > "nptl: Move pthread_setcancelstate into libc" seems to be the culpr

__pthread_setcancelstate called unconditionally, crashes at 0

2023-05-11 Thread Sergey Bugaev
Hello, I'm hitting a crash with the following backtrace: #0 0x in ?? () #1 0x004660dd in __error_internal (status=1, errnum=1073741826, message=0x9adcef1c, args=0x9adcef18, args@entry=0x156aa48, mode_flags=2598170400, mode_flags@entry=0) at error.c:243 #2 0x0046