[PATCH v7 2/5] nptl: Add __raise_direct
Adhemerval Zanella Netto
adhemerval.zanella@linaro.org
Tue Mar 17 13:41:31 GMT 2026
On 16/03/26 07:04, Florian Weimer wrote:
> * Samuel Thibault:
>
>> Hello,
>>
>> Florian Weimer, le lun. 02 mars 2026 10:39:07 +0100, a ecrit:
>>> * Adhemerval Zanella:
>>>
>>>> diff --git a/sysdeps/htl/raise.c b/sysdeps/htl/raise.c
>>>> index 3200f91634..9c8bccc5a9 100644
>>>> --- a/sysdeps/htl/raise.c
>>>> +++ b/sysdeps/htl/raise.c
>>>> @@ -51,6 +51,9 @@ raise (int signo)
>>>> else
>>>> return __kill (__getpid (), signo);
>>>> }
>>>> +/* TODO: __raise_direct should not change errno and work during process
>>>> + startup. */
>>>> +weak_alias (raise, __raise_direct)
>>>
>>> Sam, Guy, could you help with this?
>>
>> Sure. But what point of "process startup" is that about? Are we sure
>> that no pthread was created so it's really only to be sent to the
>> process, for instance?
>
> It's for an internal assertion failure during static process startup.
>
> The dynamic linker currently redefines __assert_fail to something that
> does not use signals (see elf/dl-minimal.c). However, we should
> probably generate coredumps for ld.so assertion failures, too, so I
> would like to change that eventually.
The problem is for the dynamic case where __assert_fail is called, for
static case it does issue the signal.
$ strace -f elf/tst-assert-startup-static --direct
execve("elf/tst-assert-startup-static", ["elf/tst-assert-startup-static", "--direct"], 0x7fffbf3adcc0 /* 43 vars */) = 0
writev(2, [{iov_base="Fatal glibc error: ", iov_len=19}, {iov_base="tst-assert-startup-static.c", iov_len=27}, {iov_base=":", iov_len=1}, {iov_base="33", iov_len=2}, {iov_base=" (", iov_len=2}, {iov_base="__tunables_init", iov_len=15}, {iov_base="): assertion failed: ", iov_len=21}, {iov_base="error", iov_len=5}, {iov_base="\n", iov_len=1}], 9Fatal glibc error: tst-assert-startup-static.c:33 (__tunables_init): assertion failed: error
) = 93
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x799c03e47000
gettid() = 303391
tkill(303391, SIGABRT) = 0
--- SIGABRT {si_signo=SIGABRT, si_code=SI_TKILL, si_pid=303391, si_uid=1000} ---
+++ killed by SIGABRT +++
Aborted
I will check if we can raise the signal on loader as well.
More information about the Libc-alpha
mailing list