Native C++ SetUnhandledExceptionFilter overriden by JDK1.3.1_04 and 06
843829Dec 16 2002 — edited Oct 24 2004Greetings,
I have a Win32 C++ application that, among other things, loads the JVM dynamically and calls java classes.
In this environment, I am setting my own SEH exception handling filter using SetUnhandledExceptionFilter. Primarily I am catching catastrophic exceptions like Access Violations to report the C++ stack before shutting down gracefully.
This code base works fine with JDK1.3.1_01, but does not work in JDK1.3.1_04 and 06. In the cases of 04 and 06, the Java environment is setting its own Unhandled Exception Filter PER THREAD and overriding my own. Consequently, unhandled exceptions from the C++ side of my code are not propagating to MY filter, but are dropping direct to Windows and the default debugger in the environment. I have no control over the potential of unhandled exceptions being thrown from the C++ side in that the code of concern there is DLL-based and will be provided by unknown parties (i.e., I must filter it and deal with it).
It is my assumption (which I believe I've generally confirmed) that between 01 and 04/06, some "new" OS Exception handling code was added to Java, and that it is either trapping all OS Exceptions, or not releasing them to the next filter correctly, or not unloading their filter when done.
I can override this behavior by RESETTING MY filter after the invocation of Java in EACH THREAD, but I am worried that I am, of course, bollixing up the Java environment's efforts.
I am seeking for an option to override the JVM behavior, or some other solution to be able to play together nicely.
Thanks,
Guerry