Oolite revision 1315 segmentation faults in shipyard

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

Moderators: winston, another_commander, Getafix

Post Reply
User avatar
Influence D
Above Average
Above Average
Posts: 23
Joined: Wed Jan 16, 2008 10:44 am
Location: Mooooooon

Oolite revision 1315 segmentation faults in shipyard

Post by Influence D »

And by 'in' I mean when I press 3 twice, but only when there are ships for sale - if I run from a console I don't see any errors before it bombs out (and nothing gets written to stderr.txt):
2008-01-19 09:00:47.811 oolite[28187] don't know how to load entity 'http://www.apple.com/DTDs/PropertyList-1.0.dtd' id '-//Apple Computer//DTD PLIST 1.0//EN'
.:3: validity error : Validation failed: no DTD found !
<plist version="1.0">
^
2008-01-19 09:00:47.823 oolite[28187] [unclassified.MyOpenGLView]: initialising SDL
2008-01-19 09:00:47.923 oolite[28187] [unclassified.JoystickHandler]: init: numSticks=0
2008-01-19 09:00:47.924 oolite[28187] [unclassified.MyOpenGLView]: CREATING MODE LIST
2008-01-19 09:00:48.035 oolite[28187] [unclassified.MyOpenGLView]: drawRect calling initialiseGLWithSize
2008-01-19 09:00:48.035 oolite[28187] [unclassified.MyOpenGLView]: Creating a new surface of 1280 x 1024
2008-01-19 09:00:48.038 oolite[28187] [unclassified.MyOpenGLView]: no universe, clearning surface
2008-01-19 09:00:48.038 oolite[28187] [cpuInfo.cpuCount]: 0 processors detected.
2008-01-19 09:00:48.061 oolite[28187] [rendering.opengl.version]: OpenGL renderer version: 1.2.0 ("1.2 (2.0.6473 (8.37.6))")
Vendor: ATI Technologies Inc.
Renderer: Radeon X300/X550/X1050 Series
2008-01-19 09:00:48.063 oolite[28187] [rendering.opengl.extensions]: OpenGL extensions (16):
GL_ARB_multitexture GL_ARB_texture_border_clamp GL_ARB_texture_cube_map GL_ARB_texture_env_add GL_ARB_texture_env_combine GL_ARB_texture_env_dot3 GL_ARB_transpose_matrix GL_EXT_abgr GL_EXT_blend_color GL_EXT_blend_minmax GL_EXT_blend_subtract GL_EXT_texture_env_add GL_EXT_texture_env_combine GL_EXT_texture_env_dot3 GL_EXT_texture_lod_bias
2008-01-19 09:00:48.064 oolite[28187] [rendering.opengl.shader.support]: Shaders will not be used (OpenGL extension GL_ARB_shader_objects is not available).
2008-01-19 09:00:48.094 oolite[28187] [dataCache.found]: Found data cache.
2008-01-19 09:00:48.096 oolite[28187] Failed to recurse into directory 'AddOns' - No such file or directory
2008-01-19 09:00:48.097 oolite[28187] [searchPaths.dumpAll]: ---> OXP search paths:
("/home/influence/src/oolite-svn/trunk/oolite.app/Resources", AddOns, "/home/influence/.Oolite/AddOns")
2008-01-19 09:00:48.098 oolite[28187] [dataCache.upToDate]: Data cache is up to date.
2008-01-19 09:00:48.590 oolite[28187] [script.javaScript.context.create]: Creating JS context.
2008-01-19 09:00:48.591 oolite[28187] [script.javaScript.context.create]: Creating JS context.
2008-01-19 09:00:48.592 oolite[28187] [script.load.world.listAll]: Loaded 5 world scripts: "oolite-cloaking-device" 1.71, "oolite-constrictor-hunt" 1.71, "oolite-nova" 1.71, "oolite-thargoid-plans" 1.71, "oolite-trumbles" 1.71
2008-01-19 09:00:49.213 oolite[28187] [dataCache.willWrite]: About to write data cache.
2008-01-19 09:00:49.232 oolite[28187] [dataCache.write.success]: Wrote data cache.
Segmentation fault
Not much to see there, really. This happens both if I load old (1.70) saves and if I start a new game and go straight to a high-tech world like Zaonce, where there will likely be ships available... the game itself runs fine.

I'm running 64-bit Ubuntu 7.10, and I built from svn in the same way I built the 1.70 source, which doesn't have this problem. I disabled all my OXPs, but it doesn't make any difference :(

I've sent an email to oolite.bug.reports, but can anyone think of anything I can do to help track this down further? I've not really got the free time to learn the entire codebase from scratch right now, so any suggestions would be deeply appreciated.
User avatar
Influence D
Above Average
Above Average
Posts: 23
Joined: Wed Jan 16, 2008 10:44 am
Location: Mooooooon

Post by Influence D »

slight twist - if I load a savegame and go to the shipyard when there are no ships available (which works), then load one where there ARE ships available, it doesn't crash and the shipyard works fine - that makes me suspect that it's something not getting initialised.
User avatar
Influence D
Above Average
Above Average
Posts: 23
Joined: Wed Jan 16, 2008 10:44 am
Location: Mooooooon

Post by Influence D »

and here's the backtrace of the stack at crash time:
(gdb) bt
#0 0x00002b46e7c0be3d in objc_msg_lookup () from /usr/lib/libobjc.so.1
#1 0x00002b46e76bd2fc in GSFormat () from /usr/lib/libgnustep-base.so.1.13
#2 0x00002b46e76d27c7 in ?? () from /usr/lib/libgnustep-base.so.1.13
#3 0x00000000004e1218 in -[Universe shipsForSaleForSystem:withTL:atTime:] (self=0xbddff0, _cmd=<value optimized out>, s_seed=
{a = 106 'j', b = 82 'R', c = 124 '|', d = 47 '/', e = 155 '\233', f = 190 '�'}, specialTL=12, current_time=180060977937.13666)
at src/Core/Universe.m:7001
#4 0x00000000004668d7 in -[PlayerEntity(Contracts) setGuiToShipyardScreen:] (self=0x102f620, _cmd=<value optimized out>, skip=0)
at src/Core/Entities/PlayerEntityContracts.m:1114
#5 0x000000000046fe52 in -[PlayerEntity(OOControlsPrivate) pollGuiScreenControls] (self=0x102f620, _cmd=<value optimized out>)
at src/Core/Entities/PlayerEntityControls.m:2446
#6 0x000000000047041c in -[PlayerEntity(OOControlsPrivate) pollDockedControls:] (self=0x102f620, _cmd=<value optimized out>, delta_t=0.0080499947071075439)
at src/Core/Entities/PlayerEntityControls.m:2614
#7 0x00000000004674e3 in -[PlayerEntity(Controls) pollControls:] (self=0x102f620, _cmd=<value optimized out>, delta_t=0.0080499947071075439)
at src/Core/Entities/PlayerEntityControls.m:258
#8 0x000000000048ad0c in -[PlayerEntity update:] (self=0x102f620, _cmd=<value optimized out>, delta_t=0.0080499947071075439)
at src/Core/Entities/PlayerEntity.m:1467
#9 0x00000000004db700 in -[Universe update:] (self=0xbddff0, _cmd=<value optimized out>, delta_t=0.0080499947071075439) at src/Core/Universe.m:5140
#10 0x000000000042b698 in -[GameController doPerformGameTick] (self=0xb118d0, _cmd=<value optimized out>) at src/Core/GameController.m:304
#11 0x000000000042ad73 in -[GameController performGameTick:] (self=0xb118d0, _cmd=<value optimized out>, sender=<value optimized out>)
at src/Core/GameController.m:283
#12 0x00002b46e77cac59 in ?? () from /usr/lib/libgnustep-base.so.1.13
#13 0x00002b46e77a5e58 in ?? () from /usr/lib/libgnustep-base.so.1.13
#14 0x00002b46e77a4442 in ?? () from /usr/lib/libgnustep-base.so.1.13
#15 0x00002b46e77a4330 in ?? () from /usr/lib/libgnustep-base.so.1.13
#16 0x000000000042b544 in -[GameController applicationDidFinishLaunching:] (self=0xb118d0, _cmd=<value optimized out>, notification=<value optimized out>)
at src/Core/GameController.m:246
#17 0x000000000043e847 in main (argc=1, argv=0x7fffc44c7b18) at src/SDL/main.m:88

which makes the guilty line (in Universe.m):
if (passenger_berths)
{
NSString* npb = (passenger_berths > 1)? [NSString stringWithFormat:@"%d ", passenger_berths] : @"";
NSString* ppb = (passenger_berths > 1)? DESC(@"passenger-berth-plural") : DESC(@"passenger-berth-single");
[description appendFormat:@"Extra %@%@ (%@)", npb, ppb, passengerBerthLongDesc];
[short_description appendFormat:@"Extra %@%@."];
}
which is clearly trying to append non-specified parameters to the short_description.
Based on my reading of the 1.70 code, I presume that npb and ppb are the missing parameters, which would mean that the line should read

Code: Select all

				[short_description appendFormat:@"Extra %@%@.",npb, ppb];
I'm just going out to buy some beer, and I'll test that when I come back :)
Last edited by Influence D on Sun Jan 20, 2008 12:21 am, edited 2 times in total.
User avatar
Influence D
Above Average
Above Average
Posts: 23
Joined: Wed Jan 16, 2008 10:44 am
Location: Mooooooon

Post by Influence D »

yep, that seems to have done the trick...
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6628
Joined: Wed Feb 28, 2007 7:54 am

Post by another_commander »

Good job Influence D. Fix has gone in Revision 1317.
Post Reply