Note: There are a few cases of duplicates in user autocompletion which are being worked on.

Add JS shell compile flag for more determinism (differential testing/fuzzing)

RESOLVED FIXED in mozilla11

Status

()

Core
JavaScript Engine
--
enhancement
RESOLVED FIXED
6 years ago
5 years ago

People

(Reporter: decoder, Assigned: decoder)

Tracking

Trunk
mozilla11
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

6 years ago
Created attachment 577920 [details] [diff] [review]
Patch

In differential testing we usually compare the output of two shells running with different options (e.g. TI vs. Interp) and there are quite a few functions that behave differently under those options or even completely non-deterministic. While we can remove or wrap most of those functions at runtime, some obstacles remain.

The attached patch does two things: It makes gc() return an empty string (Jesse mentioned on IRC that wrapping gc() could cause problems) and it makes js_ReportOverRecursed print out a notice on stderr when it is called. The reason for that notice is to recognize when a test hits the recursion limit so we can ignore it, as the recursion limits across different options is not consistent.

Both modifications are not enabled unless the --enable-more-deterministic flag is passed at compile time.
Attachment #577920 - Flags: review?(jorendorff)
Comment on attachment 577920 [details] [diff] [review]
Patch

Review of attachment 577920 [details] [diff] [review]:
-----------------------------------------------------------------

r=me with the nit below.

::: js/src/shell/js.cpp
@@ +1212,5 @@
>  
>      char buf[256];
> +#ifdef JS_MORE_DETERMINISTIC
> +    JS_snprintf(buf, sizeof(buf), "");
> +#else

Just buf[0] = '\0'; here please.
Attachment #577920 - Flags: review?(jorendorff) → review+
(Assignee)

Comment 2

6 years ago
Created attachment 578429 [details] [diff] [review]
Updated patch

Updated patch to fix the nit. Jason, can you check this in?
Attachment #577920 - Attachment is obsolete: true
(Assignee)

Comment 3

6 years ago
Comment on attachment 578429 [details] [diff] [review]
Updated patch

r+ taken from first patch.
Attachment #578429 - Flags: review+
Landed on m-i:

http://hg.mozilla.org/integration/mozilla-inbound/rev/f0159088a7c3
https://hg.mozilla.org/mozilla-central/rev/f0159088a7c3
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla11

Updated

5 years ago
Blocks: 751700
You need to log in before you can comment on or make changes to this bug.