8 messages in net.java.dev.jna.usersRe: [jna-users] "Native call setup fa...
FromSent OnAttachments
Duncan McGregorDec 13, 2007 6:52 am 
Duncan McGregorDec 13, 2007 7:19 am 
Timothy WallDec 13, 2007 7:41 am 
Timothy WallDec 13, 2007 8:01 am 
Duncan McGregorDec 13, 2007 2:12 pm 
Timothy WallDec 13, 2007 4:14 pm 
Duncan McGregorDec 14, 2007 2:35 am 
Duncan McGregorDec 14, 2007 3:55 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] "Native call setup failure" passing struct of struct by valueActions...
From:Duncan McGregor (dun@oneeyedmen.com)
Date:Dec 13, 2007 2:12:50 pm
List:net.java.dev.jna.users

Wow, that's an ant build!

For the record, I needed ant -Ddebug.native=true

For some reason make in native it fails during linking with

/usr/libexec/gcc/i686-apple-darwin8/4.0.1/libtool: first field (- current_version) in argument for: -compatibility_version - current_version not a proper unsigned number

Reminds me why I came over to Java in the first place!

Cheers

Duncan

On 13 Dec 2007, at 16:01, Timothy Wall wrote:

Since you get *both* a memory error and an invalid struct typedef, it's possible that something is being prematurely GC'd, or not properly set up.

Look at init_type in dispatch.c, which is where ffi typecodes are translated to real ffi types. If the layout is done improperly it could result in either error.

You might get some mileage by attaching gdb to the java process so that it can catch the invalid access (recompile the native stuff with "make DEBUG=true" or "ant -Ddebug=true" to get better source visibility).

There's a method you can call from gdb that makes the apple VM dump the java stack, google "apple gdb java stack dump" 'cuz I don't remember offhand.