File tree 1 file changed +14
-7
lines changed 1 file changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -22,13 +22,20 @@ set +x
22
22
echo ' ==================================> INSTALL'
23
23
24
24
if [[ $( uname) == " Linux" ]]; then
25
- # Temporarily allow failures changing those values as the job might not need them
26
- set +e
27
- # Avoid ASAN "DEADLYSIGNAL" errors
28
- echo 0 | sudo tee /proc/sys/kernel/randomize_va_space
29
- # Avoid TSAN "FATAL: ThreadSanitizer: unexpected memory mapping" errors
30
- sudo sysctl vm.mmap_rnd_bits=28
31
- set -e
25
+ error=0
26
+ if ! { echo 0 | sudo tee /proc/sys/kernel/randomize_va_space > /dev/null; } && [[ -n ${B2_ASAN:- } ]]; then
27
+ echo -e " \n\nWARNING: Failed to disable KASLR. ASAN might fail with 'DEADLYSIGNAL'."
28
+ error=1
29
+ fi
30
+ # sysctl just ignores some failures and does't return an error, only output
31
+ if { ! out=$( sudo sysctl vm.mmap_rnd_bits=28 2>&1 ) || [[ " $out " == * " ignoring:" * ]]; } && [[ -n ${B2_TSAN:- } ]]; then
32
+ echo -e " \n\nWARNING: Failed to change KASLR. TSAN might fail with 'FATAL: ThreadSanitizer: unexpected memory mapping'."
33
+ error=1
34
+ fi
35
+ if (( error == 1 )) ; then
36
+ [[ " ${DRONE_EXTRA_PRIVILEGED:- 0} " == " True" ]] || echo ' Try passing `privileged=True` to the job in .drone.star'
37
+ echo -e " \n"
38
+ fi
32
39
fi
33
40
34
41
scripts=(
You can’t perform that action at this time.
0 commit comments