Skip to content

pthread_create interposition not registering with glibc 2.36 #11

@vlaforet

Description

@vlaforet

Hi,

I am trying to re-use your library to transparently interpose a lock algorithm I am working on.

However, I have an issue with the interposition of pthread_create.
With glibc 2.32 this function is interposed and everything works as intented.
With glibc 2.36 the interposed function of pthread_create is never called. This breaks everything as the per-thread contexts are not initialized and then each thread uses the same context.
The other pthread functions (like pthread_mutex_init for example) are interposed properly.

According to other developers I have been talking to about this issue, glibc 2.34 changed the way pthread is handled (before it was an external shared library, now it is included in libc). This might be related.

Glibc 2.36 is shipped with newer Linux distributions (like Debian 12).
Reproduction steps on a system with glibc 2.36:

  • Enable DEBUG_PTHREAD prints in src/utils.h
  • Compile LiTL
  • Use LiTL on any code with a pthread_create.
    The pthread_create debug line will never be printed as it is not called.

Do you have any idea why this would happen?

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions