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-16024] Abort trap: 6 #58285

Closed
RemiBardon opened this issue Mar 18, 2022 · 8 comments
Closed

[SR-16024] Abort trap: 6 #58285

RemiBardon opened this issue Mar 18, 2022 · 8 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself

Comments

@RemiBardon
Copy link

Previous ID SR-16024
Radar None
Original Reporter @RemiBardon
Type Bug
Status Resolved
Resolution Done

Attachment: Download

Environment
  • Xcode 13.3 (13E113)

  • Apple Swift version 5.6 (swiftlang-5.6.0.323.62 clang-1316.0.20.8)

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

md5: 5e7b4efcfd7e1b934084017f19a47356

Issue Description:

<https://github.com/RemiBardon/swift-nonempty/tree/nested-nonempty\> (`7c2cff54d74e784d6f1a108a328c97b3a81eb512`) was compiling a few days ago. I upgraded to Xcode 13.3, and now I get `error: Abort trap: 6 (in target 'NonEmpty' from project 'swift-nonempty')`.

I think this relates to Swift 5.6's existential types, which I would have loved using if I didn't need backwards compatibility.

My code uses a lots of type aliases, protocols and extensions, and I think it gives a hard time to the Swift compiler.

@RemiBardon
Copy link
Author

I found that it's exactly this commit (`3418e7aa4762d93be38d9ae0414a3f31a68ae9aa`) which first causes the crash.

I will investigate.

@RemiBardon
Copy link
Author

Looking at the stack trace, and seeing the commit, I really think the crash is caused by a too complex extension:

extension NonEmptyProtocol
 where Collection: NonEmptyProtocol,
 Collection.Collection: NonEmptyProtocol,
 Collection.Collection.Collection: NonEmptyProtocol,
 Collection.Collection.Collection.Collection: NonEmptyProtocol,
 Collection.Collection.Collection.Collection.Collection: NonEmptyProtocol,
 Collection.Collection.Collection.Collection.Collection.Collection: NonEmptyProtocol,
 Collection.Collection.Collection.Collection.Collection.Collection.Collection: NonEmptyProtocol,
 Collection.Collection.Collection.Collection.Collection.Collection.Collection.Collection: NonEmptyProtocol,
 Collection.Collection.Collection.Collection.Collection.Collection.Collection.Collection.Collection: NonEmptyProtocol
 {

@RemiBardon
Copy link
Author

It's exactly the {code:swift}.tenth

@RemiBardon
Copy link
Author

I couldn't find a compiler flag to increase the RAM used by the compiler (I don't even know if it would have helped), so I simply removed the too complex extensions.

However, the issue is still there.

@swift-ci
Copy link
Collaborator

Comment by Dzmitry Antonenka (JIRA)

Hello @RemiBardon, seems I faced same issue related to Realm dependency with swift 5.6. I'm attaching log swift_5.6_issue copy.rtf, hope it will help with investigation

@slavapestov
Copy link
Member

You need to increase the maximum rewrite system term length with a compiler flag, like so: -Xfrontend -requirement-machine-depth-limit=20

I can tweak the heuristic to avoid this problem.

dzmitry.antonenka (JIRA User) the issue with RealmSwift is not related to this. You need to update to the latest RealmSwift sources to get the fix.

@slavapestov
Copy link
Member

This fixes the generic signature without passing a flag: #42017

@slavapestov
Copy link
Member

#42017

@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
Projects
None yet
Development

No branches or pull requests

3 participants