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 703068 - Fixes for running with a debug SpiderMonkey build
Fixes for running with a debug SpiderMonkey build
Status: RESOLVED FIXED
Product: gjs
Classification: Bindings
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gjs-maint
gjs-maint
Depends on:
Blocks:
 
 
Reported: 2013-06-25 16:40 UTC by Jasper St. Pierre (not reading bugmail)
Modified: 2013-07-19 19:57 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
context: Add missing BeginRequest / EndRequest (905 bytes, patch)
2013-06-25 16:40 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
util: Use JS reserved slots for our global slots (3.02 KB, patch)
2013-06-25 16:40 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
stack: Add missing BeginRequest / EndRequest (1.74 KB, patch)
2013-06-25 16:40 UTC, Jasper St. Pierre (not reading bugmail)
reviewed Details | Review
keep-alive: Fix an unpaired BeginRequest / EndRequest (1.23 KB, patch)
2013-06-25 16:40 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
function: Fix a memory leak and simplify code (1.18 KB, patch)
2013-06-25 16:40 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
context: Make sure to quit early when logError() is given incorrect args (1.01 KB, patch)
2013-06-25 16:40 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
util: Seal up a missing EndRequest (635 bytes, patch)
2013-06-25 16:40 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review

Description Jasper St. Pierre (not reading bugmail) 2013-06-25 16:40:03 UTC
This gets the gjs testsuite to pass with a debug mozjs17.
Comment 1 Jasper St. Pierre (not reading bugmail) 2013-06-25 16:40:06 UTC
Created attachment 247749 [details] [review]
context: Add missing BeginRequest / EndRequest
Comment 2 Jasper St. Pierre (not reading bugmail) 2013-06-25 16:40:09 UTC
Created attachment 247750 [details] [review]
util: Use JS reserved slots for our global slots

The JS object doesn't technically allow globals with privates,
so we need to use the reserved slot system.
Comment 3 Jasper St. Pierre (not reading bugmail) 2013-06-25 16:40:11 UTC
Created attachment 247751 [details] [review]
stack: Add missing BeginRequest / EndRequest
Comment 4 Jasper St. Pierre (not reading bugmail) 2013-06-25 16:40:14 UTC
Created attachment 247752 [details] [review]
keep-alive: Fix an unpaired BeginRequest / EndRequest

And fix an atrociously bad cast error.
Comment 5 Jasper St. Pierre (not reading bugmail) 2013-06-25 16:40:17 UTC
Created attachment 247753 [details] [review]
function: Fix a memory leak and simplify code
Comment 6 Jasper St. Pierre (not reading bugmail) 2013-06-25 16:40:21 UTC
Created attachment 247754 [details] [review]
context: Make sure to quit early when logError() is given incorrect args
Comment 7 Jasper St. Pierre (not reading bugmail) 2013-06-25 16:40:24 UTC
Created attachment 247755 [details] [review]
util: Seal up a missing EndRequest
Comment 8 Colin Walters 2013-06-25 19:20:58 UTC
Review of attachment 247749 [details] [review]:

With stuff like this it tends to be a bit of an open question whether we should require callers to do it, but eh, this is fine.
Comment 9 Colin Walters 2013-06-25 19:28:06 UTC
Review of attachment 247750 [details] [review]:

The global slots API is a bit funky.  This looks right though, and is clearly a code improvement.
Comment 10 Colin Walters 2013-06-25 19:31:29 UTC
Review of attachment 247751 [details] [review]:

::: gjs/stack.c
@@ +64,3 @@
         !JSVAL_IS_OBJECT(v_constructor)) {
         g_error("??? Missing Error constructor in global object?");
+        goto out;

This one should just be g_assert_not_reached() or something, since g_error() won't actually return in the default configuration, and if we hit it we won't need the error message.

I've never found g_error() to be a super useful API myself, since without the __attribute__((noreturn)) it's annoying to use, as you have to placate GCC for conditions that won't actually be reached.
Comment 11 Colin Walters 2013-06-25 19:32:04 UTC
Review of attachment 247752 [details] [review]:

Right.
Comment 12 Colin Walters 2013-06-25 19:33:07 UTC
Review of attachment 247753 [details] [review]:

::: gi/function.c
@@ +1648,2 @@
                            GJS_MODULE_PROP_FLAGS)) {
         gjs_debug(GJS_DEBUG_GFUNCTION, "Failed to define function");

Need function = NULL here.
Comment 13 Colin Walters 2013-06-25 19:35:39 UTC
Review of attachment 247754 [details] [review]:

Ok.
Comment 14 Colin Walters 2013-06-25 19:36:43 UTC
Review of attachment 247755 [details] [review]:

Ouch, yes, looks right.
Comment 15 Jasper St. Pierre (not reading bugmail) 2013-06-25 19:40:52 UTC
Attachment 247749 [details] pushed as c505967 - context: Add missing BeginRequest / EndRequest
Attachment 247750 [details] pushed as 7d19f28 - util: Use JS reserved slots for our global slots
Attachment 247752 [details] pushed as b99e504 - keep-alive: Fix an unpaired BeginRequest / EndRequest
Attachment 247753 [details] pushed as e5abda7 - function: Fix a memory leak and simplify code
Attachment 247754 [details] pushed as ef2b134 - context: Make sure to quit early when logError() is given incorrect args
Attachment 247755 [details] pushed as 028c696 - util: Seal up a missing EndRequest


Pushed with suggested fixes, and removed the stack patch. I confused
g_error with g_critical and thought it would continue onward. It wasn't
really fixing anything, it's just something I looked into while trying
to find the missing EndRequest.
Comment 16 Jasper St. Pierre (not reading bugmail) 2013-07-19 19:57:15 UTC
Don't know why this was left open.