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-8467] Invalid read when calling swift::AnyFunctionType::getExtInfo #50988

Closed
swift-ci opened this issue Aug 6, 2018 · 5 comments
Closed
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 good first issue Good for newcomers

Comments

@swift-ci
Copy link
Collaborator

swift-ci commented Aug 6, 2018

Previous ID SR-8467
Radar None
Original Reporter hongxuchen (JIRA User)
Type Bug
Status Resolved
Resolution Done

Attachment: Download

Environment
# prebuilt swiftc
$ /home/hongxu/FOT/SWIFT/swift-DEVELOPMENT-SNAPSHOT-2018-08-02-a-ubuntu18.04/usr/bin/swiftc --version
Swift version 4.2-dev (LLVM a4d539e482, Clang 773ac0251a, Swift f1e9a048e5)
Target: x86_64-unknown-linux-gnu

# asan compiled swiftc
$ /home/hongxu/FOT/SWIFT/build/Ninja-RelWithDebInfoAssert+asan/swift-linux-x86_64/bin/swiftc --version
Swift version 4.2-dev (LLVM a4d539e482, Clang 773ac0251a, Swift b3c9dbeb9f)
Target: x86_64-unknown-linux-gnu
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, CompilerCrash, StarterBug
Assignee None
Priority Medium

md5: 7f4aeb98bb32c0ddde1bdafabbfd1d4d

Issue Description:

When dumping the ast, swiftc may have some invalid read errors. The error message of a prebuilt swiftc is like:

/home/hongxu/FOT/SWIFT/swift-DEVELOPMENT-SNAPSHOT-2018-08-02-a-ubuntu18.04/usr/bin/swiftc -dump-ast read_Types.h:2875_0.swift
 read_Types.h:2875_0.swift:1:10: error: expected expression in list of expressions
 let h=
{0( ^ read_Types.h:2875_0.swift:1:10: error: expected '}
' at end of closure
 let h={0(
 ^
 read_Types.h:2875_0.swift:1:7: note: to match this opening '{'
 let h={0(
 ^
 read_Types.h:2875_0.swift:1:9: error: cannot call value of non-function type 'Int'
 let h={0(
 ~^
(source_file "read_Types.h:2875_0.swift"
 (top_level_code_decl range=[read_Types.h:2875_0.swift:1:1 - line:1:9]
 (brace_stmt implicit range=[read_Types.h:2875_0.swift:1:1 - line:1:9]
 (pattern_binding_decl range=[read_Types.h:2875_0.swift:1:1 - line:1:9]
 (pattern_named type='<<error type>>' 'h')
 (closure_expr type='<<error type>>' location=read_Types.h:2875_0.swift:1:7 range=[read_Types.h:2875_0.swift:1:7 - line:1:9] discriminator=0#0 0x0000000003e19494 PrintStackTraceSignalHandler(void*) (/home/hongxu/FOT/SWIFT/swift-DEVELOPMENT-SNAPSHOT-2018-08-02-a-ubuntu18.04/usr/bin/swift+0x3e19494)
 #&#8203;1 0x0000000003e172ac llvm::sys::RunSignalHandlers() (/home/hongxu/FOT/SWIFT/swift-DEVELOPMENT-SNAPSHOT-2018-08-02-a-ubuntu18.04/usr/bin/swift+0x3e172ac)
 #&#8203;2 0x0000000003e19652 SignalHandler(int) (/home/hongxu/FOT/SWIFT/swift-DEVELOPMENT-SNAPSHOT-2018-08-02-a-ubuntu18.04/usr/bin/swift+0x3e19652)
 #&#8203;3 0x00007f0faf4e1890 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x12890)
 #&#8203;4 0x000000000165b564 (anonymous namespace)::PrintExpr::printClosure(swift::AbstractClosureExpr*, char const*) (/home/hongxu/FOT/SWIFT/swift-DEVELOPMENT-SNAPSHOT-2018-08-02-a-ubuntu18.04/usr/bin/swift+0x165b564)
 #&#8203;5 0x000000000164935f swift::ASTVisitor<(anonymous namespace)::PrintExpr, void, void, void, void, void, void>::visit(swift::Expr*) (/home/hongxu/FOT/SWIFT/swift-DEVELOPMENT-SNAPSHOT-2018-08-02-a-ubuntu18.04/usr/bin/swift+0x164935f)
 #&#8203;6 0x000000000164382a swift::ASTVisitor<(anonymous namespace)::PrintDecl, void, void, void, void, void, void>::visit(swift::Decl*) (/home/hongxu/FOT/SWIFT/swift-DEVELOPMENT-SNAPSHOT-2018-08-02-a-ubuntu18.04/usr/bin/swift+0x164382a)
 #&#8203;7 0x000000000164299f swift::Decl::dump(llvm::raw_ostream&, unsigned int) const (/home/hongxu/FOT/SWIFT/swift-DEVELOPMENT-SNAPSHOT-2018-08-02-a-ubuntu18.04/usr/bin/swift+0x164299f)
 #&#8203;8 0x0000000001659d1b (anonymous namespace)::PrintStmt::printASTNodes(llvm::ArrayRef<swift::ASTNode> const&) (/home/hongxu/FOT/SWIFT/swift-DEVELOPMENT-SNAPSHOT-2018-08-02-a-ubuntu18.04/usr/bin/swift+0x1659d1b)
 #&#8203;9 0x0000000001647c45 swift::ASTVisitor<(anonymous namespace)::PrintStmt, void, void, void, void, void, void>::visit(swift::Stmt*) (/home/hongxu/FOT/SWIFT/swift-DEVELOPMENT-SNAPSHOT-2018-08-02-a-ubuntu18.04/usr/bin/swift+0x1647c45)
 #&#8203;10 0x0000000001644834 swift::ASTVisitor<(anonymous namespace)::PrintDecl, void, void, void, void, void, void>::visit(swift::Decl*) (/home/hongxu/FOT/SWIFT/swift-DEVELOPMENT-SNAPSHOT-2018-08-02-a-ubuntu18.04/usr/bin/swift+0x1644834)
 #&#8203;11 0x0000000001646a26 swift::SourceFile::dump(llvm::raw_ostream&) const (/home/hongxu/FOT/SWIFT/swift-DEVELOPMENT-SNAPSHOT-2018-08-02-a-ubuntu18.04/usr/bin/swift+0x1646a26)
 #&#8203;12 0x00000000004b8aac performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) (/home/hongxu/FOT/SWIFT/swift-DEVELOPMENT-SNAPSHOT-2018-08-02-a-ubuntu18.04/usr/bin/swift+0x4b8aac)
 #&#8203;13 0x00000000004b72ee swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) (/home/hongxu/FOT/SWIFT/swift-DEVELOPMENT-SNAPSHOT-2018-08-02-a-ubuntu18.04/usr/bin/swift+0x4b72ee)
 #&#8203;14 0x000000000046b668 main (/home/hongxu/FOT/SWIFT/swift-DEVELOPMENT-SNAPSHOT-2018-08-02-a-ubuntu18.04/usr/bin/swift+0x46b668)
 #&#8203;15 0x00007f0fad927b97 __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:344:0
 #&#8203;16 0x000000000046987a _start (/home/hongxu/FOT/SWIFT/swift-DEVELOPMENT-SNAPSHOT-2018-08-02-a-ubuntu18.04/usr/bin/swift+0x46987a)
 Stack dump:
 0. Program arguments: /home/hongxu/FOT/SWIFT/swift-DEVELOPMENT-SNAPSHOT-2018-08-02-a-ubuntu18.04/usr/bin/swift -frontend -dump-ast -primary-file read_Types.h:2875_0.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -color-diagnostics -module-name main 
 [1] 19304 segmentation fault -dump-ast read_Types.h:2875_0.swift

When using an Address Sanitizer compiled swiftc, it emits error message like:

read_Types.h:2875_0.swift:1:10: error: expected expression in list of expressions
let h={0(
         ^
read_Types.h:2875_0.swift:1:10: error: expected '}' at end of closure
let h={0(
         ^
read_Types.h:2875_0.swift:1:7: note: to match this opening '{'
let h={0(
      ^
read_Types.h:2875_0.swift:1:9: error: cannot call value of non-function type 'Int'
let h={0(
       ~^
        
(source_file "read_Types.h:2875_0.swift"
  (top_level_code_decl range=[read_Types.h:2875_0.swift:1:1 - line:1:9]
    (brace_stmt implicit range=[read_Types.h:2875_0.swift:1:1 - line:1:9]
      (pattern_binding_decl range=[read_Types.h:2875_0.swift:1:1 - line:1:9]
        (pattern_named type='<<error type>>' 'h')
        (closure_expr type='<<error type>>' location=read_Types.h:2875_0.swift:1:7 range=[read_Types.h:2875_0.swift:1:7 - line:1:9] discriminator=0#0 0x000000000088b4d1 __interceptor_backtrace.part.117 (/home/hongxu/FOT/SWIFT/build/Ninja-RelWithDebInfoAssert+asan/swift-linux-x86_64/bin/swift+0x88b4d1)
#&#8203;1 0x000000001a25eaad llvm::sys::PrintStackTrace(llvm::raw_ostream&) /home/hongxu/FOT/SWIFT/llvm/lib/Support/Unix/Signals.inc:487:13
#&#8203;2 0x000000001a25eaad PrintStackTraceSignalHandler(void*) /home/hongxu/FOT/SWIFT/llvm/lib/Support/Unix/Signals.inc:550:0
#&#8203;3 0x000000001a25046a llvm::sys::RunSignalHandlers() /home/hongxu/FOT/SWIFT/llvm/lib/Support/Signals.cpp:68:18
#&#8203;4 0x000000001a25f49f SignalHandler(int) /home/hongxu/FOT/SWIFT/llvm/lib/Support/Unix/Signals.inc:340:3
#&#8203;5 0x00007f503fd47890 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x12890)
#&#8203;6 0x0000000008713324 (anonymous namespace)::PrintExpr::printClosure(swift::AbstractClosureExpr*, char const*) /home/hongxu/FOT/SWIFT/swift/lib/AST/ASTDumper.cpp:2324:11
#&#8203;7 0x000000000863d73c llvm::PointerIntPair<swift::BraceStmt*, 1u, bool, llvm::PointerLikeTypeTraits<swift::BraceStmt*>, llvm::PointerIntPairInfo<swift::BraceStmt*, 1u, llvm::PointerLikeTypeTraits<swift::BraceStmt*> > >::getInt() const /home/hongxu/FOT/SWIFT/llvm/include/llvm/ADT/PointerIntPair.h:58:57
#&#8203;8 0x000000000863d73c swift::ClosureExpr::hasSingleExpressionBody() const /home/hongxu/FOT/SWIFT/swift/include/swift/AST/Expr.h:3625:0
#&#8203;9 0x000000000863d73c (anonymous namespace)::PrintExpr::visitClosureExpr(swift::ClosureExpr*) /home/hongxu/FOT/SWIFT/swift/lib/AST/ASTDumper.cpp:2332:0
#&#8203;10 0x000000000863d73c swift::ASTVisitor<(anonymous namespace)::PrintExpr, void, void, void, void, void, void>::visit(swift::Expr*) /home/hongxu/FOT/SWIFT/swift/include/swift/AST/ExprNodes.def:121:0
#&#8203;11 0x00000000085f7a42 swift::Expr::print(llvm::raw_ostream&, llvm::function_ref<swift::Type (swift::Expr const*)>, llvm::function_ref<swift::Type (swift::TypeLoc const&)>, unsigned int) const /home/hongxu/FOT/SWIFT/swift/lib/AST/ASTDumper.cpp:2672:8
#&#8203;12 0x00000000085f7a42 swift::Expr::print(llvm::raw_ostream&, unsigned int) const /home/hongxu/FOT/SWIFT/swift/lib/AST/ASTDumper.cpp:2680:0
#&#8203;13 0x00000000085f7a42 (anonymous namespace)::PrintDecl::printRec(swift::Expr*) /home/hongxu/FOT/SWIFT/swift/lib/AST/ASTDumper.cpp:575:0
#&#8203;14 0x00000000085f7a42 (anonymous namespace)::PrintDecl::visitPatternBindingDecl(swift::PatternBindingDecl*) /home/hongxu/FOT/SWIFT/swift/lib/AST/ASTDumper.cpp:910:0
#&#8203;15 0x00000000085f7a42 swift::ASTVisitor<(anonymous namespace)::PrintDecl, void, void, void, void, void, void>::visit(swift::Decl*) /home/hongxu/FOT/SWIFT/swift/include/swift/AST/DeclNodes.def:184:0
#&#8203;16 0x00000000085f0e66 swift::Decl::dump(llvm::raw_ostream&, unsigned int) const /home/hongxu/FOT/SWIFT/swift/lib/AST/ASTDumper.cpp:1254:25
#&#8203;17 0x00000000087065f6 (anonymous namespace)::PrintStmt::printASTNodes(llvm::ArrayRef<swift::ASTNode> const&) /home/hongxu/FOT/SWIFT/swift/lib/AST/ASTDumper.cpp:1400:31
#&#8203;18 0x0000000008628677 (anonymous namespace)::PrintStmt::visitBraceStmt(swift::BraceStmt*) /home/hongxu/FOT/SWIFT/swift/lib/AST/ASTDumper.cpp:1473:24
#&#8203;19 0x0000000008628677 swift::ASTVisitor<(anonymous namespace)::PrintStmt, void, void, void, void, void, void>::visit(swift::Stmt*) /home/hongxu/FOT/SWIFT/swift/include/swift/AST/StmtNodes.def:47:0
#&#8203;20 0x00000000085ff536 swift::Stmt::print(llvm::raw_ostream&, swift::ASTContext const*, unsigned int) const /home/hongxu/FOT/SWIFT/swift/lib/AST/ASTDumper.cpp:1679:30
#&#8203;21 0x00000000085ff536 (anonymous namespace)::PrintDecl::printRec(swift::Stmt*, swift::ASTContext const&) /home/hongxu/FOT/SWIFT/swift/lib/AST/ASTDumper.cpp:576:0
#&#8203;22 0x00000000085ff536 (anonymous namespace)::PrintDecl::visitTopLevelCodeDecl(swift::TopLevelCodeDecl*) /home/hongxu/FOT/SWIFT/swift/lib/AST/ASTDumper.cpp:1100:0
#&#8203;23 0x00000000085ff536 swift::ASTVisitor<(anonymous namespace)::PrintDecl, void, void, void, void, void, void>::visit(swift::Decl*) /home/hongxu/FOT/SWIFT/swift/include/swift/AST/DeclNodes.def:178:0
#&#8203;24 0x000000000861827f (anonymous namespace)::PrintDecl::printRec(swift::Decl*) /home/hongxu/FOT/SWIFT/swift/lib/AST/ASTDumper.cpp:574:30
#&#8203;25 0x000000000861827f (anonymous namespace)::PrintDecl::visitSourceFile(swift::SourceFile const&) /home/hongxu/FOT/SWIFT/swift/lib/AST/ASTDumper.cpp:805:0
#&#8203;26 0x000000000861827f swift::SourceFile::dump(llvm::raw_ostream&) const /home/hongxu/FOT/SWIFT/swift/lib/AST/ASTDumper.cpp:1366:0
#&#8203;27 0x0000000000b9456e dumpASTIfNeeded(swift::CompilerInvocation&, swift::CompilerInstance&) /home/hongxu/FOT/SWIFT/swift/lib/FrontendTool/FrontendTool.cpp:758:18
#&#8203;28 0x0000000000b9456e performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) /home/hongxu/FOT/SWIFT/swift/lib/FrontendTool/FrontendTool.cpp:971:0
#&#8203;29 0x0000000000b83c4f swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) /home/hongxu/FOT/SWIFT/swift/lib/FrontendTool/FrontendTool.cpp:1857:5
#&#8203;30 0x0000000000915c59 run_driver(llvm::StringRef, llvm::ArrayRef<char const*>) /home/hongxu/FOT/SWIFT/swift/tools/driver/driver.cpp:122:14
#&#8203;31 0x0000000000910973 main /home/hongxu/FOT/SWIFT/swift/tools/driver/driver.cpp:251:12
#&#8203;32 0x00007f503e18db97 __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:344:0
#&#8203;33 0x0000000000808efa _start (/home/hongxu/FOT/SWIFT/build/Ninja-RelWithDebInfoAssert+asan/swift-linux-x86_64/bin/swift+0x808efa)
Stack dump:
0.  Program arguments: /home/hongxu/FOT/SWIFT/build/Ninja-RelWithDebInfoAssert+asan/swift-linux-x86_64/bin/swift -frontend -dump-ast -primary-file read_Types.h:2875_0.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main 
AddressSanitizer:DEADLYSIGNAL
=================================================================
==13606==ERROR: AddressSanitizer: SEGV on unknown address 0x00000000000b (pc 0x000008713324 bp 0x7fff5f7cd9b0 sp 0x7fff5f7cd960 T0)
==13606==The signal is caused by a READ memory access.
==13606==Hint: address points to the zero page.
    #&#8203;0 0x8713323 in swift::AnyFunctionType::getExtInfo() const /home/hongxu/FOT/SWIFT/swift/include/swift/AST/Types.h:2875:41
    #&#8203;1 0x8713323 in (anonymous namespace)::PrintExpr::printClosure(swift::AbstractClosureExpr*, char const*) /home/hongxu/FOT/SWIFT/swift/lib/AST/ASTDumper.cpp:2324
    #&#8203;2 0x863d73b in (anonymous namespace)::PrintExpr::visitClosureExpr(swift::ClosureExpr*) /home/hongxu/FOT/SWIFT/swift/lib/AST/ASTDumper.cpp:2331:5
    #&#8203;3 0x863d73b in swift::ASTVisitor<(anonymous namespace)::PrintExpr, void, void, void, void, void, void>::visit(swift::Expr*) /home/hongxu/FOT/SWIFT/swift/include/swift/AST/ExprNodes.def:121
    #&#8203;4 0x85f7a41 in swift::Expr::print(llvm::raw_ostream&, llvm::function_ref<swift::Type (swift::Expr const*)>, llvm::function_ref<swift::Type (swift::TypeLoc const&)>, unsigned int) const /home/hongxu/FOT/SWIFT/swift/lib/AST/ASTDumper.cpp:2672:8
    #&#8203;5 0x85f7a41 in swift::Expr::print(llvm::raw_ostream&, unsigned int) const /home/hongxu/FOT/SWIFT/swift/lib/AST/ASTDumper.cpp:2680
    #&#8203;6 0x85f7a41 in (anonymous namespace)::PrintDecl::printRec(swift::Expr*) /home/hongxu/FOT/SWIFT/swift/lib/AST/ASTDumper.cpp:575
    #&#8203;7 0x85f7a41 in (anonymous namespace)::PrintDecl::visitPatternBindingDecl(swift::PatternBindingDecl*) /home/hongxu/FOT/SWIFT/swift/lib/AST/ASTDumper.cpp:910
    #&#8203;8 0x85f7a41 in swift::ASTVisitor<(anonymous namespace)::PrintDecl, void, void, void, void, void, void>::visit(swift::Decl*) /home/hongxu/FOT/SWIFT/swift/include/swift/AST/DeclNodes.def:184
    #&#8203;9 0x85f0e65 in swift::Decl::dump(llvm::raw_ostream&, unsigned int) const /home/hongxu/FOT/SWIFT/swift/lib/AST/ASTDumper.cpp:1254:25
    #&#8203;10 0x87065f5 in (anonymous namespace)::PrintStmt::printRec(swift::Decl*) /home/hongxu/FOT/SWIFT/swift/lib/AST/ASTDumper.cpp:1400:31
    #&#8203;11 0x87065f5 in (anonymous namespace)::PrintStmt::printASTNodes(llvm::ArrayRef<swift::ASTNode> const&) /home/hongxu/FOT/SWIFT/swift/lib/AST/ASTDumper.cpp:1484
    #&#8203;12 0x8628676 in (anonymous namespace)::PrintStmt::visitBraceStmt(swift::BraceStmt*) /home/hongxu/FOT/SWIFT/swift/lib/AST/ASTDumper.cpp:1472:5
    #&#8203;13 0x8628676 in swift::ASTVisitor<(anonymous namespace)::PrintStmt, void, void, void, void, void, void>::visit(swift::Stmt*) /home/hongxu/FOT/SWIFT/swift/include/swift/AST/StmtNodes.def:47
    #&#8203;14 0x85ff535 in swift::Stmt::print(llvm::raw_ostream&, swift::ASTContext const*, unsigned int) const /home/hongxu/FOT/SWIFT/swift/lib/AST/ASTDumper.cpp:1679:30
    #&#8203;15 0x85ff535 in (anonymous namespace)::PrintDecl::printRec(swift::Stmt*, swift::ASTContext const&) /home/hongxu/FOT/SWIFT/swift/lib/AST/ASTDumper.cpp:576
    #&#8203;16 0x85ff535 in (anonymous namespace)::PrintDecl::visitTopLevelCodeDecl(swift::TopLevelCodeDecl*) /home/hongxu/FOT/SWIFT/swift/lib/AST/ASTDumper.cpp:1100
    #&#8203;17 0x85ff535 in swift::ASTVisitor<(anonymous namespace)::PrintDecl, void, void, void, void, void, void>::visit(swift::Decl*) /home/hongxu/FOT/SWIFT/swift/include/swift/AST/DeclNodes.def:178
    #&#8203;18 0x861827e in (anonymous namespace)::PrintDecl::printRec(swift::Decl*) /home/hongxu/FOT/SWIFT/swift/lib/AST/ASTDumper.cpp:574:56
    #&#8203;19 0x861827e in (anonymous namespace)::PrintDecl::visitSourceFile(swift::SourceFile const&) /home/hongxu/FOT/SWIFT/swift/lib/AST/ASTDumper.cpp:805
    #&#8203;20 0x861827e in swift::SourceFile::dump(llvm::raw_ostream&) const /home/hongxu/FOT/SWIFT/swift/lib/AST/ASTDumper.cpp:1366
    #&#8203;21 0xb9456d in dumpASTIfNeeded(swift::CompilerInvocation&, swift::CompilerInstance&) /home/hongxu/FOT/SWIFT/swift/lib/FrontendTool/FrontendTool.cpp:751:55
    #&#8203;22 0xb9456d in performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) /home/hongxu/FOT/SWIFT/swift/lib/FrontendTool/FrontendTool.cpp:971
    #&#8203;23 0xb83c4e in swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) /home/hongxu/FOT/SWIFT/swift/lib/FrontendTool/FrontendTool.cpp:1857:5
    #&#8203;24 0x915c58 in run_driver(llvm::StringRef, llvm::ArrayRef<char const*>) /home/hongxu/FOT/SWIFT/swift/tools/driver/driver.cpp:122:14
    #&#8203;25 0x910972 in main /home/hongxu/FOT/SWIFT/swift/tools/driver/driver.cpp:251:12
    #&#8203;26 0x7f503e18db96 in __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310
    #&#8203;27 0x808ef9 in _start (/home/hongxu/FOT/SWIFT/build/Ninja-RelWithDebInfoAssert+asan/swift-linux-x86_64/bin/swift+0x808ef9)AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV /home/hongxu/FOT/SWIFT/swift/include/swift/AST/Types.h:2875:41 in swift::AnyFunctionType::getExtInfo() const
==13606==ABORTING

Please see the attached POCs and the corresponding error messages.

@belkadan
Copy link
Contributor

belkadan commented Aug 6, 2018

It's probably worth trying to detect invalid ASTs in the dumper code, yeah. Tagging as StarterBug in case someone wants to track down what is being accessed in a bad way in each case.

@LucianoPAlmeida
Copy link
Collaborator

@belkadan what is the status for this one? I'm looking for starter bugs that I could give it a try. If there's no work in progress I can give it a shot.

@belkadan
Copy link
Contributor

Go for it. The thing to do here is see if the crash still reproduces from the attachment, and if so figure out what compiler invariant is being broken. At that point you can reassess whether it's something that's easy to fix, or something that might require more experience.

@LucianoPAlmeida
Copy link
Collaborator

The issue is still reproducible. Starting progress investigating it 🙂)

@LucianoPAlmeida
Copy link
Collaborator

Here is the PR, #26424

@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 good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants