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-8055] Migrating a project with a subclass of UIPageViewController segfaults the compiler #50588

Closed
keith opened this issue Jun 21, 2018 · 2 comments
Assignees
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 migrator

Comments

@keith
Copy link
Collaborator

keith commented Jun 21, 2018

Previous ID SR-8055
Radar rdar://problem/41331890
Original Reporter @keith
Type Bug
Status Resolved
Resolution Done

Attachment: Download

Environment

Xcode 10.0 beta 2 (10L177m)
macOS 10.13.5 (17F77)
SWIFT_VERSION 4 -> SWIFT_VERSION 4.2

Additional Detail from JIRA
Votes 0
Component/s Source Tooling
Labels Bug, CompilerCrash, Migrator
Assignee @nkcsgexi
Priority Medium

md5: 7eac4ca1a1bf20ca27b5ebf85edc87a0

Issue Description:

If you have a project with a simple subclass of UIPageViewController like so:

class PageViewControllerLibrary: UIPageViewController {}

And you attempt to migrate it from Swift 4.1 to Swift 4.2 in Xcode 10b2 (10L177m), the compiler crashes with this log:

0  swift                    0x00000001065c2a9a PrintStackTraceSignalHandler(void*) + 42
1  swift                    0x00000001065c1ea6 SignalHandler(int) + 966
2  libsystem_platform.dylib 0x00007fff562faf5a _sigtramp + 26
3  libsystem_platform.dylib 0x0000000107b83a00 _sigtramp + 2978515648
4  swift                    0x000000010370fc9a (anonymous namespace)::APIDiffMigratorPass::handleStringRepresentableArg(swift::ValueDecl*, swift::Expr*, swift::Expr*) + 810
5  swift                    0x000000010370ae18 (anonymous namespace)::APIDiffMigratorPass::walkToExprPre(swift::Expr*) + 1080
6  swift                    0x0000000103708115 (anonymous namespace)::SemaAnnotator::walkToExprPre(swift::Expr*) + 53
7  swift                    0x0000000103d2010c swift::ASTVisitor<(anonymous namespace)::Traversal, swift::Expr*, swift::Stmt*, bool, swift::Pattern*, bool, void>::visit(swift::Expr*) + 76
8  swift                    0x0000000103d235a5 swift::ASTVisitor<(anonymous namespace)::Traversal, swift::Expr*, swift::Stmt*, bool, swift::Pattern*, bool, void>::visit(swift::Stmt*) + 165
9  swift                    0x0000000103d25658 (anonymous namespace)::Traversal::visitAbstractFunctionDecl(swift::AbstractFunctionDecl*) + 808
10 swift                    0x0000000103d2298f (anonymous namespace)::Traversal::doIt(swift::Decl*) + 399
11 swift                    0x0000000103d250ab (anonymous namespace)::Traversal::visitNominalTypeDecl(swift::NominalTypeDecl*) + 635
12 swift                    0x0000000103d2297c (anonymous namespace)::Traversal::doIt(swift::Decl*) + 380
13 swift                    0x0000000103db19af swift::SourceFile::walk(swift::ASTWalker&) + 111
14 swift                    0x0000000103d515ac swift::DeclContext::walkContext(swift::ASTWalker&) + 108
15 swift                    0x0000000103719524 swift::migrator::Migrator::performSyntacticPasses() + 14436
16 swift                    0x00000001028acf2f performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 7807
17 swift                    0x00000001028a7bbf swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 7839
18 swift                    0x0000000102851768 main + 13144
19 libdyld.dylib            0x00007fff55fec015 start + 1

Attached is an example project to repro the issue. Changing this to a subclass of UIViewController does not cause this crash.

@belkadan
Copy link
Contributor

Thanks for all these migrator reports, Keith!

@swift-ci create

@nkcsgexi
Copy link
Member

This issue is fixed by: 6433bc5

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added crash Bug: A crash, i.e., an abnormal termination of software compiler The Swift compiler in itself labels 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 migrator
Projects
None yet
Development

No branches or pull requests

4 participants