GNOME Bugzilla – Bug 657228
Seed can't handle callbacks when seed engine uses a WebFrame's js Context
Last modified: 2011-08-31 04:47:42 UTC
The History and the details of the bug can be read from : http://mail.gnome.org/archives/libseed-list/2011-August/msg00007.html when we use the js context from webframe for seed_init, when we have a callback in the case of say :manager.prepare_async(obj, x_callback_cb, user_data). it never gets called back, and JSObjectCallAsFunction throws an exception : "RangeError Maximum call stack size exceeded. " So the the fix for this is attached with this bug report, it was solved by keeping the ctx of the webframe in SeedNativeClosurePrivate, and creating the new jscontext with JSGlobalContextCreateInGroup, using the same group as the js context given to us by the WebFrame. This patch made the telepathy application work with seedkit :). (demo : http://people.collabora.com/~siraj/demo/webkit/iphone_contact_list.ovg.ogv) So can you please review this :) ? (I'll publish the branch as my second comment) BR Siraj
r ? https://gitorious.org/~siraj/seed/sirajs-seed/commit/635aa9e2d6485b6219d3390570485108996d658d callback_fix branch
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.
I had to revert the patch, unfortunately it segfaulted on regular gtk application usage. It just segfaulted calling JSContextGetGroup(privates->ctx) I suspect either the ctx had been unreffed or was just not valid. The application it crashed is rather complex so finding the javascript code that triggers it is rather complicated. If you have time, I can send over instructions on how to replicate it. Regards Alan
ah I fixed this issue last night.. I was going to reopen this bug too, please check it with this patch. https://gitorious.org/~siraj/seed/sirajs-seed/commit/5a38247e4abe81ab0d1e907d0ae0d05ce46f7de0
(In reply to comment #3) > I had to revert the patch, unfortunately it segfaulted on regular gtk > application usage. > > It just segfaulted calling JSContextGetGroup(privates->ctx) > > I suspect either the ctx had been unreffed or was just not valid. > > The application it crashed is rather complex so finding the javascript code > that triggers it is rather complicated. If you have time, I can send over > instructions on how to replicate it. Yeah please send the app and the instructions, if the above patch doesn't fix it.. > > Regards > Alan
I've not tested, but it looks about right.