-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[stdlib] Rework String breadcrumbs initialization/loading #63592
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
Conversation
This is a wild guess at what might be causing our persistent, random String failures on the main branch: ``` Swift(macosx-x86_64) :: Prototypes/CollectionTransformers.swift Swift(macosx-x86_64) :: stdlib/NSSlowString.swift Swift(macosx-x86_64) :: stdlib/NSStringAPI.swift Swift(macosx-x86_64) :: stdlib/StringIndex.swift Swift-validation(macosx-x86_64) :: stdlib/String.swift Swift-validation(macosx-x86_64) :: stdlib/StringBreadcrumbs.swift Swift-validation(macosx-x86_64) :: stdlib/StringUTF8.swift ``` FWIW, it appears this is *not* caused by swiftlang#62717: that change has also landed on release/5.8, and I haven’t seen these issues on that branch. Our atomic breadcrumbs initialization vs its non-atomic loading gives me an uneasy feeling that this may in fact be a long standing synchronization issue that is only now causing problems (for whatever reason). I am unable to reproduce these issues locally, so this guess may be (and probably is) wildly off the mark, but this PR is likely to be a good idea anyway, if only to rule out this possibility. rdar://104751936
@swift-ci test |
@swift-ci benchmark |
(FWIW, the failure logs on macOS do not look like there is any actually concurrent access to the string instance -- these are happening in single-threaded code, which hints that this is more likely to be some run of the mill memory corruption. But where?) |
Oh hello, the Linux build failures are interesting -- there is a compiler assert in the new version of Cc @atrick for the assert in visitForwardedGuaranteedOperands. This PR attempts to start using
Details
|
@swift-ci test macOS platform |
Yep, correct synchronization has no measurable impact to breadcrumbs performance.
|
|
Some guaranteed forwarding instructions have multiple operands: mark_dependence, ref_to_bridge_object. The corresponding instruction types checked here already have documentation that the forwarded operand is the first operand. The assert is overly cautious, and checking for indiviudal opcodes would be tedious maintenance. (cherry picked from commit 2d92af4)
Oh well, I don't know how to stack PRs.
|
@swift-ci test |
Linux failure is unrelated:
|
@swift-ci test Linux platform |
This is a wild guess at what might be causing our persistent, random String failures on the main branch:
FWIW, it appears this is not caused by #62717: that change has also landed on release/5.8, and I haven’t seen these issues on that branch.
Our atomic breadcrumbs initialization vs its non-atomic loading gives me an uneasy feeling that this may in fact be a long standing synchronization issue that is only now causing problems (for whatever reason). I am unable to reproduce these issues locally, so this guess may be (and probably is) wildly off the mark, but this PR is likely to be a good idea anyway, if only to rule out this possibility.
rdar://104751936