This is the mail archive of the gcc-bugs@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]

library compiled using g++ causing problems


hello all,

    I have a small java test program that calls a native jni function. The
jni function just throws an exception and has a catch clause which prints a
message. But when the exception is thrown, the jvm crashes. Control never
reaches the catch clause.  Iam working on AIX 4.3.3 platform and using java
1.3.1. 
      I found that this crash happens if i build my native library using g++
(i use gcc version 3.0.3). The program works fine if i use the IBM compiler
- xlC. .
Is this a g++ linker error ? (something to do with any default libraries it
links ?) 
       Is there any workaround or fix for this ? 

       I have pasted the native stack details below: 

  <snip> 
  SIGABRT received at 0xd0013ff0 in /usr/lib/libpthreads.a. Processing
terminated. 
  Current Thread Details 
  ---------------------- 
      "main" sys_thread_t:0x3000D2D8 
           ----- Native Stack ----- 
          at 0xD0173324 in fcntl 
          at 0xD0013FF0 in _p_raise 
          at 0xD0177210 in raise 
          at 0xD0170954 in abort 
          at 0xD1D09A54 in _ZN10__cxxabiv111__terminateEPFvvE 
          at 0xD1D09ADC in _ZSt9terminatev[DS] 
          at 0xD1D09DAC in __cxa_throw 
          at 0xD14E6278 in Java_jniTest_TestFunc 
          at 0xD280CA90 in mmisInvoke_V_VHelper 
          at 0xD282B918 in entryCmp 
  <snip> 

To build the library, i use the command:
g++ -shared -o libjniTest.so jniTest.c -I/opt/java/include -I

                Any help most appreciated.... 

regards 
vijay


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