[PATCH] check_native: Get rid of alloca

Florian Weimer fweimer@redhat.com
Thu Jun 1 09:07:01 GMT 2023


* Andreas Schwab:

> On Jun 01 2023, Florian Weimer wrote:
>
>> The current code does handle cancellation.  Isn't sendto a cancellation
>> point?
>
> Cancellation depends on unwinding.

Sorry, I meant to write “does NOT handle cancellation”.

>> In any case, we'd have to build with -fexceptions to turn the destructor
>> into a cancellation handler, not -fasynchronous-unwind-tables.
>
> -fexceptions does not enable asynchronous unwinding.

But the unwinding is synchronous if it is triggered from a cancellation
point because on the caller side, it looks like we are unwinding through
a regular function call which is not _THROW.

Using malloc will never be async-cancel-safe.

Anyway, if we use __attribute__ ((cleanup)) to write cancellation
handlers (as opposed to mere destructors), that definitely is worthy of
discussion.

Thanks,
Florian



More information about the Libc-alpha mailing list