Getting Abort trap: 6 on load JNI Library

157 views
Skip to first unread message

Evandro Rathke

unread,
Sep 27, 2015, 11:17:57 PM9/27/15
to Avian
Hi!

I'm trying to use LuaJava with Avian and I'm getting this error.
The library is working with Java VM.
I'm running Avian on Mac OSX 10.10.5

Thanks in advance.

Joshua Warner

unread,
Sep 27, 2015, 11:19:49 PM9/27/15
to Avian
Hmm... Seeing the error in question will make debugging a lot easier.  Did you perhaps forget to attach it or maybe some intermediate system stripped it off?

-Joshua

--
You received this message because you are subscribed to the Google Groups "Avian" group.
To unsubscribe from this group and stop receiving emails from it, send an email to avian+un...@googlegroups.com.
To post to this group, send email to av...@googlegroups.com.
Visit this group at http://groups.google.com/group/avian.
For more options, visit https://groups.google.com/d/optout.

Joel Dice .

unread,
Sep 28, 2015, 5:49:23 PM9/28/15
to Avian

Or, if it's just aborting without any error output, please provide a list of steps to reproduce it and I'll see if I can debug it.

Evandro Rathke

unread,
Sep 28, 2015, 8:21:41 PM9/28/15
to Avian
I'm newbie on using Avian, probably I'm doing something wrong :S
I did the steps below:
  1. Compile LuaJava as dynamic library
  2. Put the LuaJava Library on Avian build folder 
  3. Run my application that uses LuaJava with Avian.
  4. Get the "Abort trap: 6" error.
LuaJava depends from Lua Library to be built. Can it be the problem?

Thanks!

Joel Dice

unread,
Oct 1, 2015, 1:08:02 PM10/1/15
to Avian
I just tried building LuaJava myself, but it didn't like the Debian liblua5.1-0-dev package for some reason.  I'll try again this weekend with a liblua built from source and let you know what happens.

Evandro Rathke

unread,
Oct 1, 2015, 10:45:37 PM10/1/15
to Avian
Hi Joel!

I did a simple code to find the error. I'm getting the same error when I call GetMethodId looking for a constructor.
Example:

1: jclass cls = env->FindClass("com/test/HelloNative");

2: jmethodID constructor = env->GetMethodID(cls, "<init>", "()V");

3: jobject obj = env->NewObject(cls, constructor);


the application crashes on line 2 with "Abort trap: 6" error.

Looks like the same error on thread "GetMethodID returns 0x1".


Thanks in advance.

Evandro Rathke

unread,
Oct 1, 2015, 11:05:13 PM10/1/15
to Avian
Just ignore my last post... I'm getting a non existent class on this case. Maybe LuaJava is trying to do something similar...
Sorry!

Joel Dice .

unread,
Oct 1, 2015, 11:35:21 PM10/1/15
to Avian

Is FindClass returning null?  If so, that's the problem, and it means that the VM can't find the class you asked for (i.e. the classpath specified incorrectly when the VM was initialized).  You can add a call to ExceptionDescribe to print the Java exception trace if that's what's happening.  It's a good idea to try adding ExceptionCheck and ExceptionDescribe calls to your JNI code when debugging issues like this.

Evandro Rathke

unread,
Oct 4, 2015, 1:27:32 PM10/4/15
to Avian
Hi Joel!

I will try to do that you said. I was trying to use avian -cp "luajava.jar" when I got the error. So, I tried to embedded a simple application and it works. I will do the same with LuaJava, embedding the classes and the native library and post the result here.

Thanks again!

Evandro Rathke

unread,
May 26, 2016, 5:15:49 PM5/26/16
to Avian
I got back to this issue and finally solve it.
LuaJava calls env->AllocObject and the VM is aborted. I just replace it for env->NewObject and it works.

Joel Dice .

unread,
May 31, 2016, 8:17:22 PM5/31/16
to Avian

Thanks for following up.  I don't know why AllocObject even exists in the JNI spec, but I guess we'd better implement it.  I'll post a PR when I get a chance.

Reply all
Reply to author
Forward
0 new messages