Navigation Menu

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-12751] Segmentation fault when overloading sorted() #55196

Closed
WowbaggersLiquidLunch opened this issue May 7, 2020 · 7 comments
Closed

[SR-12751] Segmentation fault when overloading sorted() #55196

WowbaggersLiquidLunch opened this issue May 7, 2020 · 7 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself standard library Area: Standard library umbrella

Comments

@WowbaggersLiquidLunch
Copy link
Collaborator

Previous ID SR-12751
Radar None
Original Reporter @WowbaggersLiquidLunch
Type Bug
Status Closed
Resolution Done

Attachment: Download

Environment

macOS 10.15.4 (19E287)

Xcode 11.4.1 (11E503a)

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

md5: 8838a14a372f7a428856fe39320b4ec7

Issue Description:

The following code results in segmentation fault: 11

protocol OrderedCollection: RandomAccessCollection, MutableCollection where Element: Comparable {
    @inlinable func sorted() -> Self
}

extension OrderedCollection {
    @inlinable func sorted() -> Self {
        var newOrdredCollection = self
        newOrdredCollection.sort(by: <)
        return newOrdredCollection
    }
}

Attached to this bug report is an Xcode project containing 3 cases of overloaded sorted() and sorted(by: ). 2 of the cases (including the one pasted above) results in segfault, the 3rd case compiles without errors.

@LucianoPAlmeida
Copy link
Collaborator

@WowbaggersLiquidLunch In the master Snapshot 2020-04-29 toolchain this seems fixed. Can you please test it using the lastest master snapshot and verify? Thanks 🙂

@WowbaggersLiquidLunch
Copy link
Collaborator Author

I just tested it. I can verify that it's fixed in the latest master snapshot 2020-05-05a on macOS 10.15.4 (19E287) and Xcode 11.4.1 (11E503a). I'm not able to test it in any other environment, though.

@WowbaggersLiquidLunch
Copy link
Collaborator Author

I found some errors in my code when building it with the latest master snapshot, and fixed them in the bug report's description and the attachment.

@LucianoPAlmeida
Copy link
Collaborator

So if you verify that the segmentation fault is fixed on master snapshot, you can close the issue 🙂
The workflow is normally the person who fixed or verify that the issue is fixed mark as resolved and the reporter after verifies it is fixed can close.

@WowbaggersLiquidLunch
Copy link
Collaborator Author

Should I choose "Done" or "Can not reproduce" as the resolution?

@LucianoPAlmeida
Copy link
Collaborator

I think since is reproducible on Xcode 11.4.1 it can't be cannot reproduce, so I think Done is the one 🙂

@WowbaggersLiquidLunch
Copy link
Collaborator Author

The first comment to this report says that the bug is fixed in the master Snapshot 2020-04-29 toolchain.

The bug is verified as fixed in the master Snapshot 2020-05-05a toolchain.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 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 standard library Area: Standard library umbrella
Projects
None yet
Development

No branches or pull requests

2 participants