Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed parsing of ld.so.cache on new glibc.
Since glibc 2.32, `ld.so.cache` now defaults to the "new" format, instead of the "compat" format which was in use since glibc 2.2 (around 20 years ago). It is now the default on e.g. Debian bullseye, and any recent Linux distribution. The code change adds support for the "new" format along with the existing support for the "compat". Before: ``` root@thinkpad:/home/cf/src/mesos/build# ldconfig -c new root@thinkpad:/home/cf/src/mesos/build# ./bin/mesos-tests.sh --gtest_filter=*Ld* [...] [==========] Running 4 tests from 2 test cases. [----------] Global test environment set-up. [----------] 1 test from LdcacheTest [ RUN ] LdcacheTest.Parse ../../src/tests/ldcache_tests.cpp:43: Failure cache: Invalid format [ FAILED ] LdcacheTest.Parse (0 ms) [----------] 1 test from LdcacheTest (0 ms total) [----------] 3 tests from Ldd [ RUN ] Ldd.BinSh ../../src/tests/ldd_tests.cpp:43: Failure cache: Invalid format [ FAILED ] Ldd.BinSh (0 ms) [ RUN ] Ldd.EmptyCache [ OK ] Ldd.EmptyCache (1 ms) [ RUN ] Ldd.MissingFile ../../src/tests/ldd_tests.cpp:77: Failure cache: Invalid format [ FAILED ] Ldd.MissingFile (0 ms) [----------] 3 tests from Ldd (1 ms total) [----------] Global test environment tear-down [==========] 4 tests from 2 test cases ran. (8 ms total) [ PASSED ] 1 test. [ FAILED ] 3 tests, listed below: [ FAILED ] LdcacheTest.Parse [ FAILED ] Ldd.BinSh [ FAILED ] Ldd.MissingFile 3 FAILED TESTS ``` After: ``` root@thinkpad:/home/cf/src/mesos/build# ldconfig -c new root@thinkpad:/home/cf/src/mesos/build# ./bin/mesos-tests.sh --gtest_filter=*Ld* [...] [==========] Running 4 tests from 2 test cases. [----------] Global test environment set-up. [----------] 1 test from LdcacheTest [ RUN ] LdcacheTest.Parse [ OK ] LdcacheTest.Parse (529 ms) [----------] 1 test from LdcacheTest (529 ms total) [----------] 3 tests from Ldd [ RUN ] Ldd.BinSh [ OK ] Ldd.BinSh (3 ms) [ RUN ] Ldd.EmptyCache [ OK ] Ldd.EmptyCache (0 ms) [ RUN ] Ldd.MissingFile [ OK ] Ldd.MissingFile (0 ms) [----------] 3 tests from Ldd (3 ms total) [----------] Global test environment tear-down [==========] 4 tests from 2 test cases ran. (541 ms total) [ PASSED ] 4 tests. ``` This closes #384
- Loading branch information