Skip to contentSkip to conversation

pthread_cleanup_push_defer_np.3: missing functions in glibc

DISCUSSION Alejandro Colomar (man-pages) 3 participants 6 messages Mar 8, 2021 Man-pages: manual pages for Linux -- Sections 2, 3, 4, 5, and 7

lore
Share & tools
lore
#0 lore raw

Hi Michael, Florian,

While adding 'restrict' to the prototypes, I found that the functions defined in this page don't exist on glibc (or I couldn't find them). I tried removing _np, and still no luck, and 'git log --grep' didn't help either. Where these functions removed at some point?

Thanks,

Alex

Signature · 3 lines
Alejandro Colomar
Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/
http://www.alejandro-colomar.es/
#1 lore raw

* Alejandro Colomar:

Quoted 4 lines

While adding 'restrict' to the prototypes, I found that the functions defined in this page don't exist on glibc (or I couldn't find them). I tried removing _np, and still no luck, and 'git log --grep' didn't help either. Where these functions removed at some point?

Yes, they are part of the legacy cancellation implementation that predates DWARF unwinding.

Thanks,
Florian

#2 lore raw

Hi Florian,

Quoted 9 lines · Florian Weimer

* Alejandro Colomar:

Quoted 4 lines

While adding 'restrict' to the prototypes, I found that the functions defined in this page don't exist on glibc (or I couldn't find them). I tried removing _np, and still no luck, and 'git log --grep' didn't help either. Where these functions removed at some point?

Yes, they are part of the legacy cancellation implementation that predates DWARF unwinding.

Thanks for the info. I guess we should add that to the manual page. I've tried checking out some quite old versions of glibc and still didn't find the functions. If you know more details about when they were removed, please tell me and I'll update it.

Thanks,

Alex

Signature · 3 lines
Alejandro Colomar
Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/
http://www.alejandro-colomar.es/
#4 lore raw
In reply to Alejandro Colomar (man-pages)
Quoted 2 lines · Alejandro Colomar (man-pages) via Libc-alpha

While adding 'restrict' to the prototypes, I found that the functions defined in this page don't exist on glibc (or I couldn't find them).

sysdeps/nptl/pthread.h:#   define pthread_cleanup_push_defer_np(routine, arg) \
sysdeps/nptl/pthread.h:#   define pthread_cleanup_pop_restore_np(execute) \
sysdeps/nptl/pthread.h:#   define pthread_cleanup_push_defer_np(routine, arg) \
sysdeps/nptl/pthread.h:#   define pthread_cleanup_pop_restore_np(execute) \

sysdeps/nptl/pthread.h:# define pthread_cleanup_push_defer_np(routine, arg) \
sysdeps/nptl/pthread.h:# define pthread_cleanup_pop_restore_np(execute) \

Andreas.

Signature · 3 lines
Andreas Schwab, [email protected]
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."
#3 lore raw
In reply to Alejandro Colomar (man-pages)

* Alejandro Colomar:

Quoted 9 lines

Hi Florian,

Quoted 6 lines · Florian Weimer

* Alejandro Colomar:

Quoted 4 lines

While adding 'restrict' to the prototypes, I found that the functions defined in this page don't exist on glibc (or I couldn't find them). I tried removing _np, and still no luck, and 'git log --grep' didn't help either. Where these functions removed at some point?

Quoted 7 lines
Quoted 2 lines

Yes, they are part of the legacy cancellation implementation that predates DWARF unwinding.

Thanks for the info. I guess we should add that to the manual page. I've tried checking out some quite old versions of glibc and still didn't find the functions. If you know more details about when they were removed, please tell me and I'll update it.

LinuxThreads had this:

/* Install a cleanup handler as pthread_cleanup_push does, but also
saves the current cancellation type and set it to deferred cancellation. */

#define pthread_cleanup_push_defer_np(routine,arg) \

  { struct _pthread_cleanup_buffer _buffer;                                   \
    _pthread_cleanup_push_defer (&_buffer, (routine), (arg));

extern void _pthread_cleanup_push_defer __P ((struct _pthread_cleanup_buffer *__buffer,

                                              void (*__routine) (void *),
                                              void *__arg));

This is from sysdeps/pthread/pthread.h in glibc-linuxthreads-2.0.1.tar.gz. It was part of an add-on, not glibc proper. This may make it a bit difficult to identify the release where it was definitely removed.

Thanks,
Florian

#5 lore raw
In reply to Andreas Schwab
Quoted 5 lines · Andreas Schwab
Quoted 2 lines · Alejandro Colomar (man-pages) via Libc-alpha

While adding 'restrict' to the prototypes, I found that the functions defined in this page don't exist on glibc (or I couldn't find them).

Quoted 9 lines
sysdeps/nptl/pthread.h:#   define pthread_cleanup_push_defer_np(routine, arg) \
sysdeps/nptl/pthread.h:#   define pthread_cleanup_pop_restore_np(execute) \
sysdeps/nptl/pthread.h:#   define pthread_cleanup_push_defer_np(routine, arg) \
sysdeps/nptl/pthread.h:#   define pthread_cleanup_pop_restore_np(execute) \

sysdeps/nptl/pthread.h:# define pthread_cleanup_push_defer_np(routine, arg) \
sysdeps/nptl/pthread.h:# define pthread_cleanup_pop_restore_np(execute) \

Andreas.

D'oh! I was writing *phtread* all the time (and I suspected that I was writing a typo, and still didn't find it :p ). Never mind.

Thanks,

Alex

Signature · 3 lines
Alejandro Colomar
Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/
http://www.alejandro-colomar.es/