Print signal to stdout before calling crash handler

Doesn't fix anything but if deadlock described on the bug happens
locally and stdout is piped to console (or line-buffered file),
it's at least visible that a signal handler was invoked.

Bug: angleproject:8080
Change-Id: I27e1b22cc269082682fd639ef087f1b8b14b26eb
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4544588
Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
Auto-Submit: Roman Lavrov <romanl@google.com>
Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
This commit is contained in:
Roman Lavrov 2023-05-18 19:20:56 -04:00 коммит произвёл Angle LUCI CQ
Родитель f52d28875a
Коммит 5c28a74920
1 изменённых файлов: 4 добавлений и 2 удалений

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

@ -126,12 +126,13 @@ void PrintStackBacktrace()
static void Handler(int sig)
{
printf("\nSignal %d:\n", sig);
if (gCrashHandlerCallback)
{
(*gCrashHandlerCallback)();
}
printf("\nSignal %d:\n", sig);
PrintStackBacktrace();
// Exit NOW. Don't notify other threads, don't call anything registered with atexit().
@ -645,12 +646,13 @@ void PrintStackBacktrace()
static void Handler(int sig)
{
printf("\nSignal %d [%s]:\n", sig, strsignal(sig));
if (gCrashHandlerCallback)
{
(*gCrashHandlerCallback)();
}
printf("\nSignal %d [%s]:\n", sig, strsignal(sig));
PrintStackBacktrace();
// Exit NOW. Don't notify other threads, don't call anything registered with atexit().