Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ARM cross compile crashing JRE runtime
11-07-2012, 06:19 PM
Post: #1
ARM cross compile crashing JRE runtime
Hi All,

I've done a cross compile targeting an ARM embedded 32 bit platform. The build machine is 64 bit Ubuntu Intel. Also, I'm using the Java bindings. I've tried running one of the included Java tests, but the JRE is crashing; I'm having a heck of a time trying to track down what is wrong with my build. I've had to massage the Makefile of course to do my cross compile.

Anyway, here is my JRE crash log http://pastebin.com/H1BxbFeQ

and here is my Makefile http://pastebin.com/15EXvMyT

Right now I've decided to try to run a C++ native test on its own (trying to figuring out how to do that quickly) - trying to at least separate problems with the JNI bindings from the main .so itself.

Any thoughts?

Thanks
Mark Wolfskehl
Find all posts by this user
11-07-2012, 07:21 PM
Post: #2
RE: ARM cross compile crashing JRE runtime
(11-07-2012 06:19 PM)adaptiveal Wrote:  Hi All,

I've done a cross compile targeting an ARM embedded 32 bit platform. The build machine is 64 bit Ubuntu Intel. Also, I'm using the Java bindings. I've tried running one of the included Java tests, but the JRE is crashing; I'm having a heck of a time trying to track down what is wrong with my build. I've had to massage the Makefile of course to do my cross compile.

Anyway, here is my JRE crash log http://pastebin.com/H1BxbFeQ

and here is my Makefile http://pastebin.com/15EXvMyT

Right now I've decided to try to run a C++ native test on its own (trying to figuring out how to do that quickly) - trying to at least separate problems with the JNI bindings from the main .so itself.

Any thoughts?

Thanks
Mark Wolfskehl

I see you're using OpenJDK Zero to run the test. Are you able to try running the test using the Oracle embedded Linux ARM JRE instead?
Find all posts by this user
11-07-2012, 07:36 PM
Post: #3
RE: ARM cross compile crashing JRE runtime
I wasn't clear on whether that existed. I will look into that and try it. I'm a bit stuck trying to figure out an easy way to run a straight native C++ test to try to isolate the problem from the JRE.

(11-07-2012 07:21 PM)simoncn Wrote:  
(11-07-2012 06:19 PM)adaptiveal Wrote:  Hi All,

I've done a cross compile targeting an ARM embedded 32 bit platform. The build machine is 64 bit Ubuntu Intel. Also, I'm using the Java bindings. I've tried running one of the included Java tests, but the JRE is crashing; I'm having a heck of a time trying to track down what is wrong with my build. I've had to massage the Makefile of course to do my cross compile.

Anyway, here is my JRE crash log http://pastebin.com/H1BxbFeQ

and here is my Makefile http://pastebin.com/15EXvMyT

Right now I've decided to try to run a C++ native test on its own (trying to figuring out how to do that quickly) - trying to at least separate problems with the JNI bindings from the main .so itself.

Any thoughts?

Thanks
Mark Wolfskehl

I see you're using OpenJDK Zero to run the test. Are you able to try running the test using the Oracle embedded Linux ARM JRE instead?
Find all posts by this user
11-07-2012, 09:10 PM
Post: #4
RE: ARM cross compile crashing JRE runtime
(11-07-2012 07:36 PM)adaptiveal Wrote:  I wasn't clear on whether that existed. I will look into that and try it. I'm a bit stuck trying to figure out an easy way to run a straight native C++ test to try to isolate the problem from the JRE.

If you want to persist with C++ tests, you just need to update $PATH and $CROSS_COMPILE to point to your cross compiler than run make [TestName].

TestBuffer is the simplest test. TestDvDeviceStd covers the widest range of ohNet functionality.
Find all posts by this user
12-07-2012, 03:11 PM (This post was last modified: 12-07-2012 03:19 PM by adaptiveal.)
Post: #5
RE: ARM cross compile crashing JRE runtime
OK So to keep things simpler, I've done the build all over again, this time directly on the arm linux computer rather than cross compile. Again the JVM crashed http://pastebin.com/rJ0eCRub

I did run the c++ test you suggested, and it worked fine.

Do you think we have some sort of JVM bug issue? Or something with the Jni so for ohnet maybe?

(11-07-2012 09:10 PM)simonc Wrote:  
(11-07-2012 07:36 PM)adaptiveal Wrote:  I wasn't clear on whether that existed. I will look into that and try it. I'm a bit stuck trying to figure out an easy way to run a straight native C++ test to try to isolate the problem from the JRE.

If you want to persist with C++ tests, you just need to update $PATH and $CROSS_COMPILE to point to your cross compiler than run make [TestName].

TestBuffer is the simplest test. TestDvDeviceStd covers the widest range of ohNet functionality.


OK

Reading through http://www.oracle.com/technetwork/java/j...37240.html

Tried option -Xcheck:jni to java this time no crash got this exception.

FATAL ERROR in native method: Bad global or local ref passed to JNI
at java.io.FileInputStream.initIDs(Native Method)
at java.io.FileInputStream.<clinit>(FileInputStream.java:376)
at java.lang.System.initializeSystemClass(System.java:1091)
./run.sh: line 1: 2712 Aborted java -Xcheck:jni -Djava.library.path=. -classpath ohnet.jar org.openhome.net.controlpoint.tests.TestCpDeviceDv
root@chipkit:~/ohNet/jar#


(12-07-2012 03:11 PM)adaptiveal Wrote:  OK So to keep things simpler, I've done the build all over again, this time directly on the arm linux computer rather than cross compile. Again the JVM crashed http://pastebin.com/rJ0eCRub

I did run the c++ test you suggested, and it worked fine.

Do you think we have some sort of JVM bug issue? Or something with the Jni so for ohnet maybe?

(11-07-2012 09:10 PM)simonc Wrote:  
(11-07-2012 07:36 PM)adaptiveal Wrote:  I wasn't clear on whether that existed. I will look into that and try it. I'm a bit stuck trying to figure out an easy way to run a straight native C++ test to try to isolate the problem from the JRE.

If you want to persist with C++ tests, you just need to update $PATH and $CROSS_COMPILE to point to your cross compiler than run make [TestName].

TestBuffer is the simplest test. TestDvDeviceStd covers the widest range of ohNet functionality.
Find all posts by this user
12-07-2012, 04:37 PM
Post: #6
RE: ARM cross compile crashing JRE runtime
(12-07-2012 03:11 PM)adaptiveal Wrote:  OK So to keep things simpler, I've done the build all over again, this time directly on the arm linux computer rather than cross compile. Again the JVM crashed http://pastebin.com/rJ0eCRub

I did run the c++ test you suggested, and it worked fine.

Do you think we have some sort of JVM bug issue? Or something with the Jni so for ohnet maybe?

You mentioned a mixture of 32 and 64 bit support before. Are you building a matching set of libraries then running them in an appropriate VM?

Assuming that's no help, can you try using the JVM simoncn suggested?

If that doesn't help, can you add logging statements and see where the Java test crashes? For native code, use Log::Print("log text\n"), including <OpenHome/Private/Printer.h>. The output will be directed to stderr.
Find all posts by this user
12-07-2012, 05:09 PM
Post: #7
RE: ARM cross compile crashing JRE runtime
No. We wouldn't have a 64/32 mix this time. I did the build this time on the embedded arm 32 bit computer itself. I am going to try openjdk-6-cacao instead of zero now.

(12-07-2012 04:37 PM)simonc Wrote:  
(12-07-2012 03:11 PM)adaptiveal Wrote:  OK So to keep things simpler, I've done the build all over again, this time directly on the arm linux computer rather than cross compile. Again the JVM crashed http://pastebin.com/rJ0eCRub

I did run the c++ test you suggested, and it worked fine.

Do you think we have some sort of JVM bug issue? Or something with the Jni so for ohnet maybe?

You mentioned a mixture of 32 and 64 bit support before. Are you building a matching set of libraries then running them in an appropriate VM?

Assuming that's no help, can you try using the JVM simoncn suggested?

If that doesn't help, can you add logging statements and see where the Java test crashes? For native code, use Log::Print("log text\n"), including <OpenHome/Private/Printer.h>. The output will be directed to stderr.
Find all posts by this user
13-07-2012, 09:32 AM
Post: #8
RE: ARM cross compile crashing JRE runtime
Hi,

Regarding your Zero SIGSEGV, can you try using a newer version of Zero? From this link here, it sounds like this is a known problem and which may have been fixed in recent versions: https://bugs.launchpad.net/ubuntu/+sourc...bug/917206

Regarding your Zero fatal error with -Xcheck:jni, it looks very similar to this bug: http://icedtea.classpath.org/bugzilla/sh...cgi?id=323 Can you try running "java -Xcheck:jni -version" to confirm that it's a JVM problem and unrelated to ohNet?

Is Java a strong requirement for you? If C# is an option for you, we have quite a lot of experience running mono on ARM devices and using ohNet from C#. We don't have as much experience with JVMs, especially on ARM.

Also, what is your ARM CPU? If you mentioned it somewhere, I wasn't able to find it.
Visit this user's website Find all posts by this user
17-07-2012, 01:27 PM
Post: #9
RE: ARM cross compile crashing JRE runtime
Hi,

Thanks for all your help. Actually, my tenure on this particular project has ended. I am sure someone else will be picking this up. I suppose you may hear from my colleagues soon, who will be picking up the ball.

Thanks again for your help.

Mark

(13-07-2012 09:32 AM)andreww Wrote:  Hi,

Regarding your Zero SIGSEGV, can you try using a newer version of Zero? From this link here, it sounds like this is a known problem and which may have been fixed in recent versions: https://bugs.launchpad.net/ubuntu/+sourc...bug/917206

Regarding your Zero fatal error with -Xcheck:jni, it looks very similar to this bug: http://icedtea.classpath.org/bugzilla/sh...cgi?id=323 Can you try running "java -Xcheck:jni -version" to confirm that it's a JVM problem and unrelated to ohNet?

Is Java a strong requirement for you? If C# is an option for you, we have quite a lot of experience running mono on ARM devices and using ohNet from C#. We don't have as much experience with JVMs, especially on ARM.

Also, what is your ARM CPU? If you mentioned it somewhere, I wasn't able to find it.
Find all posts by this user


Forum Jump: