In case anyone else tries to build recent oolite against their own libjs and sees a segfault on startup, here's my diagnosis.
This might be due to libjs being built with JS_THREADSAFE, which adds a JSContext * arg to the JS_GetClass function - and oolite doesn't supply this. The remedy is to build libjs without JS_THREADSAFE. The packman libjs1, libjs-devel rpms available for openSUSE do define JS_THREADSAFE.
Sample stderr:
Code: Select all
2008-02-13 10:35:19.191 oolite.debug[10401] [dataCache.notFound]: No data cache found, starting from scratch.
2008-02-13 10:35:19.192 oolite.debug[10401] Failed to recurse into directory 'AddOns' - No such file or directory
2008-02-13 10:35:19.193 oolite.debug[10401] Failed to recurse into directory '/home/will/.Oolite/AddOns' - No such file or directory
2008-02-13 10:35:19.193 oolite.debug[10401] [searchPaths.dumpAll]: ---> OXP search paths:
("/home/will/code/oolite-dev-source-1.70/oolite.debug.app/Resources", AddOns, "/home/will/.Oolite/AddOns")
[New Thread 0x4108a950 (LWP 10405)]
Program received signal SIGSEGV, Segmentation fault.
Code: Select all
[Switching to Thread 0x2ba8fbedcf70 (LWP 10401)]
JS_GetClass (cx=0x1678ee0, obj=0x36c) at jsapi.c:2251
2251 return (JSClass *)
Current language: auto; currently c
(gdb) bt
#0 JS_GetClass (cx=0x1678ee0, obj=0x36c) at jsapi.c:2251
#1 0x000000000057b678 in RegisterStandardObjectConverters (context=0x1673780)
at src/Core/Scripting/OOJavaScriptEngine.m:1201
#2 0x0000000000578458 in -[OOJavaScriptEngine init] (self=0x166a400, _cmd=0x87c0e0)
at src/Core/Scripting/OOJavaScriptEngine.m:200
#3 0x0000000000578223 in +[OOJavaScriptEngine sharedEngine] (self=0x87bfc0, _cmd=0x879f30)
at src/Core/Scripting/OOJavaScriptEngine.m:140
#4 0x0000000000575e23 in -[OOJSScript initWithPath:properties:] (self=0x16690e0, _cmd=0x879f00,
path=0x16686c0, properties=0x0) at src/Core/Scripting/OOJSScript.m:126
#5 0x0000000000575d15 in +[OOJSScript scriptWithPath:properties:] (self=0x879e60, _cmd=0x8788d0,
path=0x16686c0, properties=0x0) at src/Core/Scripting/OOJSScript.m:108
#6 0x000000000057535f in +[OOScript scriptsFromFileAtPath:] (self=0x878800, _cmd=0x878930,
filePath=0x16686c0) at src/Core/Scripting/OOScript.m:173
#7 0x0000000000574fb3 in +[OOScript scriptsFromFileNamed:] (self=0x878800, _cmd=0x878960,
fileName=0x15b6770) at src/Core/Scripting/OOScript.m:135
#8 0x000000000057514f in +[OOScript scriptsFromList:] (self=0x878800, _cmd=0x8788b0, fileNames=0x15b6650)
at src/Core/Scripting/OOScript.m:155
#9 0x0000000000574a02 in +[OOScript worldScriptsAtPath:] (self=0x878800, _cmd=0x843fd0, path=0x15b65a0)
at src/Core/Scripting/OOScript.m:65
#10 0x00000000004b2e5e in +[ResourceManager loadScripts] (self=0x843b00, _cmd=0x840ee0)
at src/Core/ResourceManager.m:704
#11 0x000000000048bbcf in -[PlayerEntity init] (self=0xf30230, _cmd=0x85ffc0)
at src/Core/Entities/PlayerEntity.m:805
#12 0x0000000000503bb3 in -[Universe initWithGameView:] (self=0xc79bd0, _cmd=0x81ba60, inGameView=0xa3e640)
at src/Core/Universe.m:237
#13 0x000000000041f303 in -[GameController applicationDidFinishLaunching:] (self=0xa51ce0, _cmd=0x820b90,
notification=0x0) at src/Core/GameController.m:227
#14 0x0000000000438bba in main (argc=1, argv=0x7fffb522aef8) at src/SDL/main.m:88
Code: Select all
(gdb) l
2246
2247 #ifdef JS_THREADSAFE
2248 JS_PUBLIC_API(JSClass *)
2249 JS_GetClass(JSContext *cx, JSObject *obj)
2250 {
2251 return (JSClass *)
2252 JSVAL_TO_PRIVATE(GC_AWARE_GET_SLOT(cx, obj, JSSLOT_CLASS));
2253 }
2254 #else
2255 JS_PUBLIC_API(JSClass *)