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-13548] Swift Source Compatibility Suite: (Kickstarter/ReactiveSwift) - assert crash in SILGenFunction ::emitProfilerIncrement #55985

Open
xedin opened this issue Sep 14, 2020 · 1 comment
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself

Comments

@xedin
Copy link
Member

xedin commented Sep 14, 2020

Previous ID SR-13548
Radar rdar://68759819
Original Reporter @xedin
Type Bug
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug
Assignee @vedantk
Priority Medium

md5: 5194c9a4b59366a842b1df55179f29f5

Issue Description:

Some projects fail with an assert crash in SILGenFunction ::emitProfilerIncrement.
This is an assert which I recently added to catch leaked instructions. The problem here is that the SILBuilder didn’t get an insertion point set before instructions are created.
Before this assert was added, those instructions were leaking.

For example: https://ci.swift.org/job/swift-master-source-compat-suite-debug/3484/artifact/swift-source-compat-suite/FAIL_Kickstarter-Prelude-Prelude.xcodeproj_4.0_BuildXcodeProjectScheme_Prelude-iOS_generic-platform-iOS.log

Assertion failed: (hasValidInsertionPoint()), function insertImpl, file /Volumes/swift-ci/jenkins/workspace-private/swift-master-source-compat-suite-debug/swift/include/swift/SIL/SILBuilder.h, line 2361.
[…]
1.  Apple Swift version 5.3-dev (LLVM 8ccebdc252f47a2, Swift b9472f23f4f8a3e)
2.  While evaluating request ASTLoweringRequest(Lowering AST to SIL for file "/Volumes/swift-ci/jenkins/workspace/swift-master-source-compat-suite-debug/swift-source-compat-suite/project_cache/Kickstarter-Prelude/Prelude/Empty.swift")
3.  While silgen emitFunction SIL function "@$s7Prelude2eeoiySbAA5EmptyO_ADtF".
 for '==(_:_:)' (at /Volumes/swift-ci/jenkins/workspace/swift-master-source-compat-suite-debug/swift-source-compat-suite/project_cache/Kickstarter-Prelude/Prelude/Empty.swift:6:8)
0  swift-frontend           0x000000011433b7f5 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 37
1  swift-frontend           0x000000011433a738 llvm::sys::RunSignalHandlers() + 248
2  swift-frontend           0x000000011433bdd6 SignalHandler(int) + 262
3  libsystem_platform.dylib 0x00007fff73d575fd _sigtramp + 29
4  libsystem_platform.dylib 0x0000000000000400 _sigtramp + 18446603338572795424
5  libsystem_c.dylib        0x00007fff73c2d808 abort + 120
6  libsystem_c.dylib        0x00007fff73c2cac6 err + 0
7  swift-frontend           0x00000001146c3403 swift::SILBuilder::insertImpl(swift::SILInstruction*) (.cold.1) + 35
8  swift-frontend           0x00000001105eea66 swift::SILBuilder::insertImpl(swift::SILInstruction*) + 118
9  swift-frontend           0x000000010ff13734 swift::Lowering::SILGenFunction::emitProfilerIncrement(swift::ASTNode) + 660
10 swift-frontend           0x000000010ff13426 swift::Lowering::SILGenFunction::emitFunction(swift::FuncDecl*) + 326
11 swift-frontend           0x000000010fe893e1 swift::Lowering::SILGenModule::emitFunctionDefinition(swift::SILDeclRef, swift::SILFunction*) + 5553
12 swift-frontend           0x000000010fe8aff4 emitOrDelayFunction(swift::Lowering::SILGenModule&, swift::SILDeclRef, bool) + 228
13 swift-frontend           0x000000010fe87e1a swift::Lowering::SILGenModule::emitFunction(swift::FuncDecl*) + 122
14 swift-frontend           0x000000010fe8d237 swift::ASTLoweringRequest::evaluate(swift::Evaluator&, swift::ASTLoweringDescriptor) const + 1415
15 swift-frontend           0x000000010ff65161 swift::SimpleRequest<swift::ASTLoweringRequest, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule> > (swift::ASTLoweringDescriptor), (swift::RequestFlags)9>::evaluateRequest(swift::ASTLoweringRequest const&, swift::Evaluator&) + 33
16 swift-frontend           0x000000010fe91945 llvm::Expected<swift::ASTLoweringRequest::OutputType> swift::Evaluator::getResultUncached<swift::ASTLoweringRequest>(swift::ASTLoweringRequest const&) + 357
17 swift-frontend           0x000000010fe8e656 llvm::Expected<swift::ASTLoweringRequest::OutputType> swift::Evaluator::operator()<swift::ASTLoweringRequest, (void*)0>(swift::ASTLoweringRequest const&) + 118
18 swift-frontend           0x000000010fe8e705 swift::performASTLowering(swift::FileUnit&, swift::Lowering::TypeConverter&, swift::SILOptions const&) + 85
19 swift-frontend           0x000000010fb2a5f2 performCompileStepsPostSema(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 226
20 swift-frontend           0x000000010fb22cd8 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 4552
21 swift-frontend           0x000000010fabd21e main + 846
22 libdyld.dylib            0x00007fff73b5ecc9 start + 1
23 libdyld.dylib            0x000000000000006f start + 18446603338574861223
@vedantk
Copy link
Member

vedantk commented Sep 14, 2020

#33946 / rdar://68759819

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 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
Projects
None yet
Development

No branches or pull requests

2 participants