Skip to content
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

[SR-10289] Crash in Swift._StringObject.getSharedUTF8Start() #52689

Open
jpsim opened this issue Apr 3, 2019 · 5 comments
Open

[SR-10289] Crash in Swift._StringObject.getSharedUTF8Start() #52689

jpsim opened this issue Apr 3, 2019 · 5 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. standard library Area: Standard library umbrella

Comments

@jpsim
Copy link
Contributor

jpsim commented Apr 3, 2019

Previous ID SR-10289
Radar None
Original Reporter @jpsim
Type Bug
Environment

Apple Swift version 5.0 (swiftlang-1001.0.69.5 clang-1001.0.46.3)
Xcode Version 10.2 (10E125)
iOS Simulator iPhone XS Max iOS 12.1

Additional Detail from JIRA
Votes 0
Component/s Standard Library
Labels Bug
Assignee None
Priority Medium

Watchers: @shahmishal

md5: 130ea2eeb372e793bb08779472c1f61b

Issue Description:

I'm sorry I don't have steps to reproduce, but I experienced this in an iOS Simulator run of my app and wanted to report it.

* thread #​1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x18)
    frame #&#8203;0: 0x00000001142ef33b libswiftCore.dylib`function signature specialization <Arg[0] = Exploded> of Swift._StringObject.getSharedUTF8Start() -> Swift.UnsafePointer<Swift.UInt8> + 27
    frame #&#8203;1: 0x00000001142ef361 libswiftCore.dylib`function signature specialization <Arg[0] = Exploded> of Swift._StringObject.sharedUTF8.getter : Swift.UnsafeBufferPointer<Swift.UInt8> + 17
    frame #&#8203;2: 0x000000011423de05 libswiftCore.dylib`function signature specialization <Arg[0] = [Closure Propagated : closure #&#8203;2 (Swift.UInt8) -> () in Swift._StringGutsSlice._normalizedHash(into: inout Swift.Hasher) -> (), Argument Types : [Swift.Hasher]> of Swift._StringGutsSlice._withNFCCodeUnits((Swift.UInt8) throws -> ()) throws -> () + 6917
    frame #&#8203;3: 0x000000011423bef5 libswiftCore.dylib`Swift._StringGutsSlice._normalizedHash(into: inout Swift.Hasher) -> () + 213
    frame #&#8203;4: 0x00000001142f3d95 libswiftCore.dylib`function signature specialization <Arg[1] = Exploded> of Swift.String.hash(into: inout Swift.Hasher) -> () + 245
    frame #&#8203;5: 0x00000001140f60d9 libswiftCore.dylib`protocol witness for Swift.Hashable._rawHashValue(seed: Swift.Int) -> Swift.Int in conformance Swift.Character : Swift.Hashable in Swift + 153
    frame #&#8203;6: 0x0000000114384ce9 libswiftCore.dylib`protocol witness for Swift.Hashable._rawHashValue(seed: Swift.Int) -> Swift.Int in conformance Swift.String : Swift.Hashable in Swift + 9
    frame #&#8203;7: 0x00000001141542a3 libswiftCore.dylib`Swift._NativeDictionary.setValue(_: __owned B, forKey: A, isUnique: Swift.Bool) -> () + 131
    frame #&#8203;8: 0x0000000114132218 libswiftCore.dylib`Swift.Dictionary._Variant.setValue(_: __owned B, forKey: A) -> () + 280
    frame #&#8203;9: 0x0000000114323400 libswiftCore.dylib`function signature specialization <Arg[1] = Owned To Guaranteed> of Swift.Dictionary.subscript.setter : (A) -> Swift.Optional<B> + 304
    frame #&#8203;10: 0x00000001140fe172 libswiftCore.dylib`Swift.Dictionary.subscript.setter : (A) -> Swift.Optional<B> + 18
  * frame #&#8203;11: 0x000000010416dab0 [REDACTED]
    frame #&#8203;12: 0x000000010416f380 [REDACTED]
    frame #&#8203;13: 0x00000001035217bb [REDACTED]
    frame #&#8203;14: 0x0000000103523254 [REDACTED]
    frame #&#8203;15: 0x000000011d124bde UIKitCore`-[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 280
    frame #&#8203;16: 0x000000011d1265cb UIKitCore`-[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 3979
    frame #&#8203;17: 0x000000011d12bc2f UIKitCore`-[UIApplication _runWithMainScene:transitionContext:completion:] + 1623
    frame #&#8203;18: 0x000000011c94a4e9 UIKitCore`__111-[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:]_block_invoke + 866
    frame #&#8203;19: 0x000000011c95329c UIKitCore`+[_UICanvas _enqueuePostSettingUpdateTransactionBlock:] + 153
    frame #&#8203;20: 0x000000011c94a126 UIKitCore`-[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:] + 233
    frame #&#8203;21: 0x000000011c94aae0 UIKitCore`-[__UICanvasLifecycleMonitor_Compatability activateEventsOnly:withContext:completion:] + 1085
    frame #&#8203;22: 0x000000011c948cb5 UIKitCore`__82-[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:]_block_invoke + 795
    frame #&#8203;23: 0x000000011c94895f UIKitCore`-[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:] + 435
    frame #&#8203;24: 0x000000011c94da90 UIKitCore`__125-[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:]_block_invoke + 584
    frame #&#8203;25: 0x000000011c94e80e UIKitCore`_performActionsWithDelayForTransitionContext + 100
    frame #&#8203;26: 0x000000011c94d7ef UIKitCore`-[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:] + 221
    frame #&#8203;27: 0x000000011c95293a UIKitCore`-[_UICanvas scene:didUpdateWithDiff:transitionContext:completion:] + 392
    frame #&#8203;28: 0x000000011d12a44e UIKitCore`-[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 515
    frame #&#8203;29: 0x000000011ccced09 UIKitCore`-[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 357
    frame #&#8203;30: 0x0000000119dbe2da FrontBoardServices`-[FBSSceneImpl _didCreateWithTransitionContext:completion:] + 448
    frame #&#8203;31: 0x0000000119dc9443 FrontBoardServices`__56-[FBSWorkspace client:handleCreateScene:withCompletion:]_block_invoke_2 + 271
    frame #&#8203;32: 0x0000000119dc8b3a FrontBoardServices`__40-[FBSWorkspace _performDelegateCallOut:]_block_invoke + 53
    frame #&#8203;33: 0x000000011664e602 libdispatch.dylib`_dispatch_client_callout + 8
    frame #&#8203;34: 0x0000000116651b78 libdispatch.dylib`_dispatch_block_invoke_direct + 301
    frame #&#8203;35: 0x0000000119dfdba8 FrontBoardServices`__FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 30
    frame #&#8203;36: 0x0000000119dfd860 FrontBoardServices`-[FBSSerialQueue _performNext] + 457
    frame #&#8203;37: 0x0000000119dfde40 FrontBoardServices`-[FBSSerialQueue _performNextFromRunLoopSource] + 45
    frame #&#8203;38: 0x0000000111ac8721 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
    frame #&#8203;39: 0x0000000111ac7f93 CoreFoundation`__CFRunLoopDoSources0 + 243
    frame #&#8203;40: 0x0000000111ac263f CoreFoundation`__CFRunLoopRun + 1263
    frame #&#8203;41: 0x0000000111ac1e11 CoreFoundation`CFRunLoopRunSpecific + 625
    frame #&#8203;42: 0x000000011590d1dd GraphicsServices`GSEventRunModal + 62
    frame #&#8203;43: 0x000000011d12d81d UIKitCore`UIApplicationMain + 140
    frame #&#8203;44: 0x00000001035269bb [REDACTED]
    frame #&#8203;45: 0x00000001166c4575 libdyld.dylib`start + 1
@belkadan
Copy link
Contributor

belkadan commented Apr 4, 2019

@milseman, @Catfish-Man, anything useful here?

@milseman
Copy link
Mannequin

milseman mannequin commented Apr 4, 2019

Nothing off the top of my head; I haven't seen this backtrace before.

edit: An asserts build of the standard library would likely show more information, as as crash here would probably be caught by an invariant check earlier. What's the best way for a developer to get and use a toolchain with stdlib asserts enabled?

@belkadan
Copy link
Contributor

belkadan commented Apr 4, 2019

Hm, I don't think we enable stdlib assertions in our nightly snapshots, just compiler assertions. @shahmishal, is there a way to ask CI to build a toolchain using a specific preset?

@shahmishal
Copy link
Member

Sorry we don’t currently support this feature with PR testing.

@milseman
Copy link
Mannequin

milseman mannequin commented Apr 4, 2019

That would be immensely useful for debugging, especially in cases like this where we don't have access to the developer's code. It's a little more official to be say "download and try this toolchain from swift.org" than "download and try this toolchain I built from .... dropbox?"

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. standard library Area: Standard library umbrella
Projects
None yet
Development

No branches or pull requests

3 participants