The Unix Implementation often crashes

Post your RCX projects, project ideas, etc here!

Moderator: roger

mico
New User
Posts: 1
Joined: Wed Oct 09, 2013 8:29 am

The Unix Implementation often crashes

Postby mico » Wed Oct 09, 2013 9:51 am

Hi,
I do not want to to run the software on a RCX, but the aim is to run it on a unix like enviroment, currently I'm experimenting with Linux. The final goal of this is the jvm running in a unix-like enviroment with minimal resources and without native thread support, but need for java green threads, so starting of with this codebase was a natural choice, I guess. Bulding was easy, all i had to do was to add a "-source 1.2" option to the javac (JDK7), and i added a -m32 to the gcc, just in case (I'm on a 64 bit system)

But the (unmodified) unix implementation keeps crashing. Some segfaults, some assertion violations, but neither reproducable.

I add two methods for string in and output (from leDos) and wrote my own test-runner (comparing the output of emu-lejosrun with the oracle java as oracle). Here are the results: http://michaelko.github.io/tvm/ I enabled extra debug output, the first test, actually works. But it does only sometimes. Sometimes it dies with

Code: Select all

Reading binary Hello.tvm
Installing binary 9273360
Checking validity of magic number
New object for class 5
Allocate 2 - free 8186
new_object_for_class: returning 9293628
New object for class 6
Allocate 2 - free 8184
new_object_for_class: returning 9293624
New object for class 7
Allocate 2 - free 8182
new_object_for_class: returning 9293620
New object for class 8
Allocate 2 - free 8180
new_object_for_class: returning 9293616
New object for class 9
Allocate 2 - free 8178
new_object_for_class: returning 9293612
New object for class 10
Allocate 2 - free 8176
new_object_for_class: returning 9293608
New object for class 11
Allocate 2 - free 8174
new_object_for_class: returning 9293604
New object for class 12
Allocate 2 - free 8172
new_object_for_class: returning 9293600
New object for class 13
Allocate 2 - free 8170
new_object_for_class: returning 9293596
New object for class 14
Allocate 2 - free 8168
new_object_for_class: returning 9293592
New object for class 15
Allocate 2 - free 8166
new_object_for_class: returning 9293588
New object for class 4
Allocate 2 - free 8164
new_object_for_class: returning 9293584
New object for class 1
Allocate 18 - free 8146
new_object_for_class: returning 9293548
Created bootThread: 9293548. Initializing...
Setting intial priority to 5
New array of type 1, length 4
Allocate 82 - free 8064
Array ptr=9293384
New array of type 10, length 10
Allocate 22 - free 8042
Array ptr=9293340
Engine starting.
switching thread: 140
------ switch_thread: currentThread at 9293548
switchThread: current stack frame: 0
Checking state of thread 9293548(1)(s=2,p=5,i=-128,d=0)
Starting thread 9293548: 1

------ dispatch special - 0 ------------------

dispatch_special: 9274340, 0
-- signature id = 0
-- code offset  = 1695
-- flags        = 4
-- num params   = 1
-- stack ptr    = 9293344
-- max stack ptr= 9293384
pc set to 0x8D86AF
Found a non-daemon thread 9293548: 1(3)
switch_thread: done processing thread 9293548: 1
currentThread=9293548, ndr=1
Leaving switch_thread()
Current thread is 9293548: 1(3)
getting current stack frame...
updating registers...
done updating registers
done switching thread
0x8D86AF:
OPCODE (0x12) ldc
New object for class 2
Allocate 4 - free 8038
new_object_for_class: returning 9293332
New array of type 5, length 12
Allocate 14 - free 8024
Array ptr=9293304
0x8D86B1:
OPCODE (0xB8) invokestatic
dispatch_special_checked: 21, 1, 9275060, 9275057

------ dispatch special - 50 ------------------

dispatch_special: 9274436, 9275060
-- signature id = 50
-- code offset  = 0
-- flags        = 5
-- num params   = 1
-- stack ptr    = 9293352
-- max stack ptr= 9294368
-- native
Hello World!0x8D86B4:
OPCODE (0xB1) return

------ return ----- 0 ------------------

do_return: method: 0  #  num. words: 0
do_return: stack frame array size: 1
do_return: thread is done: 9293548
switching thread: 140
------ switch_thread: currentThread at 9293548
Tidying up DEAD thread 9293548: 1
Assertion violation: 37


As you can see, sometimes the jvm segfauls in the middle of a debug message, witch i have absolutly no explantion for.

Code: Select all

do_return: method: 55  #  num. words: 0
do_return: stack frame array size: 3
do_returSegmentation fault (core dumped)


The failure of the Casting test is obvious.


This little number cruching test https://github.com/michaelko/tvm/blob/master/regression/newtest/Collatz.java How ever does not excede any limitations of this jvm I know about, but it loops indefenitly.

I think all these have a common error source, at some point something is going wrong with memory management, but I don't know where. I would be realy thankfull if anyone could help. Here is my source repository, but besides two more native methods everything is original. https://github.com/michaelko/tvm

Mico

/edit, sorry i posted this into the wrong forum, it should have gone into the software forum.

Return to “RCX Projects”

Who is online

Users browsing this forum: No registered users and 1 guest