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-11448] Abort trap: 6 when initialising Property Wrapper with variadic argument AND supplying initial value for wrappedValue. #53849

Closed
swift-ci opened this issue Sep 11, 2019 · 5 comments
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 property wrappers Feature: property wrappers

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-11448
Radar rdar://problem/55263080
Original Reporter MrLotU (JIRA User)
Type Bug
Status Resolved
Resolution Done
Environment

Xcode: 11 GM Seed
Swift: Apple Swift version 5.1 (swiftlang-1100.0.270.13 clang-1100.0.33.7)
Target: x86_64-apple-darwin18.7.0
MacOS: 10.14.6 (18G95)

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

md5: 6f97f3aef873cd3c94dea19e826fa928

duplicates:

  • SR-11062 Compiler crashes when using attribute syntax with a property wrapper

Issue Description:

When initialising a property wrapper with a variadic argument while also passing an initial value for it's wrapped value, Swift raises an Abort trap: 6.

Both not supplying a value for wrapped value or not using a variadic argument resolves this crash.

Code: https://github.com/MrLotU/bug-repros/tree/Abort-trap-6

0.  Program arguments: /Users/lotu/Downloads/Xcode-11.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c -primary-file /Users/lotu/Documents/abort-trap-6/Sources/abort-trap-6/main.swift -emit-module-path /Users/lotu/Documents/abort-trap-6/.build/x86_64-apple-macosx/debug/abort_trap_6.build/main~partial.swiftmodule -emit-module-doc-path /Users/lotu/Documents/abort-trap-6/.build/x86_64-apple-macosx/debug/abort_trap_6.build/main~partial.swiftdoc -emit-dependencies-path /Users/lotu/Documents/abort-trap-6/.build/x86_64-apple-macosx/debug/abort_trap_6.build/main.d -emit-reference-dependencies-path /Users/lotu/Documents/abort-trap-6/.build/x86_64-apple-macosx/debug/abort_trap_6.build/main.swiftdeps -target x86_64-apple-macosx10.10 -enable-objc-interop -sdk /Users/lotu/Downloads/Xcode-11.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -I /Users/lotu/Documents/abort-trap-6/.build/x86_64-apple-macosx/debug -F /Users/lotu/Downloads/Xcode-11.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -enable-testing -g -module-cache-path /Users/lotu/Documents/abort-trap-6/.build/x86_64-apple-macosx/debug/ModuleCache -swift-version 5 -Onone -D SWIFT_PACKAGE -D DEBUG -color-diagnostics -enable-anonymous-context-mangled-names -module-name abort_trap_6 -o /Users/lotu/Documents/abort-trap-6/.build/x86_64-apple-macosx/debug/abort_trap_6.build/main.swift.o -index-store-path /Users/lotu/Documents/abort-trap-6/.build/x86_64-apple-macosx/debug/index/store -index-system-modules 
1.  While emitting IR SIL function "@$s12abort_trap_613WrappedInsideVACycfC".
 for 'init()' (at /Users/lotu/Documents/abort-trap-6/Sources/abort-trap-6/main.swift:23:8)
0  swift                    0x0000000111caaeb3 PrintStackTraceSignalHandler(void*) + 51
1  swift                    0x0000000111caa686 SignalHandler(int) + 358
2  libsystem_platform.dylib 0x00007fff597dcb5d _sigtramp + 29
3  libsystem_platform.dylib 0x00007f91a1007598 _sigtramp + 1199745624
4  libsystem_c.dylib        0x00007fff596966a6 abort + 127
5  libsystem_malloc.dylib   0x00007fff597a5077 malloc_vreport + 545
6  libsystem_malloc.dylib   0x00007fff597a4e38 malloc_report + 151
7  libsystem_malloc.dylib   0x00007fff597a19b6 realloc + 313
8  swift                    0x000000010d9d082d swift::irgen::SingleScalarTypeInfo<(anonymous namespace)::ClassTypeInfo, swift::irgen::ReferenceTypeInfo>::getSchema(swift::irgen::ExplosionSchema&) const + 157
9  swift                    0x000000010db449be swift::SILInstructionVisitor<(anonymous namespace)::IRGenSILFunction, void>::visit(swift::SILInstruction*) + 35646
10 swift                    0x000000010db3930a swift::irgen::IRGenModule::emitSILFunction(swift::SILFunction*) + 9866
11 swift                    0x000000010d9e58e0 swift::irgen::IRGenerator::emitGlobalTopLevel() + 1712
12 swift                    0x000000010db16065 performIRGeneration(swift::IRGenOptions&, swift::ModuleDecl*, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule> >, llvm::StringRef, swift::PrimarySpecificPaths const&, llvm::LLVMContext&, swift::SourceFile*, llvm::GlobalVariable**) + 1189
13 swift                    0x000000010d90278a performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 36682
14 swift                    0x000000010d8f6034 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 6820
15 swift                    0x000000010d8835a3 main + 1219
16 libdyld.dylib            0x00007fff595f13d5 start + 1
@belkadan
Copy link
Contributor

@swift-ci create

@swift-ci
Copy link
Collaborator Author

Comment by Jari Koopman (JIRA)

I found out that this error also occurs for anything with an initial value in the initialiser (also non variadic). Should I open a new issue for this, or can this one be extended.

@belkadan
Copy link
Contributor

I think it's okay to track them together; it's probably not the variadic-ness that's the problem, then.

@theblixguy
Copy link
Collaborator

No longer crashes on master, I think this was fixed by one of Doug's PRs recently.

@DougGregor
Copy link
Member

Fixed as part of SR-11062

@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 property wrappers Feature: property wrappers
Projects
None yet
Development

No branches or pull requests

5 participants