This is an archive of the discontinued LLVM Phabricator instance.

[Sanitizer] Only unwind when it is safe to do so
AbandonedPublic

Authored by yln on Mar 4 2019, 5:17 PM.

Details

Summary

ScopedUnwinding and AsanThread::isUnwinding were introduced to

"Fix deadlock in stack unwinder on android/x86" on platforms where
libc unwinder calls malloc internally.

https://github.com/llvm/llvm-project/commit/58dbe0623051f1bb49256693e54b4e29f7db5faf

The current state of the code only protects the fast unwinder, which is
not affected by this. Only SlowUnwind calls out to _Unwind_Backtrace.
So we are in a situation where the code that should be protected isn't,
and code that doesn't need to be protected is.

Since this hasn't been causing issues, we don't even know if it strictly
required anymore. But let's be conservative and make sure at least also
SlowUnwind is protected.

Event Timeline

yln created this revision.Mar 4 2019, 5:17 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptMar 4 2019, 5:17 PM
Herald added subscribers: llvm-commits, Restricted Project, kubamracek. · View Herald Transcript
vitalybuka added inline comments.Mar 4 2019, 8:19 PM
compiler-rt/lib/asan/asan_stack.cc
37

We can't assume that there is no issues here so quickly after commit.
I will take time to get Android.

I believe I've made mistake proposing the current code D58861

yln abandoned this revision.Mar 5 2019, 10:45 AM

Just looked at your changes. I think this is obsolete now.