discuss-gnustep
[Top][All Lists]
Advanced

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

Exception Handling and _NS_COUNT_HACK


From: Samantha Rahn
Subject: Exception Handling and _NS_COUNT_HACK
Date: Mon, 27 Oct 2008 15:02:59 -0400

I am finding that Objective-C exceptions are not being caught when my
GNUstep-built DLL is run as an in-memory COM server within a protected
memory space, such as (a) Excel and (b) GDB.

I have tracked the problem down to signal handlers not being called.
Could this be the reason that exceptions are not being handled?

For example, consider the following program that generates a SIGSEGV crash.

--
#include <signal.h>
#include <stdio.h>

void recover(int);

int main(int argc, const char *argv[])
{
   signal(SIGSEGV, recover);

   int *intPtr = 0;
   printf("Crash %d", *intPtr);

   return 0;
}

void recover(int signal)
{
   int value = signal;

   printf("Signal generated: %d\n", value);
}
--

When running from the command line, the signal handler function,
recover(), is called as expected:

      > Tool
      Signal generated: 11
      >

However, the problem shows up when the program is run within GDB: the
signal handler is not called. Any ideas about this and its possible
ramification for proper exception handling when running the DLL as an
in-process COM server?




reply via email to

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