New issue
Advanced search Search tips

Issue 695416 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Feb 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 1
Type: Bug



Sign in to add a comment

Different results of RegExp.p[@@match] on x64 and arm

Project Member Reported by ClusterFuzz, Feb 23 2017

Issue description

Cc: mstarzinger@chromium.org yangguo@chromium.org jgruber@chromium.org
Status: Available (was: Untriaged)
// PTAL regexp experts. What's up with this? x64 vs arm:

print("abcdefghijklmnabcdefghijklmn".substr(1).match(/(?=(abcdefghijklmn))(?<=\1)a/));

// Output:
# Compared x64,ignition with arm,ignition
#
# Flags of x64,ignition:
--abort_on_stack_overflow --expose-gc --allow-natives-syntax --invoke-weak-callbacks --omit-quit --es-staging --random-seed 1234 --ignition --turbo-filter=~ --hydrogen-filter=~ --validate-asm --nocrankshaft
# Flags of arm,ignition:
--abort_on_stack_overflow --expose-gc --allow-natives-syntax --invoke-weak-callbacks --omit-quit --es-staging --random-seed 1234 --ignition --turbo-filter=~ --hydrogen-filter=~ --validate-asm --nocrankshaft
#
# Difference:
- null
+ a,abcdefghijklmn
#
### Start of configuration x64,ignition:
null

### End of configuration x64,ignition
#
### Start of configuration arm,ignition:
a,abcdefghijklmn

### End of configuration arm,ignition

Cc: -jgruber@chromium.org
Owner: jgruber@chromium.org
Status: Assigned (was: Available)
Looks like a bug. Currently a bit swamped but I can take a look next week.
Summary: Different results of RegExp.p[@@match] on x64 and arm (was: V8 correctness failure in configs: x64,ignition:arm,ignition)

Comment 4 Deleted

My speculation is that on ARM, the regexp exec stub incorrectly unpacks the sliced string produced by substr.
Cc: jgruber@chromium.org
Owner: yangguo@chromium.org
Shorter repro:

var s = "abcdefgabcdef".substr(1);
print(s.match(/(?=(abcdefg))(?<=\1)/));

The string has to be a true sliced string, as in, longer than 13 characters. The lookbehind is probably reading out of bound on ARM. I'll take a look.
One character fix incoming.

Correctness fuzzer is awesome. I had a similar test for this issue in place, but it did not find this particular edge case.
Status: Fixed (was: Assigned)
Does this require merging back?
no. experimental feature is experimental :)
Project Member

Comment 12 by ClusterFuzz, Feb 27 2017

ClusterFuzz has detected this issue as fixed in range 43434:43435.

Detailed report: https://cluster-fuzz.appspot.com/testcase?key=5280203153866752

Fuzzer: foozzie_js_mutation
Job Type: v8_foozzie
Platform Id: linux

Crash Type: V8 correctness failure
Crash Address: 
Crash State:
  configs: x64,ignition:arm,ignition
  sources: a8f
  
Sanitizer: address (ASAN)

Regressed: V8: 43152:43153
Fixed: V8: 43434:43435

Reproducer Testcase: https://cluster-fuzz.appspot.com/download/AMIfv96YgSCeE6vh8nLlAg6LhB5oTdZgjO8MsjSukvjS_2nByKV0CoJpxohYfpFXJCNe-TtmC_pH0_Yh4hK1n-_3eFIfS7b42xPfp7DxRIMp079qnI2g1fkEBcaetEyYkQnvZ2y8alncW-D8E2ioYGCoBC8-yS2Dx3d3Le-k9Fns2ijNmfGAYgaiwv8hd5Yb-yPB1X-8y_neozALXB6nJ85DvBmHqe0U-wOxbk5vwpD9qx3rq1wz_jWiwYOBSjXD2QW7QGmVqrIFwpMCWXq4Kqw1m3Q26onyG2VXSLQ_YMR6HI7u2vHBahtce-GhZxOrEdXKhx0qx47bD6ZYMRb5KKFDpJLYhhm1Use8nd2KXBMpvs1z3vrRmN0?testcase_id=5280203153866752


See https://dev.chromium.org/Home/chromium-security/bugs/reproducing-clusterfuzz-bugs for more information.

If you suspect that the result above is incorrect, try re-doing that job on the test case report page.

Sign in to add a comment