Closed Bug 1132128 Opened 9 years ago Closed 9 years ago

Global RegExp loop overload

Categories

(Core :: JavaScript Engine: JIT, defect)

35 Branch
x86_64
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla38
Tracking Status
firefox35 --- wontfix
firefox36 --- fixed
firefox37 --- fixed
firefox38 --- fixed
firefox39 --- fixed

People

(Reporter: robin87masters, Assigned: nbp)

References

Details

(Keywords: regression)

Attachments

(2 files)

Attached file Example
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.35 Safari/537.36 OPR/28.0.1750.15 (Edition beta)

Steps to reproduce:

Bug report by Robin Masters (software engineer for Ranshuijsen van Loon, The Netherlands)

Run the attached Example without opening Firebug



Actual results:

Using the RegExp global in a long iteration results in mismatched. At some point RegExp global does not get updated anymore and same results are returned.
http://i.imgur.com/8KO95T5.png

NOTE:
When Firebug is opened this problem doesn't occur:  http://i.imgur.com/EX6ph5d.png



Expected results:

No matches found.
Firebug disables AFAIK the jit and I can confirm that running Firefox in the safemode (=disabled jit) also "fixes" the behavior.

Last good revision: 2f198e81ed98
First bad revision: 18f408a5984e
Pushlog:
https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=2f198e81ed98&tochange=18f408a5984e
Status: UNCONFIRMED → NEW
Component: Untriaged → JavaScript Engine: JIT
Ever confirmed: true
Keywords: regression
Product: Firefox → Core
There are two Regexp-related landings in that regression window for bug 1038592. Needinfo'ing nbp as he reviewed them.
Flags: needinfo?(nicolas.b.pierron)
Simplified shell test case, run with "--ion-eager --ion-offthread-compile=off":
---
for (var i = 0; i < 100; i++) { 
  callRegExpTest(i);
}

function callRegExpTest(i) {
  var s = "" + i;
  var re = /(\d+)/;
  re.test(s);
  assertEq(RegExp.$1, s);
}
---
I will look at this issue in 2 weeks.
(In reply to Nicolas B. Pierron [:nbp] from comment #5)
> I will look at this issue in 2 weeks.

For now can we just make canRecoverOnBailout() return false for the MRegExp* instructions? It's a pretty bad correctness bug that affects real-world code.

We're likely already too late to get a patch approved for beta though...
(In reply to Jan de Mooij [:jandem] from comment #6)
> (In reply to Nicolas B. Pierron [:nbp] from comment #5)
> > I will look at this issue in 2 weeks.
> 
> For now can we just make canRecoverOnBailout() return false for the MRegExp*
> instructions?

r=me for the work-around, but leave this bug opened with the ni?.
Flags: needinfo?(nicolas.b.pierron)
(In reply to Nicolas B. Pierron [:nbp] from comment #7)
> r=me for the work-around, but leave this bug opened with the ni?.

https://hg.mozilla.org/integration/mozilla-inbound/rev/4b118b959ffd
Flags: needinfo?(nicolas.b.pierron)
Keywords: leave-open
Attached patch WorkaroundSplinter Review
Approval Request Comment
[Feature/regressing bug #]: Bug 1038592.
[User impact if declined]: Correctness bugs, broken websites.
[Describe test coverage new/current, TreeHerder]: Patch is on m-i; fixes the test.
[Risks and why]: No risk, just disables a feature for now.
[String/UUID change made/needed]: None.
Attachment #8565173 - Flags: review+
Attachment #8565173 - Flags: approval-mozilla-beta?
Attachment #8565173 - Flags: approval-mozilla-aurora?
Attachment #8565173 - Flags: approval-mozilla-beta?
Attachment #8565173 - Flags: approval-mozilla-beta+
Attachment #8565173 - Flags: approval-mozilla-aurora?
Attachment #8565173 - Flags: approval-mozilla-aurora+
Calling Fx38 fixed via the workaround landing on it too, but feel free to set it back to affected if you intend to uplift the real fix as well.
Assignee: nobody → nicolas.b.pierron
Keywords: leave-open
(In reply to Ryan VanderMeulen [:RyanVM UTC-5] from comment #12)
> Calling Fx38 fixed via the workaround landing on it too, but feel free to
> set it back to affected if you intend to uplift the real fix as well.

Just read the backlog, I will just close this bug and open a follow-up.
Thanks.
Status: NEW → RESOLVED
Closed: 9 years ago
Flags: needinfo?(nicolas.b.pierron)
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
Blocks: 1141645
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: