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-7376] Compiler error "Abort trap 6" when parameter default value is itself a parameter #49924

Closed
swift-ci opened this issue Apr 8, 2018 · 0 comments

Comments

@swift-ci
Copy link
Collaborator

@swift-ci swift-ci commented Apr 8, 2018

Previous ID SR-7376
Radar None
Original Reporter felix.scheinost (JIRA User)
Type Bug
Status Resolved
Resolution Duplicate
Environment

High Sierra 10.13.4

Xcode 9.3

Apple Swift version 4.1 (swiftlang-902.0.48 clang-902.0.37.1)
Target: x86_64-apple-darwin17.5.0

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

md5: 334cee031d65b48861c74f9f2afe523d

duplicates:

  • SR-2189 Nested function with local default value crashes

Issue Description:

The following code leads to a compiler error. I'm on Xcode 9.3 but I still have 9.2 installed and doesn't compile there either.

$ cat ProblematicCode.swift
func outerFunc(outerParam: Int) {
   func innerFunc(innerParam: Int = outerParam) {}
   innerFunc()
}
outerFunc(outerParam: 2)
$ swift ProblematicCode.swift
Global is external, but doesn't have external or weak linkage!
i8* ()* @_T015ProblematicCode9outerFuncySi0C5Param_tFACL_Sivau
<unknown>:0: error: fatal error encountered during compilation; please file a bug report with your project and the crash log
<unknown>:0: note: Broken module found, compilation aborted!
0 swift 0x0000000107863ffa PrintStackTraceSignalHandler(void*) + 42
1 swift 0x00000001078633b6 SignalHandler(int) + 966
2 libsystem_platform.dylib 0x00007fff61aa8f5a _sigtramp + 26
3 libsystem_platform.dylib 0x00007ffeebdb83a8 _sigtramp + 2318464104
4 libsystem_c.dylib 0x00007fff618461ae abort + 127
5 swift 0x0000000103eba8e7 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*)::$_0::__invoke(void*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool) + 519
6 swift 0x000000010781b658 llvm::report_fatal_error(llvm::Twine const&, bool) + 280
7 swift 0x000000010781b539 llvm::report_fatal_error(char const*, bool) + 41
8 swift 0x00000001077e3c5c (anonymous namespace)::VerifierLegacyPass::doFinalization(llvm::Module&) + 204
9 swift 0x000000010778b015 llvm::FPPassManager::doFinalization(llvm::Module&) + 53
10 swift 0x0000000107790167 llvm::legacy::FunctionPassManagerImpl::doFinalization(llvm::Module&) + 71
11 swift 0x0000000104063a35 swift::performLLVM(swift::IRGenOptions&, swift::DiagnosticEngine*, llvm::sys::SmartMutex<false>*, llvm::GlobalVariable*, llvm::Module*, llvm::TargetMachine*, swift::version::Version const&, llvm::StringRef, swift::UnifiedStatsReporter*) + 5125
12 swift 0x0000000104068a62 performIRGeneration(swift::IRGenOptions&, swift::ModuleDecl*, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule> >, llvm::StringRef, llvm::LLVMContext&, swift::SourceFile*, llvm::GlobalVariable**, unsigned int) + 2738
13 swift 0x0000000104065a52 swift::performIRGeneration(swift::IRGenOptions&, swift::ModuleDecl*, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule> >, llvm::StringRef, llvm::LLVMContext&, llvm::GlobalVariable**) + 1746
14 swift 0x0000000103ec536b performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 43643
15 swift 0x0000000103eb8e64 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 7908
16 swift 0x0000000103e6d8b5 main + 18917
17 libdyld.dylib 0x00007fff6179a015 start + 1
18 libdyld.dylib 0x000000000000000a start + 2659606518
Stack dump:
0. Program arguments: /Users/felixscheinost/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -interpret ProblematicCode.swift -enable-objc-interop -sdk /Users/felixscheinost/Downloads/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -color-diagnostics -module-name ProblematicCode
fish: 'swift ProblematicCode.swift' terminated by signal SIGABRT (Abort)
@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
Projects
None yet
Development

No branches or pull requests

1 participant