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-13384] SILGen crash due to duplicate @_silgen_name attributes with the same name #55824

Open
dan-zheng opened this issue Aug 12, 2020 · 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

Comments

@dan-zheng
Copy link
Collaborator

Previous ID SR-13384
Radar rdar://problem/67361256
Original Reporter @dan-zheng
Type Bug
Environment

Current apple/swift master: https://github.com/apple/swift/tree/643aa2d8961c2f86b931658d026329adf00a35a9

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

md5: fd48ef40ec8899eabc0184783ac60783

Issue Description:

@_silgen_name("foo")
func foo1<T>(_ x: T) {}

@_silgen_name("foo")
func foo2() {
  foo1(1)
}
$ swiftc crash.swift
Assertion failed: (fn->getLoweredFunctionType() == constantType), function getOrCreateFunction, file swift/lib/SIL/IR/SILFunctionBuilder.cpp, line 141.
Stack dump:
0.  Program arguments: build/Ninja-ReleaseAssert/swift-macosx-x86_64/bin/swift-frontend -frontend -c -primary-file crash.swift -target x86_64-apple-darwin19.4.0 -enable-objc-interop -sdk /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -color-diagnostics -target-sdk-version 10.16 -module-name crash -o /var/folders/m_/6f7q8zfs3n9fr0c_4gy8840m00hc_q/T/crash-737263.o
1.  Swift version 5.3-dev (LLVM 03a20a7d045e034, Swift 643aa2d8961c2f8)
2.  While evaluating request ASTLoweringRequest(Lowering AST to SIL for file "crash.swift")
0  swift-frontend           0x0000000107057815 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 37
1  swift-frontend           0x00000001070567e8 llvm::sys::RunSignalHandlers() + 248
2  swift-frontend           0x0000000107057df6 SignalHandler(int) + 262
3  libsystem_platform.dylib 0x00007fff6f73d5fd _sigtramp + 29
4  libsystem_platform.dylib 000000000000000000 _sigtramp + 18446603338646301216
5  libsystem_c.dylib        0x00007fff6f613808 abort + 120
6  libsystem_c.dylib        0x00007fff6f612ac6 err + 0
7  swift-frontend           0x00000001073a8a33 swift::SILFunctionBuilder::getOrCreateFunction(swift::SILLocation, swift::SILDeclRef, swift::ForDefinition_t, llvm::function_ref<swift::SILFunction* (swift::SILLocation, swift::SILDeclRef)>, swift::ProfileCounter) (.cold.4) + 35
8  swift-frontend           0x000000010358ce6c swift::SILFunctionBuilder::getOrCreateFunction(swift::SILLocation, swift::SILDeclRef, swift::ForDefinition_t, llvm::function_ref<swift::SILFunction* (swift::SILLocation, swift::SILDeclRef)>, swift::ProfileCounter) + 1676
9  swift-frontend           0x0000000102eef7bf swift::Lowering::SILGenModule::getFunction(swift::SILDeclRef, swift::ForDefinition_t) + 399
@typesanitizer
Copy link

@swift-ci create

@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
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

3 participants