Bug 223051 - [BigSur wk1 arm64] platform/mac/fast/objc/longlongTest.html is a consistent failure
Summary: [BigSur wk1 arm64] platform/mac/fast/objc/longlongTest.html is a consistent f...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Mark Lam
URL:
Keywords: InRadar
: 223084 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-03-10 15:21 PST by Amir Mark Jr
Modified: 2021-03-11 16:56 PST (History)
5 users (show)

See Also:


Attachments
proposed patch. (2.50 KB, patch)
2021-03-11 13:20 PST, Mark Lam
cdumez: review+
Details | Formatted Diff | Diff
patch for landing. (2.53 KB, patch)
2021-03-11 13:28 PST, Mark Lam
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Amir Mark Jr 2021-03-10 15:21:28 PST
platform/mac/fast/objc/longlongTest.html

Is a consistent failure on Big Sur Wk1 Apple Silicon machines.

History:

https://results.webkit.org/?suite=layout-tests&test=platform%2Fmac%2Ffast%2Fobjc%2FlonglongTest.html

Diff:

--- /Volumes/Data/worker/bigsur-release-applesilicon-tests-wk1/build/layout-test-results/platform/mac/fast/objc/longlongTest-expected.txt
+++ /Volumes/Data/worker/bigsur-release-applesilicon-tests-wk1/build/layout-test-results/platform/mac/fast/objc/longlongTest-actual.txt
@@ -1,7 +1,7 @@
 PASS Test LongLong: result is 0 as expected!
 PASS Test LongLong: result is 1 as expected!
 PASS Test LongLong: result is -1 as expected!
-PASS Test LongLong: result is -9223372036854776000 as expected!
+FAIL Test LongLong: result is 9223372036854776000, should be -9223372036854776000
 PASS Test LongLong: result is -9223372036854776000 as expected!
 PASS Test UnsignedLongLong: result is 0 as expected!
 PASS Test UnsignedLongLong: result is 1 as expected!
Comment 1 Radar WebKit Bug Importer 2021-03-10 15:21:52 PST
<rdar://problem/75286103>
Comment 2 Amir Mark Jr 2021-03-10 15:23:45 PST
I cannot reproduce failure due to not having access to an Apple Silicon machine.
Comment 3 Chris Dumez 2021-03-10 20:38:07 PST
Similar to https://bugs.webkit.org/show_bug.cgi?id=223050, I will look tomorrow.
Comment 4 Mark Lam 2021-03-11 13:13:23 PST
*** Bug 223084 has been marked as a duplicate of this bug. ***
Comment 5 Mark Lam 2021-03-11 13:14:51 PST
The issue is that the test is expecting convertValueToObjcValue()'s conversion of double to long long to follow x86_64 semantics.  I don't think there's a specification for this behaviors (falls under undefined behavior).  I'll just change the code such that it emulates x86_64 behavior to placate the test.
Comment 6 Mark Lam 2021-03-11 13:20:12 PST
Created attachment 422959 [details]
proposed patch.
Comment 7 Yusuke Suzuki 2021-03-11 13:23:38 PST
Comment on attachment 422959 [details]
proposed patch.

View in context: https://bugs.webkit.org/attachment.cgi?id=422959&action=review

r=me too

> Source/WebCore/bridge/objc/objc_utility.mm:87
> +#if CPU(ARM64)
> +    // Match x86_64 semantics which allows for overflow.
> +    long long potentiallyOverflowed = (unsigned long long)d;
> +    if (potentiallyOverflowed < (long long)d)
> +        return potentiallyOverflowed;
> +#endif

Why not always using this path?
Comment 8 Mark Lam 2021-03-11 13:25:43 PST
(In reply to Yusuke Suzuki from comment #7)
> Comment on attachment 422959 [details]
> proposed patch.
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=422959&action=review
> 
> r=me too
> 
> > Source/WebCore/bridge/objc/objc_utility.mm:87
> > +#if CPU(ARM64)
> > +    // Match x86_64 semantics which allows for overflow.
> > +    long long potentiallyOverflowed = (unsigned long long)d;
> > +    if (potentiallyOverflowed < (long long)d)
> > +        return potentiallyOverflowed;
> > +#endif
> 
> Why not always using this path?

I guess I can make it do that.
Comment 9 Mark Lam 2021-03-11 13:28:38 PST
Created attachment 422961 [details]
patch for landing.
Comment 10 Mark Lam 2021-03-11 16:52:24 PST
Comment on attachment 422961 [details]
patch for landing.

Thanks for the reviews.  Landing now.
Comment 11 EWS 2021-03-11 16:56:32 PST
Committed r274313: <https://commits.webkit.org/r274313>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 422961 [details].