[PATCH] cdtest: Restrict exceptions during sysinit

Sebastian Huber sebastian.huber at embedded-brains.de
Thu Jul 14 08:39:07 UTC 2022



On 14/07/2022 10:33, Chris Johns wrote:
> On 14/7/2022 4:08 pm, Sebastian Huber wrote:
>> On 14/07/2022 02:36, Chris Johns wrote:
>>>> Exceptions during system initialization work only on targets which do not need
>>>> a registration of exception frames during the global construction.  In
>>>> particular, targets which use the DWARF2 unwinder cannot use exceptions during
>>>> system initialization.
>>> I would like to complete the discussion on the other thread about this issue
>>> before we work around the issue like this.
>>>
>>> If this patch masks a failure that the standard expects to work we should not
>>> hide it.
>> Don't shoot the messenger. This is a fundamental limitation of the DWARF2 unwinder.
>>
> I am sorry, I did not mean to say it was your fault.
> 
> So this has been an issue for while? I have been through this area of code a
> while back when adding support for libdl.

This problem exists since the global construction is done by the 
initialization thread.

> 
> If exceptions work post construction is the issue the ordering of a call somewhere?

If you create a thread during system initialization and this thread runs 
before the global construction and it uses a C++ exception, then you end 
up with a failed gcc_assert().

I think the message is clear, applications should start their work in 
the initialization thread.

-- 
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.huber at embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/


More information about the devel mailing list