-
Notifications
You must be signed in to change notification settings - Fork 268
shim fails to initialize with tor's --enable-fragile-hardening (asan) #2790
Description
In Tor we're trying to run simulations with a tor binary built with AddressSanitizer; specifically using the --enable-fragile-hardening flag to tor's configure script.
Initially, the asan instrumentation in the tor binary inspects LD_PRELOAD and refuses to run because our LD_PRELOAD'd libraries might interfere with its instrumentation. In particular we get an error in the tor's shimlog -- since the shim's initialization hasn't run yet the write isn't interposed, and STDOUT_FILENO is the shimlog file.
We're able to cirumvent that check by setting ASAN_OPTIONS=verify_asan_link_order=0 in the tor process's environment. google/sanitizers#796 (comment)
After doing that, the tor process runs, but all output goes to the shimlog; it appears that the shim is never getting initialized.
I'm able to reproduce this issue with tor-0.4.7.9 and shadow's tor-minimal test.
More debugging info follows...