Skip to content

swiftc crash bad pointer dereference when typealias nonexisting one #84849

@YuanchengJiang

Description

@YuanchengJiang

Description

One line to reproduce: docker run --rm -v "$PWD":/work -w /work swift:latest bash -lc 'swiftc -c test.swift -o /dev/null'

Reproduction

let test = 42
typealias a = () extension a : Comparable

Stack dump

Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the crash backtrace.
Stack dump:
0.	Program arguments: /usr/bin/swift-frontend -typecheck min.swift
1.	Swift version 6.2 (swift-6.2-RELEASE)
2.	Compiling with effective version 5.10
3.	While evaluating request TypeCheckPrimaryFileRequest(source_file "min.swift")
4.	While type-checking extension of a (at min.swift:3:18)
#0 0x000063381a966598 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/usr/bin/swift-frontend+0x7316598)
#1 0x000063381a96436e llvm::sys::RunSignalHandlers() (/usr/bin/swift-frontend+0x731436e)
#2 0x000063381a966c31 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
#3 0x00007e337f0cb330 (/lib/x86_64-linux-gnu/libc.so.6+0x45330)
#4 0x0000633815af3717 swift::DeclContext::getASTContext() const (/usr/bin/swift-frontend+0x24a3717)
#5 0x0000633815a2ab95 swift::GenericContext::getGenericParams() const (/usr/bin/swift-frontend+0x23dab95)
#6 0x0000633849f817e0 

💣 Program crashed: Bad pointer dereference at 0x00000000000288da

Expected behavior

should not crash anyway

Environment

nightly

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.crashBug: A crash, i.e., an abnormal termination of softwaretriage neededThis issue needs more specific labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions