pthread_mutex_lock problem after upgrade to glibc 2.26 (Linux x32)

Arkadiusz Miśkiewicz arekm@maven.pl
Sun Oct 15 10:19:00 GMT 2017


Hi,

This code:

#define _GNU_SOURCE 1

#include <stdio.h>
#include <pthread.h>

int main() {

        static pthread_mutex_t rpmsigTbl_lock = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
        printf("LOCK1\n");
        pthread_mutex_lock(&rpmsigTbl_lock);
        printf("LOCK2\n");
        pthread_mutex_lock(&rpmsigTbl_lock);
        printf("LOCK3\n");
}


built on glibc 2.25 on Linux x32 locks when running that binary on glibc 2.26:

$ ./a.out
LOCK1
LOCK2

It was built with "gcc -fopenmp test.c" and -fopenmp seems to be a important factor.
If not using -fopenmp then the problem is gone.

gcc 7.2

Issue doesn't happen on x86_64 or i686, only x32.

Rebuilding the code with glibc 2.26 headers make it work fine on glibc 2.26.

Building binary on 2.26 and using thar binary on 2.25 also locks up
the same way as described above.

Some incompatible change in glibc 2.26?
-- 
Arkadiusz Miśkiewicz, arekm / ( maven.pl | pld-linux.org )



More information about the Libc-alpha mailing list