|
View:
New views
2 Messages
—
Rating Filter:
Alert me
|
|
|
IKVM drops on subsequent JNI callsHi all,
I've run into trouble using JNI calls via IKVM, under very specific circumstances, so, maybe, this info could be helpful to others. I have some native dll that was joined to my old Java app. It worked nice for several years. Under IKVM (I converted a part of my app to make a library for .net port), it craches with "attempt to read/write protected memory" or "ExecutionEngineExeption" (the type of error every time is randomic). Under debugger it usually just closes application silently without any notice. After some investigation I seem to find the root of the trouble: I guess the native library is loaded/unloaded for every call! At least, it looks like that: the first call to dll initializes some objects inside it (in my case, context of very specific cryptoprovider that isn't WinCSP-compatible). And this works. The subsequent call relies on these initialized objects - and it fails! Any number of calls that don't rely on already initialized objects - work fine. Furthermore, if I just make a new JNI function that "joins" the two calls - it works as needed. Yes, I used the last two development builds. For now, I see the only way to remedy the situation - rewrite all this Java code on C# using PInvoke, not IKVM/JNI. So I just wanted to warn others that such problem does exist. ------------------------------------------------------------------------------ Come build with us! The BlackBerry® Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9-12, 2009. Register now! http://p.sf.net/sfu/devconf _______________________________________________ Ikvm-developers mailing list Ikvm-developers@... https://lists.sourceforge.net/lists/listinfo/ikvm-developers |
|
|
Re: IKVM drops on subsequent JNI callsHi,
This is not exactly helpful. I can assure you that the native library is not loaded/unloaded for every call. Have you tried running your code on Sun's Java with the -Xcheck:jni option? Regards, Jeroen > -----Original Message----- > From: Дейзи Чейн [mailto:daisychain@...] > Sent: Saturday, September 19, 2009 11:09 AM > To: ikvm-developers@... > Subject: [Ikvm-developers] IKVM drops on subsequent JNI calls > > Hi all, > I've run into trouble using JNI calls via IKVM, under very specific > circumstances, so, maybe, this info could be helpful to others. I have > some native dll that was joined to my old Java app. It worked nice for > several years. Under IKVM (I converted a part of my app to make a > library for .net port), it craches with "attempt to read/write > protected memory" or "ExecutionEngineExeption" (the type of error every > time is randomic). Under debugger it usually just closes application > silently without any notice. > After some investigation I seem to find the root of the trouble: I > guess the native library is loaded/unloaded for every call! At least, > it looks like that: the first call to dll initializes some objects > inside it (in my case, context of very specific cryptoprovider that > isn't WinCSP-compatible). And this works. The subsequent call relies on > these initialized objects - and it fails! Any number of calls that > don't rely on already initialized objects - work fine. Furthermore, if > I just make a new JNI function that "joins" the two calls - it works as > needed. > Yes, I used the last two development builds. > For now, I see the only way to remedy the situation - rewrite all this > Java code on C# using PInvoke, not IKVM/JNI. So I just wanted to warn > others that such problem does exist. > > ----------------------------------------------------------------------- > ------- > Come build with us! The BlackBerry® Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart > your > developing skills, take BlackBerry mobile applications to market and > stay > ahead of the curve. Join us from November 9-12, 2009. Register > now! > http://p.sf.net/sfu/devconf > _______________________________________________ > Ikvm-developers mailing list > Ikvm-developers@... > https://lists.sourceforge.net/lists/listinfo/ikvm-developers ------------------------------------------------------------------------------ Come build with us! The BlackBerry® Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9-12, 2009. Register now! http://p.sf.net/sfu/devconf _______________________________________________ Ikvm-developers mailing list Ikvm-developers@... https://lists.sourceforge.net/lists/listinfo/ikvm-developers |
| Free embeddable forum powered by Nabble | Forum Help |