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-11692] Compiler crash in property wrappers #54101

Closed
swift-ci opened this issue Nov 1, 2019 · 1 comment
Closed

[SR-11692] Compiler crash in property wrappers #54101

swift-ci opened this issue Nov 1, 2019 · 1 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

Comments

@swift-ci
Copy link
Collaborator

swift-ci commented Nov 1, 2019

Previous ID SR-11692
Radar None
Original Reporter acedened (JIRA User)
Type Bug
Status Resolved
Resolution Duplicate

Attachment: Download

Environment

macOS 10.15, Xcode 11.1, Swift 5.1

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

md5: 9f3f97fb044f35305c413139eb5f9088

duplicates:

  • SR-11059 Abort 6: Property wrapper with default value in initialiser

is duplicated by:

Issue Description:

Swift compiler crashes after adding default value to property wrappers initializer argument

This works fine:

@propertyWrapper
struct Wrapper<T> {
  let wrappedValue: T

  init(wrappedValue: T, argument: Int) {
    self.wrappedValue = wrappedValue
  }

}
class C {
  @Wrapper(argument: 0) var prop = 0
}

However, this crashes:

@propertyWrapper
struct Wrapper<T> {
  let wrappedValue: T

  init(wrappedValue: T, argument: Int = 0) {
    self.wrappedValue = wrappedValue
  }
}

class C {
  @Wrapper var prop = 0
}

Stacktrace:

1.  While emitting IR SIL function "@$s10Playground1CCACycfc".
 for 'init()' (at /File.swift:10:7)
0  swift                    0x00000001046bbeb3 PrintStackTraceSignalHandler(void*) + 51
1  swift                    0x00000001046bb686 SignalHandler(int) + 358
2  libsystem_platform.dylib 0x00007fff6593bb1d _sigtramp + 29
3  libsystem_platform.dylib 0x00007ffeef985008 _sigtramp + 2315556104
4  libsystem_c.dylib        0x00007fff65811a08 abort + 120
5  libsystem_malloc.dylib   0x00007fff65901d30 turn_on_stack_logging + 0
6  libsystem_malloc.dylib   0x00007fff65901aee malloc_report + 151
7  libsystem_malloc.dylib   0x00007fff658fe930 realloc + 312
8  swift                    0x00000001003e164d swift::irgen::SingleScalarTypeInfo<(anonymous namespace)::ClassTypeInfo, swift::irgen::ReferenceTypeInfo>::getSchema(swift::irgen::ExplosionSchema&) const + 157
9  swift                    0x00000001005557de swift::SILInstructionVisitor<(anonymous namespace)::IRGenSILFunction, void>::visit(swift::SILInstruction*) + 35646
10 swift                    0x000000010054a12a swift::irgen::IRGenModule::emitSILFunction(swift::SILFunction*) + 9866
11 swift                    0x00000001003f6700 swift::irgen::IRGenerator::emitGlobalTopLevel() + 1712
12 swift                    0x0000000100526e85 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                    0x00000001003135aa performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 36682
14 swift                    0x0000000100306e54 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 6820
15 swift                    0x00000001002943c3 main + 1219
16 libdyld.dylib            0x00007fff6573a405 start + 1
@theblixguy
Copy link
Collaborator

Doesn’t crash on master - this was fixed a while ago (will dup it when I find the other SR)

@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

3 participants