Project

General

Profile

Actions

Bug #1337

closed

2.13.0,master: test crash if built with -Wl,-Bsymbolic-functions

Added by Andreas Hasenack almost 3 years ago. Updated almost 3 years ago.

Status:
Resolved
Priority:
Normal
Target version:
-
Start date:
12/02/2021
Due date:
% Done:

0%

Estimated time:

Description

Hello,

since 2.13.0 (also in current master) I'm getting test failures when building ust in Ubuntu, which fail the package build. After some troubleshooting, looks like it's the -Wl,-Bsymbolic-functions flag we pass to the linker. That is something Ubuntu has been doing for years, and it doesn't affect 2.12.2 (probably because the test didn't exist there?).

My build command-line:
LDFLAGS="-Wl,-Bsymbolic-functions" ./bootstrap 2>&1 | tee ../build.log && LDFLAGS="-Wl,-Bsymbolic-functions" ./configure --disable-man-pages 2>&1 | tee -a ../build.log; make -j4 2>&1 | tee -a ../build.log; make check 2>&1 | tee -a ../build.log

If I don't set LDFLAGS like that, the tests pass.

I did a bisect between 2.12.2 and 2.13.0, and the commit that started failing is the one that added the tests:
6825ea4493cbd97e428def01d1cf3b94477e4912 is the first bad commit
commit 6825ea4493cbd97e428def01d1cf3b94477e4912
Author: Michael Jeanson <>
Date: Tue Apr 27 12:14:15 2021 -0400

Add abi0 conflict tests
Add tests to make sure abi0 detection works properly in different
linking and dlopen scenarios.

I can't tell if the test is wrong, or if it's showing a real problem that has been lurking for quite some time.

Here is the output from master:
...
  1. regression/abi0-conflict/test_abi0_conflict: dlopen
    PASS: regression/abi0-conflict/test_abi0_conflict 9 - dlopen: no-ust app works
    PASS: regression/abi0-conflict/test_abi0_conflict 10 - dlopen: no-ust app with abi1 and abi1 succeeds
    PASS: regression/abi0-conflict/test_abi0_conflict 11 - dlopen: no-ust app with abi0 and abi1 fails
    FAIL: regression/abi0-conflict/test_abi0_conflict 12 - dlopen: no-ust app with abi1 and abi0 fails
  2. regression/abi0-conflict/test_abi0_conflict: Failed test 'dlopen: no-ust app with abi1 and abi0 fails'
  3. regression/abi0-conflict/test_abi0_conflict: in /home/ubuntu/git/packages/ust/lttng-ust/tests/utils/tap.sh:isnt() at line 300.
  4. regression/abi0-conflict/test_abi0_conflict: got: '0'
  5. regression/abi0-conflict/test_abi0_conflict: expected: '0'
    PASS: regression/abi0-conflict/test_abi0_conflict 13 - dlopen: ust app works
    FAIL: regression/abi0-conflict/test_abi0_conflict 14 - dlopen: ust app with abi0 fails
  6. regression/abi0-conflict/test_abi0_conflict: Failed test 'dlopen: ust app with abi0 fails'
  7. regression/abi0-conflict/test_abi0_conflict: in /home/ubuntu/git/packages/ust/lttng-ust/tests/utils/tap.sh:isnt() at line 300.
  8. regression/abi0-conflict/test_abi0_conflict: got: '0'
  9. regression/abi0-conflict/test_abi0_conflict: expected: '0'
    FAIL: regression/abi0-conflict/test_abi0_conflict 15 - dlopen: ust app with abi0 and abi1 fails
  10. regression/abi0-conflict/test_abi0_conflict: Failed test 'dlopen: ust app with abi0 and abi1 fails'
  11. regression/abi0-conflict/test_abi0_conflict: in /home/ubuntu/git/packages/ust/lttng-ust/tests/utils/tap.sh:isnt() at line 300.
  12. regression/abi0-conflict/test_abi0_conflict: got: '0'
  13. regression/abi0-conflict/test_abi0_conflict: expected: '0'
    FAIL: regression/abi0-conflict/test_abi0_conflict 16 - dlopen: ust app with abi1 and abi0 fails
  14. regression/abi0-conflict/test_abi0_conflict: Failed test 'dlopen: ust app with abi1 and abi0 fails'
  15. regression/abi0-conflict/test_abi0_conflict: in /home/ubuntu/git/packages/ust/lttng-ust/tests/utils/tap.sh:isnt() at line 300.
  16. regression/abi0-conflict/test_abi0_conflict: got: '0'
  17. regression/abi0-conflict/test_abi0_conflict: expected: '0'
  18. regression/abi0-conflict/test_abi0_conflict: Indirect linking
    PASS: regression/abi0-conflict/test_abi0_conflict 17 - indirect: no-ust app with abi0 succeeds
    PASS: regression/abi0-conflict/test_abi0_conflict 18 - indirect: no-ust app with abi1 succeeds
    PASS: regression/abi0-conflict/test_abi0_conflict 19 - indirect: no-ust app with abi0 and abi1 fails
    PASS: regression/abi0-conflict/test_abi0_conflict 20 - indirect: ust app with abi0 fails
    PASS: regression/abi0-conflict/test_abi0_conflict 21 - indirect: ust app with abi1 succeeds
    PASS: regression/abi0-conflict/test_abi0_conflict 22 - indirect: ust app with abi0 and abi1 fails
  19. regression/abi0-conflict/test_abi0_conflict: Looks like you failed 4 tests of 22.
    ERROR: regression/abi0-conflict/test_abi0_conflict - exited with status 4 ============================================================================
    Testsuite summary for lttng-ust 2.14.0-pre ============================================================================
  20. TOTAL: 246
  21. PASS: 241
  22. SKIP: 0
  23. XFAIL: 0
  24. FAIL: 4
  25. XPASS: 0
  26. ERROR: 1 ============================================================================
    See tests/test-suite.log
    Please report to mathieu dot desnoyers at efficios dot com

And test-suite.log shows core dumps:
$ cat tests/test-suite.log ================================================
lttng-ust 2.14.0-pre: tests/test-suite.log ================================================

  1. TOTAL: 246
  2. PASS: 241
  3. SKIP: 0
  4. XFAIL: 0
  5. FAIL: 4
  6. XPASS: 0
  7. ERROR: 1

.. contents:: :depth: 2

ERROR: regression/abi0-conflict/test_abi0_conflict ==================================================

1..22
  1. LD_PRELOAD
  2. regression/abi0-conflict/test_abi0_conflict: LD_PRELOAD
    ok 1 - LD_PRELOAD: no-ust app works
    PASS: regression/abi0-conflict/test_abi0_conflict 1 - LD_PRELOAD: no-ust app works
    ok 2 - LD_PRELOAD: no-ust app with abi0 preload succeeds
    PASS: regression/abi0-conflict/test_abi0_conflict 2 - LD_PRELOAD: no-ust app with abi0 preload succeeds
    ./regression/abi0-conflict/test_abi0_conflict: line 56: 592651 Aborted (core dumped) LD_PRELOAD="${LIBFAKEUST0}:${LIBUST1}" "${CURDIR}/app_noust" > "$STD_OUTPUT" 2> "$STD_ERROR"
    ok 3 - LD_PRELOAD: no-ust app with abi0 and abi1 preload fails
    PASS: regression/abi0-conflict/test_abi0_conflict 3 - LD_PRELOAD: no-ust app with abi0 and abi1 preload fails
    ./regression/abi0-conflict/test_abi0_conflict: line 59: 592652 Aborted (core dumped) LD_PRELOAD="${LIBUST1}:${LIBFAKEUST0}" "${CURDIR}/app_noust" > "$STD_OUTPUT" 2> "$STD_ERROR"
    ok 4 - LD_PRELOAD: no-ust app with abi1 and abi0 preload fails
    PASS: regression/abi0-conflict/test_abi0_conflict 4 - LD_PRELOAD: no-ust app with abi1 and abi0 preload fails
    ok 5 - LD_PRELOAD: ust app works
    PASS: regression/abi0-conflict/test_abi0_conflict 5 - LD_PRELOAD: ust app works
    ./regression/abi0-conflict/test_abi0_conflict: line 68: 592669 Aborted (core dumped) LD_PRELOAD="${LIBFAKEUST0}" "${CURDIR}/app_ust" > "$STD_OUTPUT" 2> "$STD_ERROR"
    ok 6 - LD_PRELOAD: ust app with abi0 preload fails
    PASS: regression/abi0-conflict/test_abi0_conflict 6 - LD_PRELOAD: ust app with abi0 preload fails
    ./regression/abi0-conflict/test_abi0_conflict: line 71: 592683 Aborted (core dumped) LD_PRELOAD="${LIBFAKEUST0}:${LIBUST1}" "${CURDIR}/app_ust" > "$STD_OUTPUT" 2> "$STD_ERROR"
    ok 7 - LD_PRELOAD: ust app with abi0 and abi1 preload fails
    PASS: regression/abi0-conflict/test_abi0_conflict 7 - LD_PRELOAD: ust app with abi0 and abi1 preload fails
    ./regression/abi0-conflict/test_abi0_conflict: line 74: 592684 Aborted (core dumped) LD_PRELOAD="${LIBUST1}:${LIBFAKEUST0}" "${CURDIR}/app_ust" > "$STD_OUTPUT" 2> "$STD_ERROR"
    ok 8 - LD_PRELOAD: ust app with abi1 and abi0 preload fails
    PASS: regression/abi0-conflict/test_abi0_conflict 8 - LD_PRELOAD: ust app with abi1 and abi0 preload fails
  3. dlopen
  4. regression/abi0-conflict/test_abi0_conflict: dlopen
    ok 9 - dlopen: no-ust app works
    PASS: regression/abi0-conflict/test_abi0_conflict 9 - dlopen: no-ust app works
    ok 10 - dlopen: no-ust app with abi1 and abi1 succeeds
    PASS: regression/abi0-conflict/test_abi0_conflict 10 - dlopen: no-ust app with abi1 and abi1 succeeds
    ./regression/abi0-conflict/test_abi0_conflict: line 92: 592689 Aborted (core dumped) LD_LIBRARY_PATH="$LIBFAKEUST0_PATH:$LIBUST1_PATH" "${CURDIR}/app_noust_dlopen" abi0_abi1 > "$STD_OUTPUT" 2> "$STD_ERROR"
    ok 11 - dlopen: no-ust app with abi0 and abi1 fails
    PASS: regression/abi0-conflict/test_abi0_conflict 11 - dlopen: no-ust app with abi0 and abi1 fails
    not ok 12 - dlopen: no-ust app with abi1 and abi0 fails
    FAIL: regression/abi0-conflict/test_abi0_conflict 12 - dlopen: no-ust app with abi1 and abi0 fails
  5. Failed test 'dlopen: no-ust app with abi1 and abi0 fails'
  6. regression/abi0-conflict/test_abi0_conflict: Failed test 'dlopen: no-ust app with abi1 and abi0 fails'
  7. in /home/ubuntu/git/packages/ust/lttng-ust/tests/utils/tap.sh:isnt() at line 300.
  8. regression/abi0-conflict/test_abi0_conflict: in /home/ubuntu/git/packages/ust/lttng-ust/tests/utils/tap.sh:isnt() at line 300.
  9. got: '0'
  10. regression/abi0-conflict/test_abi0_conflict: got: '0'
  11. expected: '0'
  12. regression/abi0-conflict/test_abi0_conflict: expected: '0'
    ok 13 - dlopen: ust app works
    PASS: regression/abi0-conflict/test_abi0_conflict 13 - dlopen: ust app works
    not ok 14 - dlopen: ust app with abi0 fails
    FAIL: regression/abi0-conflict/test_abi0_conflict 14 - dlopen: ust app with abi0 fails
  13. Failed test 'dlopen: ust app with abi0 fails'
  14. regression/abi0-conflict/test_abi0_conflict: Failed test 'dlopen: ust app with abi0 fails'
  15. in /home/ubuntu/git/packages/ust/lttng-ust/tests/utils/tap.sh:isnt() at line 300.
  16. regression/abi0-conflict/test_abi0_conflict: in /home/ubuntu/git/packages/ust/lttng-ust/tests/utils/tap.sh:isnt() at line 300.
  17. got: '0'
  18. regression/abi0-conflict/test_abi0_conflict: got: '0'
  19. expected: '0'
  20. regression/abi0-conflict/test_abi0_conflict: expected: '0'
    not ok 15 - dlopen: ust app with abi0 and abi1 fails
    FAIL: regression/abi0-conflict/test_abi0_conflict 15 - dlopen: ust app with abi0 and abi1 fails
  21. Failed test 'dlopen: ust app with abi0 and abi1 fails'
  22. regression/abi0-conflict/test_abi0_conflict: Failed test 'dlopen: ust app with abi0 and abi1 fails'
  23. in /home/ubuntu/git/packages/ust/lttng-ust/tests/utils/tap.sh:isnt() at line 300.
  24. regression/abi0-conflict/test_abi0_conflict: in /home/ubuntu/git/packages/ust/lttng-ust/tests/utils/tap.sh:isnt() at line 300.
  25. got: '0'
  26. regression/abi0-conflict/test_abi0_conflict: got: '0'
  27. expected: '0'
  28. regression/abi0-conflict/test_abi0_conflict: expected: '0'
    not ok 16 - dlopen: ust app with abi1 and abi0 fails
    FAIL: regression/abi0-conflict/test_abi0_conflict 16 - dlopen: ust app with abi1 and abi0 fails
  29. Failed test 'dlopen: ust app with abi1 and abi0 fails'
  30. regression/abi0-conflict/test_abi0_conflict: Failed test 'dlopen: ust app with abi1 and abi0 fails'
  31. in /home/ubuntu/git/packages/ust/lttng-ust/tests/utils/tap.sh:isnt() at line 300.
  32. regression/abi0-conflict/test_abi0_conflict: in /home/ubuntu/git/packages/ust/lttng-ust/tests/utils/tap.sh:isnt() at line 300.
  33. got: '0'
  34. regression/abi0-conflict/test_abi0_conflict: got: '0'
  35. expected: '0'
  36. regression/abi0-conflict/test_abi0_conflict: expected: '0'
  37. Indirect linking
  38. regression/abi0-conflict/test_abi0_conflict: Indirect linking
    ok 17 - indirect: no-ust app with abi0 succeeds
    PASS: regression/abi0-conflict/test_abi0_conflict 17 - indirect: no-ust app with abi0 succeeds
    ok 18 - indirect: no-ust app with abi1 succeeds
    PASS: regression/abi0-conflict/test_abi0_conflict 18 - indirect: no-ust app with abi1 succeeds
    ./regression/abi0-conflict/test_abi0_conflict: line 131: 592803 Aborted (core dumped) "${CURDIR}/app_noust_indirect_abi0_abi1" > "$STD_OUTPUT" 2> "$STD_ERROR"
    ok 19 - indirect: no-ust app with abi0 and abi1 fails
    PASS: regression/abi0-conflict/test_abi0_conflict 19 - indirect: no-ust app with abi0 and abi1 fails
    ./regression/abi0-conflict/test_abi0_conflict: line 136: 592817 Aborted (core dumped) "${CURDIR}/app_ust_indirect_abi0" > "$STD_OUTPUT" 2> "$STD_ERROR"
    ok 20 - indirect: ust app with abi0 fails
    PASS: regression/abi0-conflict/test_abi0_conflict 20 - indirect: ust app with abi0 fails
    ok 21 - indirect: ust app with abi1 succeeds
    PASS: regression/abi0-conflict/test_abi0_conflict 21 - indirect: ust app with abi1 succeeds
    ./regression/abi0-conflict/test_abi0_conflict: line 142: 592847 Aborted (core dumped) "${CURDIR}/app_ust_indirect_abi0_abi1" > "$STD_OUTPUT" 2> "$STD_ERROR"
    ok 22 - indirect: ust app with abi0 and abi1 fails
    PASS: regression/abi0-conflict/test_abi0_conflict 22 - indirect: ust app with abi0 and abi1 fails
  39. Looks like you failed 4 tests of 22.
  40. regression/abi0-conflict/test_abi0_conflict: Looks like you failed 4 tests of 22.
    ERROR: regression/abi0-conflict/test_abi0_conflict - exited with status 4

Files

test-suite.log (7.59 KB) test-suite.log Andreas Hasenack, 12/02/2021 01:33 PM
Actions #1

Updated by Andreas Hasenack almost 3 years ago

Attaching the output instead

Actions #2

Updated by Michael Jeanson almost 3 years ago

  • Assignee set to Michael Jeanson

This test was introduced in 2.13 because we bumped the SONAME of liblttng-ust.so from 0 to 1 and we don't support having both libraries loaded in a process.

The mechanism to detect this unsupported scenario and the associated test rely on the default behavior of the linker which is changed by the '-Bsymbolic-functions' linker flag.

The only thing we can do when '-Bsymbolic-functions' is used is to disable the affected tests.

Can you try the following patch : https://review.lttng.org/c/lttng-ust/+/6857

You will have to run the tests with : make check UST_TESTS_LD_SYMBOLIC_FUNC=1

If this is a satisfactory fix for you, I'll cleanup the patch and have it merged upstream.

Actions #3

Updated by Andreas Hasenack almost 3 years ago

Michael Jeanson wrote in #note-2:

This test was introduced in 2.13 because we bumped the SONAME of liblttng-ust.so from 0 to 1 and we don't support having both libraries loaded in a process.

The mechanism to detect this unsupported scenario and the associated test rely on the default behavior of the linker which is changed by the '-Bsymbolic-functions' linker flag.

The only thing we can do when '-Bsymbolic-functions' is used is to disable the affected tests.

Can you try the following patch : https://review.lttng.org/c/lttng-ust/+/6857

You will have to run the tests with : make check UST_TESTS_LD_SYMBOLIC_FUNC=1

If this is a satisfactory fix for you, I'll cleanup the patch and have it merged upstream.

That works well, and it's better than removing `-Bsymbolic-functions` for this package, thanks!

Actions #4

Updated by Mathieu Desnoyers almost 3 years ago

  • Status changed from New to Resolved

Fixed by upstream commit:

commit 14f8b52c90ad4a66e2908f454da6bb431f9f35f9
Author: Michael Jeanson <mjeanson@efficios.com>
Date:   Thu Dec 2 16:11:21 2021 -0500

    fix: Allow disabling some abi compat tests

    Allow disabling ABI compat tests that rely on a library using a symbol from
    the global offset table even if it provides its own copy, which is the
    default behavior on Linux.

    This situation happens when using the '-Bsymbolic-functions' linker flag
    which binds references to public symbols in a library to the definition
    within the library, bypassing the global offset table.

    To disable those tests when running the test suite, set the
    UST_TESTS_LD_SYMBOLIC_FUNC environment variable to any value, for
    example :

      make check UST_TESTS_LD_SYMBOLIC_FUNC=1

    Change-Id: I1ed23d90bbe1b174ab7b4fccfb40b701b291c074
    Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
    Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Actions

Also available in: Atom PDF