help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

JNI lib crash, with a change in a .c file which is not included in the M


From: aqura
Subject: JNI lib crash, with a change in a .c file which is not included in the Makefile Options
Date: Wed, 28 Mar 2012 18:29:53 -0000
User-agent: G2/1.0

We are facing an unusual problem, our JNI lib crashes at load time.
we
use CentOS 5.4/G++ and VS2005 for development.

scenario: we are currently working on an enhancement in our product
and wanted to pass the new information back to the Java server code
using JNI. our C/C++ code works fine and we have tested it by running
for around 6 hours or so in our dev environment. we have updated two
result structure(which were already present) with one long value each
to pass on the result of our new enhancement.

when we updated the JNI code to pass on the result to Java code, we
found that Java server is crashing while loading JNI, we did
debugging
and found that JNI lib crashes, even, when we do not have our changes
in JNI lib code base.

in our further debugging we found that, JNI Makefile includes a .c
file(aa.c), which has a couple of our changes for the new
enhancement;
we started with commenting our changes in this aa.c file one by one
and found that the crash happens only when we have BBB.cpp::method1()
call(which we have added, as part of our new enhancement).

The unusual part is, this .c file(aa.c) is not needed in the JNI lib
and we do not have any methods of aa.c called from JNI lib; Now we
have removed aa.c from the JNI Makefile and compile just fine, but
still crashes when we have BBB.cpp::method1() call, if we remove this
method1() call then it works fine.

we are not sure, why/how it is linking to a file which is not
included, in the Makefile and crashing.

this is the error log we see
---------------
AgentServer#0 started: OK 12750 [Connection#Cnx:#0.0.1026:0 -
Session#c0s1] ERROR com.xx.xxx.xxxx - Unable to load JNI
BBBController
Library java.lang.UnsatisfiedLinkError: /opt/XXXXX/lib/libjnixxx.so:
Can't load IA 32-bit .so on a IA 32-bit platform at
java.lang.ClassLoader$NativeLibrary.load(Native Method) at
java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at
java.lang.ClassLoader.loadLibrary(ClassLoader.java:1676) at
java.lang.Runtime.loadLibrary0(Runtime.java:822) at
java.lang.System.loadLibrary(System.java:993)
----------------

This is a existing source code, where everything was working fine.
the source code, we have taken from the repository and just build it,
without making any changes and we see the crash.
if we leave the original binary, the server runs fine.

Please suggest, any idea's would be appreciated.

Thanks in advance,
Aqura


reply via email to

[Prev in Thread] Current Thread [Next in Thread]