13 messages in net.java.dev.jna.usersRe: [jna-users] JNA crashes on large ...
FromSent OnAttachments
Stas OskinSep 15, 2008 9:42 am 
Timothy WallSep 15, 2008 10:57 am 
Stas OskinSep 15, 2008 1:00 pm 
Stas OskinSep 15, 2008 1:11 pm 
Timothy WallSep 15, 2008 1:17 pm 
Stas OskinSep 16, 2008 4:16 am 
Timothy WallSep 16, 2008 5:18 am 
Stas OskinSep 16, 2008 7:08 am 
Timothy WallSep 16, 2008 7:20 am 
Stas OskinSep 17, 2008 4:45 am 
Timothy WallSep 17, 2008 5:32 am 
Stas OskinSep 17, 2008 7:31 am 
Timothy WallSep 17, 2008 7:38 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [jna-users] JNA crashes on large number of threadsActions...
From:Timothy Wall (twal@dev.java.net)
Date:Sep 15, 2008 1:17:51 pm
List:net.java.dev.jna.users

Likely that the pointer for the structure is no longer valid. You can print the value (Structure.getPointer()) to see if it looks obviously corrupt. Is the structure allocated by native code, or by Java code? If the former, are you certain the memory hasn't been freed?

Odd that setProtected(true) didn't prevent the crash, although it just uses signal handlers, so it's possible its handler got replaced.

On Sep 15, 2008, at 4:11 PM, Stas Oskin wrote:

Hi again.

I actually figured out to check the logs, and the stack trace was indeed there:

C [jna8479.tmp+0x8072] Java_com_sun_jna_Pointer__1getInt+0x74 J com.sun.jna.Pointer._getInt(J)I

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) J com.sun.jna.Pointer._getInt(J)I J com.sun.jna.Structure.readValue(ILjava/lang/Class;Ljava/lang/ Object;)Ljava/lang/Object; J com.sun.jna.Structure.read()V J org.update.threads.ReadDataThread.run()V v ~BufferBlob::StubRoutines (1)

Any idea - seems as the structure wasn't read?

2008/9/15 Stas Oskin <stas@gmail.com> Hi.

I tried enabling the setProtected before, and it didn't help - the app always crashed. I do recall that it was due to some possible issues in the native code, so it worth trying again.

If it does not work - what other means I have to track the issue? Is there any way at all to get core dumps and check them?

Also, by meaning the who owns the pointer, you mean that somewhere I'm trying to access invalid int pointer?

Regards.

2008/9/15 Timothy Wall <twal@dev.java.net>

Do you have any more stack? If not, if you run with - Djna.protected=true (or Native.setProtected(true)), the SEGV should throw a java.lang.Error instead of crashing.

You'll need to determine who owns the pointer value being used and how it got to be invalid (if it's really failing in Pointer.getInt).

On Sep 15, 2008, at 12:42 PM, Stas Oskin wrote:

Hi.

I'm trying to hunt an issue of JNA sporadically crashing after working some time normally, with a high number of concurrent threads (40+). The problem seems to be within JNA, as the log shows:

# # An unexpected error has been detected by Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaad6a3b072, pid=9698, tid=1187899712 # # Java VM: Java HotSpot(TM) 64-Bit Server VM (10.0-b23 mixed mode linux-amd64) # Problematic frame: # C [jna8479.tmp+0x8072] Java_com_sun_jna_Pointer__1getInt+0x74 # # An error report file with more information is saved as: # /JavaCore/hs_err_pid9698.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Aborted

Any idea how I can hunt for this one, or how this crash could be prevented at all?

Regards.