lkml.org 
[lkml]   [2020]   [Apr]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [RFC PATCH glibc 1/3] glibc: Perform rseq(2) registration at C startup and thread creation (v18)
Date
* 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

\
 
 \ /
  Last update: 2020-04-30 19:08    [W:0.101 / U:0.768 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site