This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]