Skip to main content

CLDC, compile for ARM, Fatal Signal during execution on target

3 replies [Last post]
flaviopereira
Offline
Joined: 2008-02-18

Hi all

I'm trying to get CLDC running on an ARM platform. My build is based on the MR3 release. When compiling for i386, i can execute dist/linux_i386/cldc_vm Helloworld succesfully (Hello World is dumped to screen)

I then compile for ARM using the export GNU_TOOLS_DIR option pointing to my cross compilers. All compiles well and cldc_vm, cldc_vm_r and cldc_vm_g are present in the dist/linux_arm directory.

I copy the cldc_vm to my target board and execute the same far file. The following error is returned:
# ./cldc_vm -cp HelloWorld.jar Helloworld
Fatal signal SIGSEGV: errno=0; code=1; addr=0xf0fa8

With cldc_vm_r:
# ./cldc_vm_r Helloworld
Fatal signal SIGSEGV: errno=0; code=1; addr=0x17c4ef
[Dumping all threads]
Current thread = 0x0

[Finished dumping all threads]

And with cldc_vm_g:
# ./cldc_vm_g Helloworld
Fatal signal SIGSEGV: errno=0; code=1; addr=0x365ed3
[Dumping all threads]
Current thread = 0x0

[Finished dumping all threads]

There is no descriptive error message, so I have not idea where to start.

Could anyone provide some clue as to what the problem may be?

Additional info:
I have tested the PSCL part on the target with donuts, this seems ok
# ./donuts
start donuts...
run testDir_win32
Already initialized
run testFile
Already initialized
Next file from iterator = test1.jar
Next file from iterator = test2.jar
Next file from iterator = test3.jar
Next file from iterator = test4.jar
run testMem
run testPrint
This is a test
This is a another test
run testString
testString PASSED

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
flaviopereira
Offline
Joined: 2008-02-18

Also, here is the backtrace, any ideas on where to start, I don't even understand what it is trying to do
backtrace
#0 0x000f7c08 in JVMOopDesc::map_oops_do (this=0x40139180,
map=0x365d23

,
do_oop=0x13d4b4 )
at /home/smile/java/phoneme_feature/cldc/src/vm/share/memory/OopDesc.inline.hpp:34
#1 0x0017102c in JVMOopDesc::oops_do_for (this=0x40139180,
blueprint=0x18ca50,
do_oop=0x13d4b4 )
at /home/smile/java/phoneme_feature/cldc/src/vm/share/runtime/HotRoutines.incl.hpp:459
#2 0x0013d5b0 in JVMROM::relocate_heap_block ()
at /home/smile/java/phoneme_feature/cldc/src/vm/share/ROM/ROM.cpp:248
#3 0x0013d7c0 in JVMROM::link_static (ram_persistent_handles=0x1f0b34,
num_handles=85)
at /home/smile/java/phoneme_feature/cldc/src/vm/share/ROM/ROM.cpp:310
#4 0x001321f0 in JVMUniverse::bootstrap_with_rom (classpath=0x1d0f52)
at /home/smile/java/phoneme_feature/cldc/src/vm/share/handles/Universe.cpp:639
#5 0x00131f24 in JVMUniverse::bootstrap (classpath=0x1d0f52)
at /home/smile/java/phoneme_feature/cldc/src/vm/share/handles/Universe.cpp:560
#6 0x00159f94 in JVM::initialize ()
at /home/smile/java/phoneme_feature/cldc/src/vm/share/runtime/JVM.cpp:332

Thanks.

danila
Offline
Joined: 2006-09-25

Hello,
do you have a native debugger for your ARM platform?
Can you run the debug VM binary under the debugger?
Consider building gdb for your target and remote debugging with gdb
http://www.kegel.com/linux/gdbserver.html

Danila

flaviopereira
Offline
Joined: 2008-02-18

Hi Danilla

I finally managed to get some time to get the whole debug environment set up. So in stepping through the code, the crash is related to function relocate_heap_block in ROM.cpp. Where do i start looking ;-(?

Breakpoint 7, JVMROM::relocate_heap_block ()
at /home/java/phoneme_feature/cldc/src/vm/share/ROM/ROM.cpp:239
239 OopDesc* q = (OopDesc*)_romized_heap_top;
(gdb) n
240 int offset = _heap_relocation_offset;
(gdb) n
242 while (q < (OopDesc*)_inline_allocation_top) {
(gdb) n
243 relocate_pointer_to_heap((OopDesc**)q);
(gdb) n
244 FarClassDesc* blueprint = q->blueprint();
(gdb) n
245 if (heap_src_block_contains((address)blueprint)) {
(gdb) n
248 q->oops_do_for(blueprint, relocate_pointer_to_heap);
(gdb) n

Program received signal SIGSEGV, Segmentation fault.
0x000f7c08 in JVMOopDesc::map_oops_do (this=0x40139180,
map=0x365d23

,
do_oop=0x13d4b4 )
at /home/smile/java/phoneme_feature/cldc/src/vm/share/memory/OopDesc.inline.hpp:34
34 const jint entry = (jint)(*((jbyte*)map)); map++;

Message was edited by: flaviopereira