Skip to content

Commit 7bb2215

Browse files
authored
Don't disable ASLR when re-running tests under LLDB, to work in CI (#5366)
When tests fail in CI the runner tries to re-run the failing test under LLDB to get a backtrace. LLDB tries to disable ASLR on startup using personality(2) and this in turn doesn't work on most CI runners because it's a privileged operation and the container they're running in doesn't allow it, so rather than any useful backtrace diagnostics we get a failure like: ``` error: Cannot launch '/home/runner/work/stellar-core/stellar-core/build-gcc-current/src/stellar-core': personality set failed: Operation not permitted ``` This PR modifies how we run LLDB to tell it _not_ to try to disable ASLR, which means it won't fail, which means it _should_ be more likely to start and produce a backtrace.
2 parents 316757d + 0a5ad6c commit 7bb2215

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/test/run-selftest-nopg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ R=$?
2222
if [[ $R -ne 0 ]] ; then
2323
echo "Test failed, rerunning with debugger"
2424
echo ./stellar-core test $STELLAR_CORE_TEST_PARAMS --base-instance $BASE_INSTANCE "$TESTS"
25-
lldb -o 'r' -o 'bt' -o 'exit' -- ./stellar-core test $STELLAR_CORE_TEST_PARAMS --base-instance $BASE_INSTANCE "$TESTS"
25+
lldb -O 'settings set target.disable-aslr false' -o 'r' -o 'bt' -o 'exit' -- ./stellar-core test $STELLAR_CORE_TEST_PARAMS --base-instance $BASE_INSTANCE "$TESTS"
2626
fi
2727
exit $R

src/test/run-selftest-pg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,6 @@ R=$?
115115
if [[ $R -ne 0 ]] ; then
116116
echo "Test failed, rerunning with debugger"
117117
echo ./stellar-core test $STELLAR_CORE_TEST_PARAMS --base-instance $BASE_INSTANCE "$TESTS"
118-
lldb -o 'r' -o 'bt' -o 'exit' -- ./stellar-core test $STELLAR_CORE_TEST_PARAMS --base-instance $BASE_INSTANCE "$TESTS"
118+
lldb -O 'settings set target.disable-aslr false' -o 'r' -o 'bt' -o 'exit' -- ./stellar-core test $STELLAR_CORE_TEST_PARAMS --base-instance $BASE_INSTANCE "$TESTS"
119119
fi
120120
exit $R

0 commit comments

Comments
 (0)