0

Unfortunately a project I'm working on doesn't work on some platforms. It crashes with an error like

/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found
/lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found

I followed this hivemind advice to check which GLIBC versions the binary compatible with:

$ objdump -T libmylib_rs.so | grep -Eo 'GLIBC_\S+' | sort -u
GLIBC_2.10)
GLIBC_2.14)
GLIBC_2.17)
GLIBC_2.18)
GLIBC_2.2.5)
GLIBC_2.25)
GLIBC_2.28)
GLIBC_2.29)
GLIBC_2.3)
GLIBC_2.3.2)
GLIBC_2.3.4)
GLIBC_2.33)
GLIBC_2.34)
GLIBC_2.4)
GLIBC_2.7)
GLIBC_2.9)

Unfortunately, GLIBC 2.31 isn't in this list. That's pretty weird, because GLIBC 2.29 and 2.33 are supported. How that could be?

The lib uses clock_gettime which was removed in 2.26 according to that report, but it wasn't re-added back. It also uses pthread_attr_destroy and pthread_attr_init that were removed in 2.31. How it works on later versions? Any "hello world" app which uses Rust's tokio lib uses these symbols from libc.

Furthermore, I can build my code on a system with GLIBC 2.31 and run it there or on systems with newer GLIBC, but not vice versa.

I cannot fix that issue until I understand it.

0

1 Answer 1

0

This is a duplicate of this question.

The problem is that libmylib_rs.so was linked on a system with GLIBC-2.34 (or newer), but you are running it on a system with GLIBC-2.28 (or older).

The lib uses clock_gettime which was removed in 2.26

Nothing of the sort has happened (such a removal would break backward compatibility).

/lib/x86_64-linux-gnu/libc.so.6
GNU C Library (Debian GLIBC 2.40-6+gl0) stable release version 2.40.
...


readelf -Ws /lib/x86_64-linux-gnu/libc.so.6 | grep clock_gettime
   441: 00000000000dae40   127 FUNC    GLOBAL DEFAULT   16 clock_gettime@@GLIBC_2.17
   442: 00000000000dae40   127 FUNC    GLOBAL DEFAULT   16 clock_gettime@GLIBC_2.2.5
   507: 00000000000dae40   127 FUNC    GLOBAL DEFAULT   16 __clock_gettime@@GLIBC_PRIVATE
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.