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-7923] Compiler crash when initializing a type from another module which contains a fileprivate member #50458

Closed
swift-ci opened this issue Jun 7, 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

Comments

@swift-ci
Copy link
Collaborator

swift-ci commented Jun 7, 2018

Previous ID SR-7923
Radar rdar://problem/40868358
Original Reporter neightchan (JIRA User)
Type Bug
Status Resolved
Resolution Done

Attachment: Download

Environment

Xcode 10.0
Build version 10L176w

Apple Swift version 4.2 (swiftlang-1000.0.16.7 clang-1000.10.25.3)
Target: x86_64-apple-darwin17.6.0

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

md5: 7d79dd8e07de414c62cd1ab8a8518db5

is duplicated by:

  • SR-7951 Making A Type Private Crashes the Compiler

Issue Description:

In a build context where there are two separate modules, if one of the modules ("Callee") contains a public type with a nested fileprivate type which has an property of type Foundation.Date, when referencing the type from the other module, the following compiler crash occurs:

Minimal repro attached:

Compile Swift Module 'Callee' (1 sources)
Compile Swift Module 'LinkerRepro' (1 sources)
Global is external, but doesn't have external or weak linkage!
%swift.metadata_response (i64)* @"$S6Callee6FoobarV20PartialAggregateTick33_4850B6491C37D44D8F226AFFC97EDC0ELLVMa"
<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                    0x0000000104ec1c5a PrintStackTraceSignalHandler(void*) + 42
1  swift                    0x0000000104ec1066 SignalHandler(int) + 966
2  libsystem_platform.dylib 0x00007fff6ff55f5a _sigtramp + 26
3  libsystem_platform.dylib 0x0000000115899558 _sigtramp + 2777953816
4  libsystem_c.dylib        0x00007fff6fcf31ae abort + 127
5  swift                    0x0000000101193e39 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*)::$_1::__invoke(void*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool) + 521
6  swift                    0x0000000104e74ec8 llvm::report_fatal_error(llvm::Twine const&, bool) + 280
7  swift                    0x0000000104e74dab llvm::report_fatal_error(char const*, bool) + 43
8  swift                    0x0000000104e3cc0c (anonymous namespace)::VerifierLegacyPass::doFinalization(llvm::Module&) + 204
9  swift                    0x0000000104de30f3 llvm::FPPassManager::doFinalization(llvm::Module&) + 83
10 swift                    0x0000000104de84e7 llvm::legacy::FunctionPassManagerImpl::doFinalization(llvm::Module&) + 71
11 swift                    0x000000010134fa85 swift::performLLVM(swift::IRGenOptions&, swift::DiagnosticEngine*, llvm::sys::SmartMutex<false>*, llvm::GlobalVariable*, llvm::Module*, llvm::TargetMachine*, swift::version::Version const&, llvm::StringRef, swift::UnifiedStatsReporter*) + 5237
12 swift                    0x00000001011a05c5 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 49093
13 swift                    0x000000010119110f swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 7839
14 swift                    0x000000010113ac48 main + 13144
15 libdyld.dylib            0x00007fff6fc47015 start + 1
16 libdyld.dylib            0x0000000000000028 start + 2419822612
Stack dump:
0.      Program arguments: /Applications/Xcode-10b1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c -primary-file /Users/nchandle/Scratchpads/LinkerRepro/Sources/LinkerRepro/main.swift -emit-module-path /Users/nchandle/Scratchpads/LinkerRepro/.build/x86_64-apple-macosx10.10/debug/LinkerRepro.build/main~partial.swiftmodule -emit-module-doc-path /Users/nchandle/Scratchpads/LinkerRepro/.build/x86_64-apple-macosx10.10/debug/LinkerRepro.build/main~partial.swiftdoc -emit-dependencies-path /Users/nchandle/Scratchpads/LinkerRepro/.build/x86_64-apple-macosx10.10/debug/LinkerRepro.build/main.d -emit-reference-dependencies-path /Users/nchandle/Scratchpads/LinkerRepro/.build/x86_64-apple-macosx10.10/debug/LinkerRepro.build/main.swiftdeps -target x86_64-apple-macosx10.10 -enable-objc-interop -sdk /Applications/Xcode-10b1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -I /Users/nchandle/Scratchpads/LinkerRepro/.build/x86_64-apple-macosx10.10/debug -F /Applications/Xcode-10b1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -enable-testing -g -module-cache-path /Users/nchandle/Scratchpads/LinkerRepro/.build/x86_64-apple-macosx10.10/debug/ModuleCache -swift-version 4.2 -Onone -D SWIFT_PACKAGE -D DEBUG -color-diagnostics -module-name LinkerRepro -num-threads 8 -o /Users/nchandle/Scratchpads/LinkerRepro/.build/x86_64-apple-macosx10.10/debug/LinkerRepro.build/main.swift.o
<unknown>:0: error: unable to execute command: Abort trap: 6
<unknown>:0: error: compile command failed due to signal 6 (use -v to see invocation)
error: terminated(1): /Applications/Xcode-10b1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-build-tool -f /Users/nchandle/Scratchpads/LinkerRepro/.build/debug.yaml main output:
@bob-wilson
Copy link

Arnold has a PR to fix this: #17054

@aschwaighofer
Copy link
Member

I have verified that #17054 fixes this issue.

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

No branches or pull requests

4 participants