You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
swift-ci opened this issue
Feb 20, 2017
· 2 comments
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler in itselfcrashBug: A crash, i.e., an abnormal termination of softwareIRGenLLVM IR generation
Swift version:
Apple Swift version 3.0.2 (swiftlang-800.0.63 clang-800.0.42.1)
Target: x86_64-apple-macosx10.9
gcc version:
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/c++/4.2.1
Apple LLVM version 8.0.0 (clang-800.0.42.1)
Target: x86_64-apple-darwin16.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
Xcode Version 8.2.1 (8C1002)
macOS Sierra Version 10.12.3 (16D32)
Additional Detail from JIRA
Votes
0
Component/s
Compiler
Labels
Bug, CompilerCrash, IRGen
Assignee
None
Priority
Medium
md5: 2aaa2bce8a7db20f0574ce701c00f484
Issue Description:
If an instance variable of a structure is accessed inside a closure during initialization, the compiler and REPL will crash. This issue does affect calls to functions like Array.map or Array.reduce
The following code can be used to reproduce the issue:
This crash appears using various types for the variable foo (Tested with String, Int, Float, [Int]).
This issue appears regardless of whether the variable foo is set inside the initializer or directly at the declaration.
Also, this issue was reproducible when the closure was only returning foo unchanged.
After entering this code into the REPL, it will crash with the message "Segmentation fault: 11".
When compiling the code from a file, the compiler will crash with the error message:
0 swift 0x00000001040e43ad PrintStackTraceSignalHandler(void*) + 45
1 swift 0x00000001040e3b56 SignalHandler(int) + 790
2 libsystem_platform.dylib 0x00007fff8e0fabba _sigtramp + 26
3 libsystem_platform.dylib 0x00007fff5eb7f8f0 _sigtramp + 3500690768
4 swift 0x00000001012148a4 (anonymous namespace)::StructTypeInfoBase<(anonymous namespace)::LoadableStructTypeInfo, swift::irgen::LoadableTypeInfo, (anonymous namespace)::StructFieldInfo>::projectFieldAddress(swift::irgen::IRGenFunction&, swift::irgen::Address, swift::SILType, swift::VarDecl*) const + 212
5 swift 0x000000010121469e swift::irgen::projectPhysicalStructMemberAddress(swift::irgen::IRGenFunction&, swift::irgen::Address, swift::SILType, swift::VarDecl*) + 126
6 swift 0x0000000101260c12 swift::SILVisitor<(anonymous namespace)::IRGenSILFunction, void>::visit(swift::ValueBase*) + 28002
7 swift 0x0000000101257458 swift::irgen::IRGenModule::emitSILFunction(swift::SILFunction*) + 9160
8 swift 0x000000010116920f swift::irgen::IRGenerator::emitLazyDefinitions() + 6399
9 swift 0x000000010123c58a performIRGeneration(swift::IRGenOptions&, swift::ModuleDecl*, swift::SILModule*, llvm::StringRef, llvm::LLVMContext&, swift::SourceFile*, unsigned int) + 1802
10 swift 0x00000001010f1f31 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*) + 23777
11 swift 0x00000001010ea2b3 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 17859
12 swift 0x00000001010a65cf main + 8239
13 libdyld.dylib 0x00007fff8deed255 start + 1
14 libdyld.dylib 0x000000000000000f start + 1913728443
Stack dump:
0. Program arguments: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c -primary-file Bug.swift -target x86_64-apple-macosx10.9 -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -color-diagnostics -module-name Bug -o /var/folders/_z/r4w3qsxd51z_2r9ww94k5z6w0000gn/T/Bug-de43d7.o
1. While emitting IR SIL function @_TFFV3Bug3BarcFT_S0_U_FT_T_ for expression at [Bug.swift:5:7 - line:7:3] RangeText="{
print(self.foo)
}"
<unknown>:0: error: unable to execute command: Segmentation fault: 11
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
The text was updated successfully, but these errors were encountered:
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler in itselfcrashBug: A crash, i.e., an abnormal termination of softwareIRGenLLVM IR generation
Environment
Swift version:
Apple Swift version 3.0.2 (swiftlang-800.0.63 clang-800.0.42.1)
Target: x86_64-apple-macosx10.9
gcc version:
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/c++/4.2.1
Apple LLVM version 8.0.0 (clang-800.0.42.1)
Target: x86_64-apple-darwin16.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
Xcode Version 8.2.1 (8C1002)
macOS Sierra Version 10.12.3 (16D32)
Additional Detail from JIRA
md5: 2aaa2bce8a7db20f0574ce701c00f484
Issue Description:
If an instance variable of a structure is accessed inside a closure during initialization, the compiler and REPL will crash. This issue does affect calls to functions like Array.map or Array.reduce
The following code can be used to reproduce the issue:
This crash appears using various types for the variable foo (Tested with String, Int, Float, [Int]).
This issue appears regardless of whether the variable foo is set inside the initializer or directly at the declaration.
Also, this issue was reproducible when the closure was only returning foo unchanged.
After entering this code into the REPL, it will crash with the message "Segmentation fault: 11".
When compiling the code from a file, the compiler will crash with the error message:
The text was updated successfully, but these errors were encountered: