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-11890] Property Wrapper Abort trap: 6 #54306
Comments
No longer crashes on master |
@swift-ci create |
Comment by Maxim Krouk (JIRA) I get the same error when implementing initializers with default parameters, which contain `wrappedValue` as a first argument and when this value is set in declaration by assignment sign. @propertyWrapper
class Abort {
var wrappedValue: Int
var anotherValue: Int
// Doesn't matter if wrappedValue is defaulted or not
init(wrappedValue: Int = 1, anotherValue: Int = 0) {
self.wrappedValue = wrappedValue
self.anotherValue = anotherValue
}
}
struct Example
{
/// ✅ Works fine
@Abort(anotherValue: 1) var fine1 = 1
/// ✅ Works fine
@Abort(wrappedValue: 2) var fine2
/// ✅ Works fine
@Abort(wrappedValue: 3, anotherValue: 0) var fine3
/// ❌ Causes `Abort trap: 6`
@Abort() var not_fine = -1
} My logs 1. While emitting IR SIL function "@$s21PropertyWrapprs_tries7ExampleVACycfC".
for 'init()' (at /Users/maximkrouk/Develop/Swift/Playgrounds/PropertyWrapprs-tries/PropertyWrapprs-tries/Wrappers/Test.swift:22:8)
0 swift 0x0000000113e59a63 PrintStackTraceSignalHandler(void*) + 51
1 swift 0x0000000113e59236 SignalHandler(int) + 358
2 libsystem_platform.dylib 0x00007fff686a742d _sigtramp + 29
3 libsystem_platform.dylib 0x00007fe280225778 _sigtramp + 397927272
4 libsystem_c.dylib 0x00007fff6857ca1c abort + 120
5 libsystem_malloc.dylib 0x00007fff68672647 has_default_zone0 + 0
6 libsystem_malloc.dylib 0x00007fff6867540e malloc_report + 151
7 libsystem_malloc.dylib 0x00007fff68666275 realloc + 312
8 swift 0x000000010fb71a4d swift::irgen::SingleScalarTypeInfo<(anonymous namespace)::ClassTypeInfo, swift::irgen::ReferenceTypeInfo>::getSchema(swift::irgen::ExplosionSchema&) const + 157
9 swift 0x000000010fce717e swift::SILInstructionVisitor<(anonymous namespace)::IRGenSILFunction, void>::visit(swift::SILInstruction*) + 35646
10 swift 0x000000010fcdbaca swift::irgen::IRGenModule::emitSILFunction(swift::SILFunction*) + 9834
11 swift 0x000000010fb86bd0 swift::irgen::IRGenerator::emitGlobalTopLevel() + 1712
12 swift 0x000000010fcb8845 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 0x000000010faa3981 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 36673
14 swift 0x000000010fa97234 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 6820
15 swift 0x000000010fa24733 main + 1219
16 libdyld.dylib 0x00007fff684ae7fd start + 1
error: Abort trap: 6 (in target 'PropertyWrapprs-tries' from project 'PropertyWrapprs-tries') |
This is fixed in Swift 5.3. Could you please verify using Xcode 12 beta 1? Thank you! |
Comment by Maxim Krouk (JIRA) Both examples compiled successfully 👍 |
Environment
Xcode 11.2.1
Additional Detail from JIRA
md5: 657ed4f1ee3a3366a97d00bd24e3144e
Issue Description:
The text was updated successfully, but these errors were encountered: