Closed PrajvalBadiger closed 9 months ago
Looks like failure in your CustomLinux OS installation. lvm2 needs pthreads - so if they are not available on your system possibly after faulty upgrade - lvm2 configure correctly failed - as it cannot be compiled without this library.
thanks for the response.
I see that pthreads library is already installed on the system and is present in the /lib64 directory.
ldconfig -v
also shows pthread library.
[distro /lib64] # ldconfig -v | grep pthread
libpthread.so.0 -> libpthread-2.30.so
libevent_pthreads-2.1.so.7 -> libevent_pthreads.so
[distro /lib64] # ls -l libpthread*
-rwxr-xr-x 1 root root 114248 Jan 1 08:04 libpthread-2.30.so
lrwxrwxrwx 1 root root 18 Jan 1 14:11 libpthread.so.0 -> libpthread-2.30.so
[distro /lib64] #
Pthread is bit more trickier with glibc as it comes embedded into libc itself. So see 'objdump -t /lib64/libc.so.6 | grep pthread_mutex_lock'
Do you compile glibc yourself ?
objdump -t /lib64/libc.so.6 | grep pthread_mutex_lock
- don't show anything maybe because the .so file is stripped
distro ~] # objdump -t /lib64/libc-2.30.so
/lib64/libc-2.30.so: file format elf64-x86-64
SYMBOL TABLE:
no symbols
[distro ~] # file /lib64/libc-2.30.so
/lib64/libc-2.30.so: ELF 64-bit LSB shared object, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, stripped
[distro ~] #
Yes, we compile glibc ourselves. This issue is observed when glibc is upgraded from v2.30 to v2.38 or v2.35. I tried compiling a simple c program which uses the pthread_mutex_lock and passed -lpthread while compiling, the program compiles and runs without any issue.
Well it's quite hard to guess&diagnose the issue on your locally build distro.
You could likely try yourself what is being compiled by configure script - which should be approximately this:
gcc -o test test.c -lpthread
This should be compilable - if your libraries are properly buiit and installed. If this does not work - you will likely need to consult expert on glibc and your distro.
The test code fails with Segmentation fault (core dumped).
[distro ~] # cat test.c
char pthread_mutex_lock();
int main(void) {
return pthread_mutex_lock();
;
return 0;
}
[distro ~] # gcc -o test test.c -lpthread
[distro ~] # ./test
Segmentation fault (core dumped)
[distro ~] # gcc -g -o test test.c -lpthread
[distro ~] # gdb test
GNU gdb (GDB) 13.2
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from test...
(gdb) r
Starting program: /root/test
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Program received signal SIGSEGV, Segmentation fault.
__GI___pthread_mutex_lock (mutex=0x1) at ../nptl/pthread_mutex_lock.c:67
67 ../nptl/pthread_mutex_lock.c: No such file or directory.
(gdb)
It's not supposed to be executed - only compiled - but your 'configure' suggested it's failing.
Can you attach config.log ?
(make distclean ; rm -f config.log
configure
and attach created config.log
We are seeing the following issue while compiling LVM2 after glibc upgrade from 2.30 to 2.38
LVM2 version: 2.02.177
Build commands:
Environment
Custom Linux OS kernel: 4.19.302 gcc: 8.4.0
Full Log: