Subj : Re: JS_InitClass segfaults in my JS/Python bridge To : netscape.public.mozilla.jseng From : jjl@pobox.com (John J. Lee) Date : Sat Aug 02 2003 01:55 pm Brendan Eich writes: > John J. Lee wrote: > > jjl@pobox.com (John J. Lee) writes: > > Not sure this is much help, but here's a traceback (not sure what that > > ?? is, either): > > (gdb) bt > > #0 0x081f7598 in ?? () > > #1 0x4040da5a in JS_InitClass (cx=0x81d6248, obj=0x81f6b40, parent_proto=0x81f6b40, clasp=0x8202500, > > constructor=0x403dc0f8 <__pyx_f_12spidermonkey_constructor_stub>, nargs=0, ps=0x0, fs=0x0, static_ps=0x0, static_fs=0x0) at jsapi.c:1828 > > Stacks are good, but in this case some more info is needed: what is > *clasp? Can you run under gdb and stop on line 1828 in jsapi.c? If [...] D'Oh! (gdb) p *clasp $1 = {name = 0x82041b8 "Node", flags = 0, addProperty = 0x4040d9a4 , delProperty = 0x4040d9a4 , getProperty = 0x4040d9a4 , setProperty = 0x4040d9a4 , enumerate = 0x4040d9b4 , resolve = 0x4040d9c4 , convert = 0x4040d9d4 , finalize = 0x4040d9fc , getObjectOps = 0x81f7598, checkAccess = 0x81f75a8, call = 0x81f75b8, construct = 0x81f75c8, xdrObject = 0x81f75d8, hasInstance = 0x81f75e8, mark = 0x81f75f8, spare = 136279560} (gdb) Pyrex doesn't have an aggregate initialisation syntax, and I forgot to explicitly set those pointers to NULL. Sorry, I'm a moron. Thanks! > How did you build RC5? Hmm, re-reading the build instructions, I'm not sure what this means: | NOTE: Do not attempt to use Makefile to build the standalone | JavaScript engine. This file is used only for building the JS-engine | in the Mozilla browser. Does that mean I was wrong to build it this way? make -f Makefile.ref (with GNU make) It seemed to work OK... John .