[webkit-dev] Writing a new interface, hit a snag

Michael Simms msimms9876 at googlemail.com
Wed Apr 22 02:58:48 PDT 2009


Greetings all...

I have spent the last few weeks writing what is effectively a null
interface, so I can use WebKit as a backend system for retrieving
webpages on a headless X11-less gtk-less machine.

This isnt for spamming, mail harvesting or other nefarious activities,
dont worry :-) It's so we can process certain requests from our
website so when people go there, it looks like an integrated system
instead of a half dozen disparate packages!

So, I have an issue that I have been pulling my hair out on for over a
week now, Ive been single stepping through code for days trying to
find what can cause this.

The entire null interface works fine, as long as Javascript is turned
off. It loads all the items it needs and I can access them. Great,
just what I needed. As soon as Javascript is turned on, it blows up.

Now, Ive been coding for a LONG time and Ive never seen an error from
gdb quite like this...

#0  0x00e6ee37 in ctiTrampoline ()
   from /home/michael/webkit_rejig/webkit/.libs/libwebkit-1.0.so.1
#1  0xb7fd4b40 in ?? ()
#2  0xbf8a7428 in ?? ()
#3  0x0056a4e0 in _dl_runtime_resolve () from /lib/ld-linux.so.2
#4  0x00eceeeb in JSC::CTI::execute (code=0xb7fbc300, registerFile=0xb7ff8da8,
    callFrame=0xb7c48024, globalData=0xb7f97100, exception=0xbf8a74f8)
    at JavaScriptCore/VM/CTI.h:352
#5  0x00eadc35 in JSC::Machine::execute (this=0xb7ff8d80,
    programNode=0xb7fd4b40, callFrame=0xb7fb8ac4, scopeChain=0xb7ffd108,
    thisObj=0xb7c30000, exception=0xbf8a74f8)
    at JavaScriptCore/VM/Machine.cpp:934
#6  0x00f2bd15 in JSC::Interpreter::evaluate (exec=0xb7fb8ac4,
    scopeChain=@0xb7fb8aa0, source=@0xbf8a7564, thisValue=0xb7c30000)
    at JavaScriptCore/runtime/Interpreter.cpp:68
#7  0x008ec0d1 in WebCore::ScriptController::evaluate (this=0xb7f97928,
    sourceURL=@0xbf8a777c, baseLine=1, str=@0xbf8a77ec)
    at WebCore/bindings/js/ScriptController.cpp:111
#8  0x00b3b006 in WebCore::FrameLoader::executeScript (this=0xb7f976a4,
    url=@0xbf8a777c, baseLine=1, script=@0xbf8a77ec)
    at WebCore/loader/FrameLoader.cpp:792
.... ( I dont think it is important what the outer 20 or so frames
are, but if you need them)...

So, it seems that it crashes while loading ctiTrampoline, but this is
an asm routine (I dont know asm) and so the error could be in the
call() that it makes within this function.

Now, I am assuming that the error is that I have stubbed or missed
something in the GTK handler when porting to the null handler. Some
initialisation call to something in the Javascript engine, I honestly
don't know. I am hoping that this mail reaches someone who knows the
js engine inside out and can say 'ohhh yeah thats cos you missed X'
and then I can go do X :-)

Crossed fingers

Michael


More information about the webkit-dev mailing list