Crash with system.systemIDForName()

For test results, bug reports, announcements of new builds etc.

Moderators: winston, another_commander, Getafix

Post Reply
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Crash with system.systemIDForName()

Post by Eric Walch »

I was just playing with an experimental oxp and Oolite 1.72.2.1 crashed with the following crashlog :

Code: Select all

Thread 0 Crashed:
0   org.aegidian.oolite            	0x001803a4 JS_IsArrayObject + 4 (crt.c:355)
1   org.aegidian.oolite            	0x0005af7c +[NSString(OOJavaScriptExtensions) stringWithJavaScriptParameters:count:inContext:] + 252 (crt.c:355)
2   org.aegidian.oolite            	0x0005a1d0 OOReportJSBadArguments + 92 (crt.c:355)
3   org.aegidian.oolite            	0x000e90a8 SystemStaticSystemIDForName + 116 (crt.c:355)
4   org.aegidian.oolite            	0x001280e4 js_Invoke + 2080 (crt.c:355)
5   org.aegidian.oolite            	0x0012232c js_Interpret + 28376 (crt.c:355)
6   org.aegidian.oolite            	0x00128128 js_Invoke + 2148 (crt.c:355)
7   org.aegidian.oolite            	0x00128544 js_InternalInvoke + 204 (crt.c:355)
8   org.aegidian.oolite            	0x00180904 JS_CallFunction + 48 (crt.c:355)
9   org.aegidian.oolite            	0x0005cd14 -[OOJSScript doEvent:withArguments:] + 320 (crt.c:355)
10  org.aegidian.oolite            	0x00079128 -[PlayerEntity doWorldScriptEvent:withArguments:] + 76 (crt.c:355)
11  org.aegidian.oolite            	0x000790c8 -[PlayerEntity doScriptEvent:withArguments:] + 84 (crt.c:355)
12  org.aegidian.oolite            	0x000b5ad4 -[PlayerEntity(OOControlsPrivate) pollDemoControls:] + 1656 (crt.c:355)
13  org.aegidian.oolite            	0x000b5c60 -[PlayerEntity(OOControlsPrivate) pollDockedControls:] + 340 (crt.c:355)
14  org.aegidian.oolite            	0x000b53c0 -[PlayerEntity(Controls) pollControls:] + 264 (crt.c:355)
15  org.aegidian.oolite            	0x00075a68 -[PlayerEntity update:] + 184 (crt.c:355)
16  org.aegidian.oolite            	0x000386f0 -[Universe update:] + 1968 (crt.c:355)
17  org.aegidian.oolite            	0x0000eddc -[GameController doPerformGameTick] + 136 (crt.c:355)
Based on this log I tried typing in the console:

Code: Select all

system.systemIDForName(missionVariables.reserve_planetname);
And this line crashed the thing because the missionvariable was still undefined in my case. Oolite tried to log an error but this error was never written in my log.

(As a sidenote to Nemoricus:
Make sure the case statement in this.ReserveDutySystemDetermination = function(){} generates a default value for people like me that place objects in systems that were not planned.)
User avatar
Nemoricus
---- E L I T E ----
---- E L I T E ----
Posts: 388
Joined: Mon May 18, 2009 8:51 pm

Post by Nemoricus »

Oops. My bad, will fix.

Thanks for finding that, Eric.
Dream as if you'll live forever
Live as if you'll die tomorrow
Screet
---- E L I T E ----
---- E L I T E ----
Posts: 1883
Joined: Wed Dec 10, 2008 3:02 am
Location: Bremen, Germany

Post by Screet »

Nemoricus wrote:
Oops. My bad, will fix.
It shouldn't crash the game, but create an error message, thus it's also an oolite internal bug.

Screet
User avatar
Nemoricus
---- E L I T E ----
---- E L I T E ----
Posts: 388
Joined: Mon May 18, 2009 8:51 pm

Post by Nemoricus »

Screet wrote:
It shouldn't crash the game, but create an error message, thus it's also an oolite internal bug.

Screet
Indeed. But it's my bug that caused this to show up, so I need to fix that.

It's really simple to fix, too.
Dream as if you'll live forever
Live as if you'll die tomorrow
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6632
Joined: Wed Feb 28, 2007 7:54 am

Post by another_commander »

Heh. Already fiXx0red for 1.73.
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Post by Eric Walch »

Nemoricus wrote:
Indeed. But it's my bug that caused this to show up, so I need to fix that.

It's really simple to fix, too.
Not really a bug because the mission variable would never have been undefined when I had not added the station in a system that not was anticipated by the code. But when known its an easy fix to make the code fool proof at this point.
Post Reply