This is an archive of the discontinued LLVM Phabricator instance.

[asan] Don't reset non-default user handler if allow_user_signal_handler is true.
ClosedPublic

Authored by vitalybuka on Apr 24 2017, 4:18 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

vitalybuka created this revision.Apr 24 2017, 4:18 PM
eugenis added inline comments.May 25 2017, 11:12 AM
test/asan/TestCases/Linux/preinstalled_signal.cc
48 ↗(On Diff #96481)

I don't like this at all. This is a mode that is not supposed to work.

Could you set a signal handler in preinit_array?
On Linux (and new-ish Android) preinit_array ctors get argc/argv/envp just as main().

vitalybuka added inline comments.May 25 2017, 11:15 AM
test/asan/TestCases/Linux/preinstalled_signal.cc
48 ↗(On Diff #96481)

No, asan also uses preinit_array and will be executed before this.

Load asan with LD_PRELOAD

vitalybuka marked an inline comment as done.May 26 2017, 1:30 PM

8 -> NSIG/8

eugenis added inline comments.May 26 2017, 1:53 PM
test/asan/TestCases/Linux/preinstalled_signal.cc
36 ↗(On Diff #100464)

AFAIK sigset_t and kernel_sigset_t may be different in size.
Look in sanitizer_platform_limits_posix.h

41 ↗(On Diff #100464)

Maybe limit the test to x86/x86_64? There are just too many things that can go wrong on different platforms.

47 ↗(On Diff #100464)

is that SA_RESTORER?

vitalybuka marked an inline comment as done.

Remove sigset_t

test/asan/TestCases/Linux/preinstalled_signal.cc
36 ↗(On Diff #100464)

I don't use it.

41 ↗(On Diff #100464)

I'd limit if we see failures.
On a quick look into kernel code, arm should handle calls without restorer, mips and powerpc does not check this field at all.

47 ↗(On Diff #100464)

Yes, but I don't see headers defining it

Simplify return from main.

eugenis accepted this revision.May 26 2017, 2:14 PM

LGTM

This revision is now accepted and ready to land.May 26 2017, 2:14 PM
This revision was automatically updated to reflect the committed changes.