This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
c++ exceptions in JNI dependant library
- From: Stuart Jarriel <sjarriel at motive dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Fri, 12 Apr 2002 09:01:29 -0500
- Subject: c++ exceptions in JNI dependant library
I have a JNI shared library (libx.so) that uses another C++ shared library
(liby.so). liby.so uses C++ exceptions extensively. When calling the
Java native methods, if liby.so throws an exception the JVM aborts, with
a stack trace that shows the liby.so C++ 'throw' called __terminate.
If I link liby.so to a C++ a.out and call the same method it works
as expected (the exception has a catch block).
I dont grok the details of C++ exception implementation but my reading
leads me to think that liby.so was not 'initialized' to set up the
handler blocks correctly.
This is RedHat linux 6.1 with gcc 2.91.66.
My question is: is liby.so initialization a possible culprit and if so,
what causes a shared library's exception handlers to be initialized?