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-10107] A single crash when merging Dictionaries #52509

Open
swift-ci opened this issue Mar 14, 2019 · 1 comment
Open

[SR-10107] A single crash when merging Dictionaries #52509

swift-ci opened this issue Mar 14, 2019 · 1 comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. crash Bug: A crash, i.e., an abnormal termination of software run-time crash Bug → crash: Swift code crashed during execution standard library Area: Standard library umbrella

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-10107
Radar None
Original Reporter ShacharZemingo (JIRA User)
Type Bug
Additional Detail from JIRA
Votes 1
Component/s Standard Library
Labels Bug, RunTimeCrash
Assignee None
Priority Medium

md5: 9bfe22a0f1477eb005026526f6549510

Issue Description:

I got a very weird crash when merging dictionaries, and I couldn't find anything anywhere.
I posted it in the apple forums, and was directed here to see if you guys could maybe find the issue: https://forums.developer.apple.com/message/351321 5

I posted also in swift forums: https://forums.swift.org/t/a-single-crash-when-merging-dictionaries/21511

Have a method that is func getSubscriptions(for group: Group) -> [String: Bool].

And then this line crashes
func getSubscriptions(for groups: [Group]) -> [String: Bool]

{ ----> return groups.compactMap(
{ getSubscriptions(for: $0) }

).reduce([:]) { $0.merging($1)

{ (current, _) in current }

}

}

  • I have validated that this all occurs only and always on main thread

  • Group is an object instance, holding basic data

Crash details:

  • 12.1.4 (16D57)

  • iPhone X

  • Feb 22, 2019, 6:51:00 PM

  • Swift 4.0 (NOT 4.2)

Crash info:

Fatal error: Duplicate values for key: '5c6765c3041c69001517afb0': file /BuildRoot/Library/Caches/com.apple.xbs/Sources/swiftlang_Fall2018/swiftlang_Fall2018-1000.11.42/src/swift/stdlib/public/core/Dictionary.swift, line 3853

Below is the stack trace:
EXC_BREAKPOINT 0x0000000102c7a1ac
Crashed: com.apple.main-thread

0 libswiftCore.dylib 0x102c7a1ac hidden#6617 (*hidden#17759:135)
1 libswiftCore.dylib 0x102ae1dd0 assertionFailure first-element-marker first-element-marker fileflags(:::*:🙂 (hidden#17736)
2 MY_APP 0x100c5929c specialized VariantDictionaryBuffer.nativeMerge<A>(:uniquingKeysWith🙂 (<compiler-generated>)
3 MY_APP 0x100c5ae50 specialized Dictionary.init<A>(uniqueKeysWithValues🙂 (<compiler-generated>)
4 MY_APP 0x100c491e8 MyViewController.getSubscriptions(for🙂 (<compiler-generated>)
5 MY_APP 0x100c473c0 MyViewController.updateListUI(shouldReload🙂 (MyViewController.swift:101)
6 MY_APP 0x100c5751c closure #1 in MyViewController.applyFilters(_🙂 (<compiler-generated>)
7 MY_APP 0x100b939e0 thunk for @escaping @callee_guaranteed () -> () (<compiler-generated>)
8 libdispatch.dylib 0x194ff96c8 _dispatch_call_block_and_release + 24
9 libdispatch.dylib 0x194ffa484 _dispatch_client_callout + 16
10 libdispatch.dylib 0x194fd9b34 _dispatch_main_queue_callback_4CF$VARIANT$armv81 + 1012
11 CoreFoundation 0x195551ce4 CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 12
12 CoreFoundation 0x19554cbac __CFRunLoopRun + 1964
13 CoreFoundation 0x19554c0e0 CFRunLoopRunSpecific + 436
14 GraphicsServices 0x1977c5584 GSEventRunModal + 100
15 UIKitCore 0x1c279cc00 UIApplicationMain + 212

@belkadan
Copy link
Contributor

cc @lorentey

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added the crash Bug: A crash, i.e., an abnormal termination of software label Dec 12, 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. crash Bug: A crash, i.e., an abnormal termination of software run-time crash Bug → crash: Swift code crashed during execution standard library Area: Standard library umbrella
Projects
None yet
Development

No branches or pull requests

3 participants