GNOME Bugzilla – Bug 678908
Do not call priv_from_js from the GObject tracer
Last modified: 2012-07-05 14:12:17 UTC
priv_from_js calls JS_BeginRequest when it refers to a dynamic JSClass (such as that used by GObjects), and that causes a deadlock when called from the GC thread
Created attachment 217312 [details] [review] Do not call priv_from_js from the GObject tracer
Is this a regression introduced by 06aa616a8c9b6d356aefc95a6b0c1c317b86c46a ?
(Sorry I didn't answer before, I overlooked this) Yes, this is a regression caused by that. A better fix, as discussed in IRC with Jasper, is to rework the dynamic JS class system to avoid the JS_BeginRequest completely, but that's a tad more invasive. I don't know if he is working on it.
I am not.
Review of attachment 217312 [details] [review]: This patch looks OK. I'm a little unsure about the previous patch; it *sounds* right and I don't see anything wrong in the code, but I still have this feeling that there are corner cases we aren't considering. Oh well, let's go with it =)
Review of attachment 217312 [details] [review]: I talked to the Mozilla guys, though. They pretty much said that the only JSAPI call you can make safely from the GC thread is JS_GetPrivate. JS_BeginRequest/JS_EndRequest are out.
(In reply to comment #4) > I am not. Ok. I started some clean up myself in the meanwhile, because I want to make the GC much more aggressive than it is now, in order to reduce memory footprint of gjs apps (125MB and growing for gnome-documents... 150MB, without loading appsystem and icons, for gnome-shell...). I'll open a new bug when the series is complete.
Attachment 217312 [details] pushed as 54d60c2 - Do not call priv_from_js from the GObject tracer