NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pthread_sigmask unexpected error return



I'm getting some odd aborts of node when starting processes with spawn.

Debugging the resultant core the abort is coming from the following section of code in libuv (1.47) Line 817:

/* Start the child with most signals blocked, to avoid any issues before we
   * can reset them, but allow program failures to exit (and not hang). */
  sigfillset(&signewset);
  sigdelset(&signewset, SIGKILL);
  sigdelset(&signewset, SIGSTOP);
  sigdelset(&signewset, SIGTRAP);
  sigdelset(&signewset, SIGSEGV);
  sigdelset(&signewset, SIGBUS);
  sigdelset(&signewset, SIGILL);
  sigdelset(&signewset, SIGSYS);
  sigdelset(&signewset, SIGABRT);
  if (pthread_sigmask(SIG_BLOCK, &signewset, &sigoldset) != 0)
    abort();

The core shows that the abort in the last line of this snippet is firing.

Looking at both the man page for pthread_sigmask and also the kernel code in 10-STABLE this doesn't seem like unreasonable code as the only documented error is EINVAL which can't apply here. POSIX explicitly says EINTR isn't allowed (and I can't see how that would happen in the kernel code) or any other error values coming out of the kernel but I could be missing something.

One further oddity is that this doesn't happen at all if the process being spawned is a non-setuid executable but I can't see why that would matter as this code is before the fork anyway. Telling node spawn to use a shell to start the process makes this even less deterministic. Sometimes it will abort and sometimes it won't.

Any ideas on how to fix this (preferably without having to cook up a modified libuv :)

Mike


Home | Main Index | Thread Index | Old Index