[PATCH v7 4/5] Fix assert during static startup

Adhemerval Zanella Netto adhemerval.zanella@linaro.org
Mon Mar 2 12:18:49 GMT 2026



On 02/03/26 09:11, Florian Weimer wrote:
> * Adhemerval Zanella Netto:
> 
>> On 02/03/26 06:36, Florian Weimer wrote:
>>> * Adhemerval Zanella:
>>>
>>>> +void __tunables_init (char **env)
>>>> +{
>>>> +  /* The test aims to mimic how assert works during process startup, and thus
>>>> +     calling assert will issue __libc_assert (_(...)) which in turn may call
>>>> +     __dcgettext.  */
>>>> +  __libc_assert_fail ("error", __FILE__, __LINE__, __func__);
>>>> +}
>>>
>>> I think “thus” is very confusing here.  I thought the issue is that we
>>> can't call assert here because it calls __dcgettext, and this wouldn't
>>> match how assert is implemented during startup?
>>
>> Right, maybe?
>>
>>   /* The test aims to mimic how assert works during process startup, and
>>      calling assert issues __libc_assert (_(...)) which in turn call
>>      __dcgettext.   */
> 
> Doesn't really convey that we're not ussing assert because we don't want
> __dcgettext.
> 
> Thanks,
> Florian
> 

Maybe then:

/* The assert called by the loader/startup issues __libc_assert_fail instead
   of __libc_assert, and __libc_assert_fail does issues the translation
   routines (which would require additional handling to be called at this
   point, like disable stack protection).  So issue the internal routine
   directly, instead of using assert here.  */




More information about the Libc-alpha mailing list