Thread: [Jamvm-general] Jamvm seg faults on Mips ( Big endian )
Brought to you by:
rlougher
From: Super N. <ver...@ya...> - 2011-07-19 08:18:18
|
Hi, I cross compiled jamvm to a netgear wi-fi router. I used the tool chain generated by open Wrt for the target processor ( Atheros 71xx which has a mips 24kc big endian processor ). I also cross compiled Gnu classpath 0.98 using the same tool chain. For the cross compilation to go through i added this line - "mips-*-linux*) host_cpu=mips host_os=linux ;;" to configure since big endian is not offically supported for mips. When i downloaded the jamvm and classpath on to the target jamvm segfaults even for a simple "Hello World" program. I tried to reduce the complexity of the JamVm interpreter by disabling int threading and optimisation etc, but the segfault persists. Sometimes i get a bus error. This is the configuration options i used to build jamvm. ./configure --host=mips-openwrt-linux --enable-trace --disable-int-inlining --disable-int-threading --disable-int-direct --disable-int-caching --disable-int-prefetch "CFLAGS=-mabi=32 -march=24kc -EB -O0" Also pasted a the bottom of the mail jamvm output before the crash. Any help greatly appreciated. Target does not have gdb or Jtag. Stuck.. <ALLOC: took 0 tries to find block.> <ALLOC: allocated java/lang/ThreadLocal object @0x2b838c68> Thread 0x46fce0 lock on obj 0x2b838c68... Thread 0x46fce0 unlock on obj 0x2b838c68... Thread 0x46fce0 lock on obj 0x2b838b18... Thread 0x46fce0 unlock on obj 0x2b838b18... <ALLOC: took 0 tries to find block.> <ALLOC: allocated class object @0x2b838c78> [Loaded java/security/CodeSource from /usr/local/classpath/share/classpath/glibj.zip] Thread 0x46fce0 lock on obj 0x2b838c78... [Linking class java/security/CodeSource] Thread 0x46fce0 unlock on obj 0x2b838c78... Thread 0x46fce0 lock on obj 0x2b838c78... Thread 0x46fce0 unlock on obj 0x2b838c78... Thread 0x46fce0 lock on obj 0x2b838c78... Thread 0x46fce0 NotifyAll on obj 0x2b838c78... Thread 0x46fce0Segmentation fault -JediKnight |
From: JediKnight <ver...@ya...> - 2011-07-20 06:22:14
|
Hi guys, The above problem is resolved. Not sure what was wrong. I was using a different tool chain version to build classpath/jamvm compared to the tool chain that was used to create the kernel/RFS. When i used the same tool chain the segfault dissapears. Am able to run a simple "Hello World" program on the target. Now i have new problem when i try to start knopflerfish Osgi framework using jamvm: /usr/local/jamvm/bin/jamvm -jar /root/core_bundles/framework.jar I get this error: java.util.zip.ZipException: Not a valid zip file at java.util.zip.ZipFile.checkZipFile(ZipFile.java:209) at java.util.zip.ZipFile.<init>(ZipFile.java:139) at java.util.jar.JarFile.<init>(JarFile.java:199) at java.util.jar.JarFile.<init>(JarFile.java:181) at jamvm.java.lang.JarLauncher.main(JarLauncher.java:33) What could be wrong? The same jar starts wihout a problem for the same version of jamvm/classpath when compiled for i686 instead of mips. -- View this message in context: http://old.nabble.com/Jamvm-seg-faults-on-Mips-%28-Big-endian-%29-tp32089143p32096918.html Sent from the JamVM mailing list archive at Nabble.com. |
From: JediKnight <ver...@ya...> - 2011-07-21 10:58:20
|
Hi Guys, The zip file invalid error dissapears if i use yet to be released JamVm version 1.6.0. But the seg fault re-appears whenever i try to run a non trivial java program. Has anybody been able to run Jamvm on Big endian mips successfully ? /JediKnight -- View this message in context: http://old.nabble.com/Jamvm-seg-faults-on-Mips-%28-Big-endian-%29-tp32089143p32106437.html Sent from the JamVM mailing list archive at Nabble.com. |
From: Robert L. <rob...@gm...> - 2011-07-21 11:19:51
|
Hi, On 21 July 2011 11:58, JediKnight <ver...@ya...> wrote: > > Hi Guys, > > The zip file invalid error dissapears if i use yet to be released JamVm > version 1.6.0. > But the seg fault re-appears whenever i try to run a non trivial java > program. > > Has anybody been able to run Jamvm on Big endian mips successfully ? > I don't have a Big Endian MIPS system (in fact, right now, I have no MIPS systems at all). But several people reported that JamVM worked OK on Big Endian so I changed configure to recognise mips systems as well as mipsel. This is a change since 1.5.4, and will be in 1.6.0, whenever that gets released (my current priority is the OpenJDK port on ARM). You say you tried 1.6.0. Was that from the old CVS tree, or the new OpenJDK git tree? Rob. > /JediKnight > > > > > > -- > View this message in context: http://old.nabble.com/Jamvm-seg-faults-on-Mips-%28-Big-endian-%29-tp32089143p32106437.html > Sent from the JamVM mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------------ > 5 Ways to Improve & Secure Unified Communications > Unified Communications promises greater efficiencies for business. UC can > improve internal communications as well as offer faster, more efficient ways > to interact with customers and streamline customer service. Learn more! > http://www.accelacomm.com/jaw/sfnl/114/51426253/ > _______________________________________________ > Jamvm-general mailing list > Jam...@li... > https://lists.sourceforge.net/lists/listinfo/jamvm-general > |
From: Robert L. <rob...@gm...> - 2011-07-21 11:38:05
|
On 21 July 2011 12:19, Robert Lougher <rob...@gm...> wrote: > Hi, > > On 21 July 2011 11:58, JediKnight <ver...@ya...> wrote: >> >> Hi Guys, >> >> The zip file invalid error dissapears if i use yet to be released JamVm >> version 1.6.0. >> But the seg fault re-appears whenever i try to run a non trivial java >> program. >> >> Has anybody been able to run Jamvm on Big endian mips successfully ? >> > > You say you tried 1.6.0. Was that from the old CVS tree, or the new > OpenJDK git tree? OK, I've answered this myself. It must have been the OpenJDK git tree (version 1.6.0-devel). The cvs tree has version 1.5.5-devel. The git tree contains the restructured VM that supports both OpenJDK and GNU Classpath runtime libraries. Unfortunately, GNU Classpath support has still not received much testing (the restructuring could have broken lots of things). The "official" release from this branch will be 1.6.0, but IcedTea are already taking the sources from here, so any release will really be for GNU Classpath. But this keeps getting delayed because of OpenJDK fixes. The CVS tree is JamVM 1.5.4 with a couple of bug fixes (one of which is MIPS related). At one point I was intending to make a minor 1.5.5 release but it contains so little over 1.5.4 I've never done it. However, with the continuing delay over 1.6.0 I'll probably quietly update the version to fix the issues some people are seeing on ARM and MIPS. Rob. > > Rob. > >> /JediKnight >> >> >> >> >> >> -- >> View this message in context: http://old.nabble.com/Jamvm-seg-faults-on-Mips-%28-Big-endian-%29-tp32089143p32106437.html >> Sent from the JamVM mailing list archive at Nabble.com. >> >> >> ------------------------------------------------------------------------------ >> 5 Ways to Improve & Secure Unified Communications >> Unified Communications promises greater efficiencies for business. UC can >> improve internal communications as well as offer faster, more efficient ways >> to interact with customers and streamline customer service. Learn more! >> http://www.accelacomm.com/jaw/sfnl/114/51426253/ >> _______________________________________________ >> Jamvm-general mailing list >> Jam...@li... >> https://lists.sourceforge.net/lists/listinfo/jamvm-general >> > |
From: JediKnight <ver...@ya...> - 2011-07-22 10:50:20
|
Hi Rob, Thanks for your replies. I built the cvs tree: cvs -z3 -d:pserver:ano...@cv...:/cvsroot/jamvm co jamvm I found two files missing which caused a linker failuer: 1. /src/os/linux/mips/stubs_md.c 2. /src/os/linux/mips/jni-stubs.c I copied the files from jamvm 1.6 code base. I am not sure if that was the right thing to do. I still get a seg fault. Also built jamvm with --enable-ffi option still the same result. Even after the segfault i can still see the process using 'ps' which is kind of wiered ( may be it is in a zombie state ). Target does not dump core and no gdb so stuck again. /JediKnight -- View this message in context: http://old.nabble.com/Jamvm-seg-faults-on-Mips-%28-Big-endian-%29-tp32089143p32114307.html Sent from the JamVM mailing list archive at Nabble.com. |
From: JediKnight <ver...@ya...> - 2011-07-29 03:50:33
|
Hi, I built gdb for the target and enabled core dump. Now when i load the core dump in gdb and a backtrace i get this output: ****************************************************************** warning: Unable to find dynamic linker breakpoint function. GDB will be unable to debug shared library initializers and track explicitly loaded dynamic code. Core was generated by `/usr/local/jamvm/bin/jamvm -Xms2m -Xmx4m -jar /root/core_ bundles/framework.jar'. Program terminated with signal 11, Segmentation fault. [New process 1048] [New process 1042] [New process 1043] [New process 1044] [New process 1045] [New process 1046] [New process 1047] [New process 1049] [New process 1041] #0 0x2ab64ae0 in ?? () (gdb) bt #0 0x2ab64ae0 in ?? () #1 0x2ab64ae8 in ?? () Backtrace stopped: previous frame identical to this frame (corrupt stack?) (gdb) *********************************************************************** I was wondering since this a VM instead and not a normal "C" executable, there might be low level stack manupulation in the code which confuses gdb. My question then is how do you debug VM specifically how do i debug Jam VM ? TIA, /JediKnight -- View this message in context: http://old.nabble.com/Jamvm-seg-faults-on-Mips-%28-Big-endian-%29-tp32089143p32159600.html Sent from the JamVM mailing list archive at Nabble.com. |
From: JediKnight <ver...@ya...> - 2011-07-29 03:51:09
|
Hi, I built gdb for the target and enabled core dump. Now when i load the core dump in gdb and a backtrace i get this output: ****************************************************************** warning: Unable to find dynamic linker breakpoint function. GDB will be unable to debug shared library initializers and track explicitly loaded dynamic code. Core was generated by `/usr/local/jamvm/bin/jamvm -Xms2m -Xmx4m -jar /root/core_ bundles/framework.jar'. Program terminated with signal 11, Segmentation fault. [New process 1048] [New process 1042] [New process 1043] [New process 1044] [New process 1045] [New process 1046] [New process 1047] [New process 1049] [New process 1041] #0 0x2ab64ae0 in ?? () (gdb) bt #0 0x2ab64ae0 in ?? () #1 0x2ab64ae8 in ?? () Backtrace stopped: previous frame identical to this frame (corrupt stack?) (gdb) *********************************************************************** I was wondering since this a VM instead and not a normal "C" executable, there might be low level stack manupulation in the code which confuses gdb. My question then is how do you debug VM specifically how do i debug Jam VM ? TIA, /JediKnight -- View this message in context: http://old.nabble.com/Jamvm-seg-faults-on-Mips-%28-Big-endian-%29-tp32089143p32159602.html Sent from the JamVM mailing list archive at Nabble.com. |
From: JediKnight <ver...@ya...> - 2011-07-29 03:49:50
|
Hi, I built gdb for the target and enabled core dump. Now when i load the core dump in gdb and a backtrace i get this output: ****************************************************************** warning: Unable to find dynamic linker breakpoint function. GDB will be unable to debug shared library initializers and track explicitly loaded dynamic code. Core was generated by `/usr/local/jamvm/bin/jamvm -Xms2m -Xmx4m -jar /root/core_ bundles/framework.jar'. Program terminated with signal 11, Segmentation fault. [New process 1048] [New process 1042] [New process 1043] [New process 1044] [New process 1045] [New process 1046] [New process 1047] [New process 1049] [New process 1041] #0 0x2ab64ae0 in ?? () (gdb) bt #0 0x2ab64ae0 in ?? () #1 0x2ab64ae8 in ?? () Backtrace stopped: previous frame identical to this frame (corrupt stack?) (gdb) *********************************************************************** I was wondering since this a VM instead and not a normal "C" executable, there might be low level stack manupulation in the code which confuses gdb. My question then is how do you debug VM specifically how do i debug Jam VM ? TIA, /JediKnight -- View this message in context: http://old.nabble.com/Jamvm-seg-faults-on-Mips-%28-Big-endian-%29-tp32089143p32159596.html Sent from the JamVM mailing list archive at Nabble.com. |
From: JediKnight <ver...@ya...> - 2011-07-29 03:51:51
|
Hi, I built gdb for the target and enabled core dump. Now when i load the core dump in gdb and a backtrace i get this output: ****************************************************************** warning: Unable to find dynamic linker breakpoint function. GDB will be unable to debug shared library initializers and track explicitly loaded dynamic code. Core was generated by `/usr/local/jamvm/bin/jamvm -Xms2m -Xmx4m -jar /root/core_ bundles/framework.jar'. Program terminated with signal 11, Segmentation fault. [New process 1048] [New process 1042] [New process 1043] [New process 1044] [New process 1045] [New process 1046] [New process 1047] [New process 1049] [New process 1041] #0 0x2ab64ae0 in ?? () (gdb) bt #0 0x2ab64ae0 in ?? () #1 0x2ab64ae8 in ?? () Backtrace stopped: previous frame identical to this frame (corrupt stack?) (gdb) *********************************************************************** I was wondering since this a VM instead and not a normal "C" executable, there might be low level stack manupulation in the code which confuses gdb. My question then is how do you debug VM specifically how do i debug Jam VM ? TIA, /JediKnight -- View this message in context: http://old.nabble.com/Jamvm-seg-faults-on-Mips-%28-Big-endian-%29-tp32089143p32159603.html Sent from the JamVM mailing list archive at Nabble.com. |
From: JediKnight <ver...@ya...> - 2011-07-29 04:01:01
|
Hi, Applogies for the spam. Was trying to post a message and i got an HTTP error 500 leading me to believe that the message was not posted. As i result i posted several times. Mods: can you remove multiple copies of the same message. /JediKnight. -- View this message in context: http://old.nabble.com/Jamvm-seg-faults-on-Mips-%28-Big-endian-%29-tp32089143p32159613.html Sent from the JamVM mailing list archive at Nabble.com. |
From: JediKnight <ver...@ya...> - 2011-08-02 08:50:35
|
Hi Rob, Any pointers how to debug this ? /JediKnight -- View this message in context: http://old.nabble.com/Jamvm-seg-faults-on-Mips-%28-Big-endian-%29-tp32089143p32176070.html Sent from the JamVM mailing list archive at Nabble.com. |
From: Robert L. <rob...@gm...> - 2011-08-02 11:02:39
|
Hi, On 2 August 2011 09:50, JediKnight <ver...@ya...> wrote: > > Hi Rob, > > Any pointers how to debug this ? > Debugging a JVM is not easy. First thing to always do is disable the (code-copying) JIT. This is for two reasons. If it now works the problem is likely to be invalid code from the JIT. You now have a really tough debugging task! If it still doesn't work the problem is in the rest of the VM. Turning off the JIT makes debugging far easier, as the PC now points to compiled C code rather than generated code, which confuses the debugger. On MIPS, the JIT is off by default in 1.5.4. It is on in 1.6.0. ./configure --disable-int-inlining Now run the executable in gdb. Before you run anything you want to do: handle SIGUSR1 nostop pass noprint Otherwise gdb will stop whenever a thread is suspended by the VM (e.g. for garbage collection). Now run your program. It should stop when the segv occurs, and you should be able to get a backtrace. This should be enough for getting on with. You'll probably want to poke about a bit, and print the values of various variables. By default JamVM is built with -O2 -g. The -O2 can make debugging harder, as some values will be optimised out by the compiler. So at this stage you might like to try disabling optimisation, e.g.: ./configure --disable-int-inlining CFLAGS=-g Of course, everything will run much slower. Rob. > /JediKnight > > -- > View this message in context: http://old.nabble.com/Jamvm-seg-faults-on-Mips-%28-Big-endian-%29-tp32089143p32176070.html > Sent from the JamVM mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------------ > BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA > The must-attend event for mobile developers. Connect with experts. > Get tools for creating Super Apps. See the latest technologies. > Sessions, hands-on labs, demos & much more. Register early & save! > http://p.sf.net/sfu/rim-blackberry-1 > _______________________________________________ > Jamvm-general mailing list > Jam...@li... > https://lists.sourceforge.net/lists/listinfo/jamvm-general > |