lib/init: do not leak internal SIGDEBUG causes

This commit is contained in:
Philippe Gerum 2020-01-30 18:25:17 +01:00
parent f0ca4abc34
commit c5eb1e1d31
1 changed files with 8 additions and 12 deletions

View File

@ -22,8 +22,6 @@
#include <uapi/evl/signal.h> #include <uapi/evl/signal.h>
#include "internal.h" #include "internal.h"
#define STDLOG_SIZE 32768
static pthread_once_t init_once = PTHREAD_ONCE_INIT; static pthread_once_t init_once = PTHREAD_ONCE_INIT;
static int init_status; static int init_status;
@ -137,15 +135,14 @@ int evl_sigevl_handler(int sig, siginfo_t *si, void *ctxt)
} while (0) } while (0)
static const char *sigdebug_msg[] = { static const char *sigdebug_msg[] = {
"undefined\n", /* Should never happen. */ [SIGDEBUG_MIGRATE_SIGNAL] = "switched inband (signal)\n",
"switched inband (signal)\n", [SIGDEBUG_MIGRATE_SYSCALL] = "switched inband (syscall)\n",
"switched inband (syscall)\n", [SIGDEBUG_MIGRATE_FAULT] = "switched inband (fault)\n",
"switched inband (fault)\n", [SIGDEBUG_MIGRATE_PRIOINV] = "switched inband while holding mutex\n",
"switched inband while holding mutex\n", [SIGDEBUG_WATCHDOG] = "watchdog triggered\n",
"watchdog triggered\n", [SIGDEBUG_MUTEX_IMBALANCE] = "mutex lock/unlock imbalance\n",
"mutex lock/unlock imbalance\n", [SIGDEBUG_MUTEX_SLEEP] = "attempt to sleep while holding a mutex\n",
"goes to sleep while holding a mutex\n", [SIGDEBUG_STAGE_LOCKED] = "locked out from out-of-band stage (stax)\n",
"locked out from out-of-band stage (stax)\n",
}; };
/* A basic SIGDEBUG handler which only prints out the cause. */ /* A basic SIGDEBUG handler which only prints out the cause. */
@ -154,7 +151,6 @@ void evl_sigdebug_handler(int sig, siginfo_t *si, void *ctxt)
{ {
if (sigdebug_marked(si)) { if (sigdebug_marked(si)) {
switch (sigdebug_cause(si)) { switch (sigdebug_cause(si)) {
case SIGDEBUG_NONE:
case SIGDEBUG_MIGRATE_SIGNAL: case SIGDEBUG_MIGRATE_SIGNAL:
case SIGDEBUG_MIGRATE_SYSCALL: case SIGDEBUG_MIGRATE_SYSCALL:
case SIGDEBUG_MIGRATE_FAULT: case SIGDEBUG_MIGRATE_FAULT: