Skip to content

[stdlib] loading a reference can’t use loadUnaligned #78546

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 10, 2025

Conversation

glessard
Copy link
Contributor

@glessard glessard commented Jan 10, 2025

Change a mistaken use of loadUnaligned to just load. The source pointer must be aligned for a reference, since it's either typed as an Any or an AnyObject in the Objective-C runtime interface.

This is a fix for the issue mentioned in #78452 (comment)

@glessard
Copy link
Contributor Author

@swift-ci please benchmark

@glessard
Copy link
Contributor Author

@swift-ci please smoke test

@Catfish-Man
Copy link
Contributor

Looks good to me assuming it does the trick. Thanks!

@glessard glessard marked this pull request as ready for review January 10, 2025 17:38
@glessard glessard requested a review from a team as a code owner January 10, 2025 17:38
@glessard glessard enabled auto-merge January 10, 2025 17:53
@glessard
Copy link
Contributor Author

@swift-ci please benchmark

@glessard
Copy link
Contributor Author

Regarding the benchmarking failure: it's running the benchmarks off the existing main branch that's failing. We tested the benchmarks after the change, and they ran. We don't have a way to ask CI to only run the benchmarks after the fix.

@glessard glessard merged commit 46aa3fb into swiftlang:main Jan 10, 2025
3 of 5 checks passed
@glessard glessard deleted the array-lazy-eager-bridge-loadfix branch January 11, 2025 00:51
@eeckstein
Copy link
Contributor

@glessard @Catfish-Man x86 benchmarks still crash in the same benchmark. Both the Onone and O benchmarks:

* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x158828)
  * frame #0: 0x00007ff803823005 libobjc.A.dylib`objc_retain + 37
    frame #1: 0x000000010022826e Benchmark_Onone-x86_64-apple-macosx13.0`closure #1 in run_BridgedNSArrayBufferAccess($0=105553128736064 values (0x10ad33e00)) at ObjectiveCBridging.swift:831:11

Is this the same problem?

@Catfish-Man
Copy link
Contributor

Seems unlikely but could still be related in some way

@glessard
Copy link
Contributor Author

The issue mentioned by @eeckstein above is fixed by #78647

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants