This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
pthread_mutex_lock problem after upgrade to glibc 2.26 (Linux x32)
- From: Arkadiusz Miśkiewicz <arekm at maven dot pl>
- To: libc-alpha at sourceware dot org
- Date: Sun, 15 Oct 2017 12:19:07 +0200
- Subject: pthread_mutex_lock problem after upgrade to glibc 2.26 (Linux x32)
- Authentication-results: sourceware.org; auth=none
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 )