Re: [RFC PATCH glibc 1/3] glibc: Perform rseq(2) registration at C startup and thread creation (v18)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* Mathieu Desnoyers:

> If we go this way, I'd also recommend to treat any situation where
> __rseq_abi.cpu_id is already initialized as a fatal error. Does the
> code below seem OK to you ?
>
> static inline void
> rseq_register_current_thread (void)
> {
>   int ret;
>
>   if (__rseq_abi.cpu_id != RSEQ_CPU_ID_UNINITIALIZED)
>     __libc_fatal ("rseq already initialized for this thread\n");

Agreed; this should work because this code runs after relocation
processing.

>   ret = INTERNAL_SYSCALL_CALL (rseq, &__rseq_abi, sizeof (struct rseq),
>                               0, RSEQ_SIG);
>   if (INTERNAL_SYSCALL_ERROR_P (ret))
>     {
>       if (INTERNAL_SYSCALL_ERRNO (ret) == EBUSY)
>         __libc_fatal ("rseq already registered for this thread\n");
>       __rseq_abi.cpu_id = RSEQ_CPU_ID_REGISTRATION_FAILED;
>     }
> }

__libc_fatal does not attribute the error to glibc, so I suggest to
start the error messages with “glibc fatal error: ”, so that people know
where to look.

Thanks,
Florian





[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux