Closed
Bug 635417
Opened 15 years ago
Closed 15 years ago
Regular expression bug (breaks splinter patch review)
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
FIXED
| Tracking | Status | |
|---|---|---|
| blocking2.0 | --- | final+ |
People
(Reporter: otaylor, Assigned: dmandelin)
References
Details
(Keywords: regression, Whiteboard: [hardblocker][has patch][fixed-in-tracemonkey])
Attachments
(3 files, 1 obsolete file)
|
349 bytes,
text/html
|
Details | |
|
50.21 KB,
patch
|
Details | Diff | Splinter Review | |
|
9.13 KB,
patch
|
dvander
:
review+
|
Details | Diff | Splinter Review |
Tested with Feb 18 nightly build firefox-4.0b12pre.en-US.linux-x86_64 - the bug is at least a few week old, but don't know exactly when it started.
The regular expression:
/^@(A*)x(B)*/
does not match the string:
"@xB"
I'll attach an obvious HTML/JS test case. The above is pretty much minimal - if you remove either of the parentheses the problem goes away. If you change the @ to a letter like C the problem goes away (?!?!) - though $ also reproduces the problem.
Comment 1•15 years ago
|
||
cdleary LOVES HIM SOME REGEXP. boy howdy.
blocking2.0: --- → ?
Keywords: regression,
regressionwindow-wanted
| Assignee | ||
Comment 3•15 years ago
|
||
I got this regression window while waiting for a build:
http://hg.mozilla.org/mozilla-central/pushloghtml?startdate=2011-01-31&enddate=2011-02-01
It's probably bug 627609.
Blocks: 627609
| Assignee | ||
Updated•15 years ago
|
| Assignee | ||
Comment 4•15 years ago
|
||
The cause here is pretty simple: in our modified PCRE, we (try to) look at the op just before a bracket to see if it is OP_BRAZERO ("make the next bracket optional") and then "do stuff" based on that. It turns out that OP_BRAZERO == 64 == '@'--in this case, the position just before the first bracket is the character of the single-char match, not an actual opcode. We need to use a more robust way of tracking which brackets are supposed to be optional. I think we can put it in the BracketChainNode or something like that.
Taking, but cdleary should feel free to steal.
Assignee: general → dmandelin
Comment 5•15 years ago
|
||
PCRE die die die!
:-|.
/be
| Assignee | ||
Comment 6•15 years ago
|
||
This doesn't work yet. It correctly passes the minSatisfied value from OP_BRAZERO to the bracket op. But it doesn't get to the KET that matches that bracket. ISTR that this seemed tricky and motivated the original incorrect solution.
Updated•15 years ago
|
Whiteboard: hardblocker → [hardblocker][needs patch]
| Assignee | ||
Comment 7•15 years ago
|
||
This is proving fairly hard. I'm in the process of completely rewriting the empty-groups-handling logic. (That should sound somewhat scary but not too--probably less than 100 LOC.) ETA (median estimate) for patch ready for review is Thursday afternoon.
| Assignee | ||
Comment 8•15 years ago
|
||
Attachment #513678 -
Attachment is obsolete: true
Attachment #514674 -
Flags: review?(dvander)
| Assignee | ||
Updated•15 years ago
|
Whiteboard: [hardblocker][needs patch] → [hardblocker][has patch]
| Assignee | ||
Comment 9•15 years ago
|
||
I'm seeing some failures on xpcshell and mochitest-(browser-)chrome, so probably not quite done yet.
Updated•15 years ago
|
Whiteboard: [hardblocker][has patch] → [hardblocker]
| Assignee | ||
Comment 10•15 years ago
|
||
This patch fixes the problem in this bug without fully overhauling the min-sat propagation logic. This is probably a better bet than the previous patch: the previous patch may fix some bugs we don't know about yet, but they are probably pretty subtle, and that patch has higher risk.
Attachment #514947 -
Flags: review?(dvander)
Updated•15 years ago
|
Attachment #514947 -
Flags: review?(dvander) → review+
Updated•15 years ago
|
Whiteboard: [hardblocker] → [hardblocker][has patch]
| Assignee | ||
Updated•15 years ago
|
Attachment #514674 -
Flags: review?(dvander)
| Assignee | ||
Comment 11•15 years ago
|
||
Whiteboard: [hardblocker][has patch] → [hardblocker][has patch][fixed-in-tracemonkey]
Comment 12•15 years ago
|
||
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•