Skip to content

Commit

Permalink
tests: make UBSan print full backtraces
Browse files Browse the repository at this point in the history
This should make it easier to get backtraces that can be
pasted into issues like systemd#10096.
  • Loading branch information
evverx committed Sep 15, 2018
1 parent 32397af commit ea979d2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/test-functions
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,8 @@ create_asan_wrapper() {
set -x
DEFAULT_ASAN_OPTIONS=strict_string_checks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1
DEFAULT_ENVIRONMENT=ASAN_OPTIONS=\$DEFAULT_ASAN_OPTIONS
DEFAULT_UBSAN_OPTIONS=print_stacktrace=1:print_summary=1
DEFAULT_ENVIRONMENT="ASAN_OPTIONS=\$DEFAULT_ASAN_OPTIONS UBSAN_OPTIONS=\$DEFAULT_UBSAN_OPTIONS"
mount -t proc proc /proc
mount -t sysfs sysfs /sys
Expand All @@ -353,7 +354,7 @@ JOURNALD_CONF_DIR=/etc/systemd/system/systemd-journald.service.d
mkdir -p "\$JOURNALD_CONF_DIR"
printf "[Service]\nEnvironment=ASAN_OPTIONS=\$DEFAULT_ASAN_OPTIONS:log_path=/systemd-journald.asan.log\n" >"\$JOURNALD_CONF_DIR/env.conf"
export ASAN_OPTIONS=\$DEFAULT_ASAN_OPTIONS:log_path=/systemd.asan.log
export ASAN_OPTIONS=\$DEFAULT_ASAN_OPTIONS:log_path=/systemd.asan.log UBSAN_OPTIONS=\$DEFAULT_UBSAN_OPTIONS
exec $ROOTLIBDIR/systemd "\$@"
EOF

Expand Down

0 comments on commit ea979d2

Please sign in to comment.