Skip to content

Commit

Permalink
Merge #1496
Browse files Browse the repository at this point in the history
1496: Tests: Make LTTNG fork()-safe r=AlanGriffiths a=RAOF

[LTTNG documentation](https://lttng.org/man/3/lttng-ust/v2.12/#doc-_using_lttng_ust_with_daemons) makes it clear that using `fork()` without `exec()` in applications linked to `liblttng-ust` is unsafe unless you preload `liblttng-ust-fork.so`. Do so! (Fixes #1405)

This fixes a test failure where running `ThreadedDispatcherSignalTest` immediately after the `Logind` tests would fail.

Co-authored-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
  • Loading branch information
bors[bot] and RAOF committed Jun 1, 2020
2 parents 72e7334 + 266aa80 commit 69786be
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmake/MirCommon.cmake
Expand Up @@ -98,6 +98,10 @@ function (mir_discover_tests_internal EXECUTABLE TEST_ENV_OPTIONS DETECT_FD_LEAK
set(test_exclusion_filter "${test_exclusion_filter}:AnonymousShmFile.*:MesaBufferAllocatorTest.software_buffers_dont_bypass:MesaBufferAllocatorTest.creates_software_rendering_buffer")
endif()

# liblttng-ust is unsafe if you fork() without exec(), such as we do in the test suite
# We need to load liblttng-ust-fork.so to make this work reliably.
list(APPEND test_env "LD_PRELOAD=liblttng-ust-fork.so")

# Final commands
set(test_cmd "${test_cmd}" "--gtest_filter=-${test_no_memcheck_filter}:${test_exclusion_filter}")
set(test_cmd_no_memcheck "${test_cmd_no_memcheck}" "--gtest_death_test_style=threadsafe" "--gtest_filter=${test_no_memcheck_filter}:-${test_exclusion_filter}")
Expand Down

0 comments on commit 69786be

Please sign in to comment.