[Top][All Lists]

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

abort() on Windows 2008 Server

From: Ramiro Polla
Subject: abort() on Windows 2008 Server
Date: Sat, 18 Oct 2008 14:55:26 -0200


GNU m4 1.4.12 abort()s running on Windows 2008 Server. It doesn't go
further than setting the signal handlers, so any call to m4.exe will
fail. The problem does not occur with Windows XP. The build was made
using MinGW gcc 4.2.4, mingw-runtime 3.15.1, w32api 3.12.

The reason:
The loop at sigprocmask.c:197 tests signal() on all signals up to NSIG
for SIG_ERR. On some version of Windows (I haven't checked which one,
but it affects Windows 2008 Server), a new signal has been added. It
is the SIGABRT_COMPAT signal, which is the same as SIGABRT [0]. So on
that loop, signal() is called twice for the same signal.

The abort() on sigprocmask.c:218 has the comment:
/* The application changed a signal handler while the signal
   was blocked, bypassing our rpl_signal replacement.
   We don't support this.  */

Actually you are changing it yourself. Once for signal 6 (which is the
value of SIGABRT_COMPAT), and then again for 22 (SIGABRT).

Suggested ugly fix:
 for (sig = 0; sig < NSIG; sig++)
     if ((to_block >> sig) & 1)
         pending_array[sig] = 0;
+        if (sig == 6)
+            continue;
         if ((old_handlers[sig] = signal (sig, blocked_handler)) != SIG_ERR)
             blocked_set |= 1U << sig;

Ugly hack, I know, not meant to be applied as is. I'm sure you'll have
a better idea. MinGW still doesn't have a define for the new signal...

Ramiro Polla
[0] http://msdn.microsoft.com/en-us/library/5s651ehs(VS.80).aspx

reply via email to

[Prev in Thread] Current Thread [Next in Thread]