Hello everyone,


When running my program on Java JVM 5.0, there are strange stack errors. What may be the root cause?

(foo.dll is my JNI invoked native library.)

--------------------
Registers:
EAX=0x0c213e40, EBX=0x00000000, ECX=0x00000000, EDX=0x00000000
ESP=0x0c213e0c, EBP=0x0c213e44, ESI=0x00000000, EDI=0x00000000
EIP=0x0c4e8070, EFLAGS=0x0001024f

Top of Stack: (sp=0x0c213e0c)
0x0c213e0c: 00000000 00000000 00000000 0b97aeb0
0x0c213e1c: 0c4e8232 00000000 00000000 0b97aeb0
0x0c213e2c: 00000000 00000000 00000000 00000000
0x0c213eec: 00000000 00000000 0c213eb4 0c4e8147
0x0c213e4c: 00000000 00000000 0b97ac70 0b97aeb0
0x0c213e5c: 00000000 f5e24244 4e434c53 4854534b
0x0c213efc: 44414552 00000000 00000000 00000000
0x0c213e7c: 00000000 00000000 00000000 00000000

Instructions: (pc=0x0c4e8070)
0x0c4e80f0: 08 8b 4f 08 56 ce 5f 8b 31 33 74 24 08 fa 00 52
0x0c4e8070: 33 ef 33 15 5c 40 45 0c 8e 38 33 89 4f 08 74 04


Stack: [0x0c1e0000,0x0c220000), sp=0x0c21f30c, free space=252k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM cod6, C=native code)
C [foo.dll+0x18070]
C [foo.dll+0x18147]
--------------------


thanks in advance,
George

a problem in your native library is the most likely cause.

Thanks jwenting. I am surprised that native code fail makes JVM crash. Could you show me some popular cases why native call could cause JVM fail please?

One sample I could think of is, the JVM can not find the related function name from the native module (foo.dll). Is that correct?

Any other cases?

a problem in your native library is the most likely cause.

regards,
George

that could be it (though I'd expect a more graceful error message were that to happen). But more likely a method in your DLL overwrites some memory belonging to the JVM, causing it to fail, or runs into an infinite loop (you didn't post the entire error message, which might shed more light on things).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.