ExceptionTypes test: test “naked” signals

Since it’s possible to receive an EXC_CRASH for any signal that
generates a core by default even if the signal did not originate from a
Mach exception, update the tests to ensure that all such signals can be
unwrapped from an exception properly. This happens when a signal such as
SIGSEGV is sent with kill(), for example.

Change-Id: I1ee32cc6943f21ae349fa6788430d074acff9ed8
Reviewed-on: https://chromium-review.googlesource.com/434717
Reviewed-by: Robert Sesek <rsesek@chromium.org>
This commit is contained in:
Mark Mentovai 2017-01-30 10:34:51 -05:00
Родитель 3e5ae2dc87
Коммит 56020daea9
1 изменённых файлов: 12 добавлений и 0 удалений

Просмотреть файл

@ -57,7 +57,13 @@ TEST(ExceptionTypes, ExcCrashRecoverOriginalException) {
{0x0700080, EXC_SYSCALL, 128, 0},
{0x0706000, EXC_SYSCALL, 0x6000, 0},
{0x3000000, 0, 0, SIGQUIT},
{0x4000000, 0, 0, SIGILL},
{0x5000000, 0, 0, SIGTRAP},
{0x6000000, 0, 0, SIGABRT},
{0x7000000, 0, 0, SIGEMT},
{0x8000000, 0, 0, SIGFPE},
{0xa000000, 0, 0, SIGBUS},
{0xb000000, 0, 0, SIGSEGV},
{0xc000000, 0, 0, SIGSYS},
{0, 0, 0, 0},
};
@ -181,7 +187,13 @@ TEST(ExceptionTypes, ExceptionCodeForMetrics) {
#define ENCODE_EXC_CRASH_SIGNAL(signal) \
{ EXC_CRASH, (((signal) & 0xff) << 24), (EXC_CRASH << 16) | (signal) }
ENCODE_EXC_CRASH_SIGNAL(SIGQUIT),
ENCODE_EXC_CRASH_SIGNAL(SIGILL),
ENCODE_EXC_CRASH_SIGNAL(SIGTRAP),
ENCODE_EXC_CRASH_SIGNAL(SIGABRT),
ENCODE_EXC_CRASH_SIGNAL(SIGEMT),
ENCODE_EXC_CRASH_SIGNAL(SIGFPE),
ENCODE_EXC_CRASH_SIGNAL(SIGBUS),
ENCODE_EXC_CRASH_SIGNAL(SIGSEGV),
ENCODE_EXC_CRASH_SIGNAL(SIGSYS),
#undef ENCODE_EXC_CRASH_SIGNAL