After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 657228 - Seed can't handle callbacks when seed engine uses a WebFrame's js Context
Seed can't handle callbacks when seed engine uses a WebFrame's js Context
Status: RESOLVED FIXED
Product: seed
Classification: Bindings
Component: libseed
git master
Other Linux
: Normal normal
: ---
Assigned To: seed-maint
Depends on:
Blocks:
 
 
Reported: 2011-08-24 11:21 UTC by Siraj Razick
Modified: 2011-08-31 04:47 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Siraj Razick 2011-08-24 11:21:40 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
Comment 2 Alan Knowles 2011-08-26 04:03:25 UTC
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.
Comment 3 Alan Knowles 2011-08-31 02:04:08 UTC
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
Comment 4 Siraj Razick 2011-08-31 03:09:40 UTC
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
Comment 5 Siraj Razick 2011-08-31 03:11:34 UTC
(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
Comment 6 Alan Knowles 2011-08-31 04:47:42 UTC
I've not tested, but it looks about right.