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-9335] invalid Collection: more than 'count' elements in collection #51805

Closed
jpsim opened this issue Nov 24, 2018 · 2 comments
Closed

[SR-9335] invalid Collection: more than 'count' elements in collection #51805

jpsim opened this issue Nov 24, 2018 · 2 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself crash Bug: A crash, i.e., an abnormal termination of software regression run-time crash Bug → crash: Swift code crashed during execution standard library Area: Standard library umbrella swift 5.0

Comments

@jpsim
Copy link
Contributor

jpsim commented Nov 24, 2018

Previous ID SR-9335
Radar rdar://problem/46264497
Original Reporter @jpsim
Type Bug
Status Closed
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Compiler, Standard Library
Labels Bug, 5.0Regression, RunTimeCrash
Assignee None
Priority Medium

md5: 737a28126b20b8a0860215327e370ad4

Issue Description:

This works with Swift 4.2.1 but crashes in recent snapshots.

$ git clone https://github.com/jpsim/Yams.git
$ cd Yams
$ echo "swift-DEVELOPMENT-SNAPSHOT-2018-11-14-a" > .swift-version
$ swiftenv install
$ swift test
Compile Swift Module 'Yams' (16 sources)
/Users/jsimard/Projects/Yams/Sources/Yams/Representer.swift:21:5: warning: 'public' modifier is redundant for initializer declared in a public extension
    public init<T: NodeRepresentable>(_ representable: T) throws {
    ^~~~~~~
    

Linking ./.build/x86_64-apple-macosx10.10/debug/YamsPackageTests.xctest/Contents/MacOS/YamsPackageTests
Test Suite 'All tests' started at 2018-11-24 14:21:49.986
Test Suite 'YamsPackageTests.xctest' started at 2018-11-24 14:21:49.986
Test Suite 'ConstructorTests' started at 2018-11-24 14:21:49.986
Test Case '-[YamsTests.ConstructorTests testBinary]' started.
Fatal error: invalid Collection: more than 'count' elements in collection
Exited with signal code 4

Looking at the code in question, this happens when initializing an Array with a custom Sequence:

var pairs = Array(mapping)
@norio-nomura
Copy link
Contributor

I confirmed that this issue has been fixed on latest swift-DEVELOPMENT-SNAPSHOT-2018-12-07-a and swift-5.0-DEVELOPMENT-SNAPSHOT-2018-12-08-a.
jpsim/Yams#139

@jpsim
Copy link
Contributor Author

jpsim commented Dec 10, 2018

Thanks for confirming!

@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
This issue was closed.
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. compiler The Swift compiler in itself crash Bug: A crash, i.e., an abnormal termination of software regression run-time crash Bug → crash: Swift code crashed during execution standard library Area: Standard library umbrella swift 5.0
Projects
None yet
Development

No branches or pull requests

3 participants