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-9146] SILCloner crash in IBAnimatable: LetPropertiesOpt duplicates the property initializer sequence. #51642

Closed
atrick opened this issue Oct 31, 2018 · 3 comments
Assignees
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

@atrick
Copy link
Member

atrick commented Oct 31, 2018

Previous ID SR-9146
Radar rdar://45691574
Original Reporter @atrick
Type Bug
Status Closed
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, CompilerCrash
Assignee @atrick
Priority Medium

md5: 0c3d79fee11a267e189023c34c358725

Issue Description:

Jenkins URL: https://ci.swift.org/job/swift-master-source-compat-suite/2767

Assertion failed: (iterAndInserted.second && "Original value already mapped."), function mapValue, file /Users/buildnode/jenkins/workspace-private/swift-master-source-compat-suite/swift/include/swift/SIL/SILCloner.h, line 532.
Stack dump:
0. Program arguments: /Users/buildnode/jenkins/workspace-private/swift-master-source-compat-suite/build/compat_macos/install/toolchain/usr/bin/swift -frontend -c -filelist /var/folders/_8/79jmzf2142z2xydc_01btlx00000gn/T/sources-3679da -supplementary-output-file-map /var/folders/_8/79jmzf2142z2xydc_01btlx00000gn/T/supplementaryOutputs-4d8254 -target armv7-apple-ios9.0 -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.1.sdk -I /Users/buildnode/jenkins/workspace-private/swift-master-source-compat-suite/project_cache/IBAnimatable/build/Build/Products/Release-iphoneos -F /Users/buildnode/jenkins/workspace-private/swift-master-source-compat-suite/project_cache/IBAnimatable/build/Build/Products/Release-iphoneos -g -import-underlying-module -module-cache-path /Users/buildnode/jenkins/workspace-private/swift-master-source-compat-suite/project_cache/IBAnimatable/build/ModuleCache.noindex -profile-generate -profile-coverage-mapping -swift-version 4 -O -disable-swift3-objc-inference -serialize-debugging-options -Xcc -I/Users/buildnode/jenkins/workspace-private/swift-master-source-compat-suite/project_cache/IBAnimatable/build/Build/Intermediates.noindex/IBAnimatable.build/Release-iphoneos/IBAnimatable.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/buildnode/jenkins/workspace-private/swift-master-source-compat-suite/project_cache/IBAnimatable/build/Build/Intermediates.noindex/IBAnimatable.build/Release-iphoneos/IBAnimatable.build/IBAnimatable-generated-files.hmap -Xcc -I/Users/buildnode/jenkins/workspace-private/swift-master-source-compat-suite/project_cache/IBAnimatable/build/Build/Intermediates.noindex/IBAnimatable.build/Release-iphoneos/IBAnimatable.build/IBAnimatable-own-target-headers.hmap -Xcc -I/Users/buildnode/jenkins/workspace-private/swift-master-source-compat-suite/project_cache/IBAnimatable/build/Build/Intermediates.noindex/IBAnimatable.build/Release-iphoneos/IBAnimatable.build/IBAnimatable-all-non-framework-target-headers.hmap -Xcc -ivfsoverlay -Xcc /Users/buildnode/jenkins/workspace-private/swift-master-source-compat-suite/project_cache/IBAnimatable/build/Build/Intermediates.noindex/IBAnimatable.build/Release-iphoneos/IBAnimatable.build/all-product-headers.yaml -Xcc -iquote -Xcc /Users/buildnode/jenkins/workspace-private/swift-master-source-compat-suite/project_cache/IBAnimatable/build/Build/Intermediates.noindex/IBAnimatable.build/Release-iphoneos/IBAnimatable.build/IBAnimatable-project-headers.hmap -Xcc -I/Users/buildnode/jenkins/workspace-private/swift-master-source-compat-suite/project_cache/IBAnimatable/build/Build/Products/Release-iphoneos/include -Xcc -I/Users/buildnode/jenkins/workspace-private/swift-master-source-compat-suite/project_cache/IBAnimatable/build/Build/Intermediates.noindex/IBAnimatable.build/Release-iphoneos/IBAnimatable.build/DerivedSources/armv7 -Xcc -I/Users/buildnode/jenkins/workspace-private/swift-master-source-compat-suite/project_cache/IBAnimatable/build/Build/Intermediates.noindex/IBAnimatable.build/Release-iphoneos/IBAnimatable.build/DerivedSources -Xcc -ivfsoverlay -Xcc /Users/buildnode/jenkins/workspace-private/swift-master-source-compat-suite/project_cache/IBAnimatable/build/Build/Intermediates.noindex/IBAnimatable.build/Release-iphoneos/IBAnimatable.build/unextended-module-overlay.yaml -Xcc -working-directory/Users/buildnode/jenkins/workspace-private/swift-master-source-compat-suite/project_cache/IBAnimatable/IBAnimatable -module-name IBAnimatable -num-threads 16 -output-filelist /var/folders/_8/79jmzf2142z2xydc_01btlx00000gn/T/outputs-4af78b

  1. Contents of /var/folders/_8/79jmzf2142z2xydc_01btlx00000gn/T/sources-3679da:

  2. While running pass #​732753 SILModuleTransform "LetPropertiesOpt".
    0 swift 0x0000000104cbcd18 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
    1 swift 0x0000000104cbbce8 llvm::sys::RunSignalHandlers() + 248
    2 swift 0x0000000104cbd332 SignalHandler(int) + 258
    3 libsystem_platform.dylib 0x00007fff757a1f5a _sigtramp + 26
    4 libsystem_platform.dylib 0x000907910010077e _sigtramp + 2325080126
    5 libsystem_c.dylib 0x00007fff7553f1ae abort + 127
    6 libsystem_c.dylib 0x00007fff755071ac basename_r + 0
    7 swift 0x0000000101926507 swift::SILCloner<(anonymous namespace)::InitSequenceCloner>::recordClonedInstruction(swift::SILInstruction*, swift::SILInstruction*) + 327
    8 swift 0x00000001019215ce swift::SILInstructionVisitor<(anonymous namespace)::InitSequenceCloner, void>::visit(swift::SILInstruction*) + 49694
    9 swift 0x00000001019150bb (anonymous namespace)::LetPropertiesOpt::optimizeLetPropertyAccess(swift::VarDecl*, (anonymous namespace)::InitSequence const&)::$_1::operator()(swift::SILInstruction*) const + 619
    10 swift 0x00000001019113d7 (anonymous namespace)::LetPropertiesOptPass::run() + 4119
    11 swift 0x00000001019b278b swift::SILPassManager::runModulePass(unsigned int) + 1019
    12 swift 0x00000001019b31f4 swift::SILPassManager::execute() + 692
    13 swift 0x0000000100f81fab swift::SILPassManager::executePassPipelinePlan(swift::SILPassPipelinePlan const&) + 187
    14 swift 0x00000001019bbe45 swift::runSILOptimizationPasses(swift::SILModule&) + 117
    15 swift 0x0000000100e0f4f8 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 11576
    16 swift 0x0000000100e0b72d swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 3021
    17 swift 0x0000000100dbd6de main + 686
    18 libdyld.dylib 0x00007fff75493015 start + 1
    error: Abort trap: 6

:0: error: unable to execute command: Abort trap: 6
:0: error: compile command failed due to signal 6 (use -v to see invocation)
CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler (in target: IBAnimatable)
cd /Users/buildnode/jenkins/workspace-private/swift-master-source-compat-suite/project_cache/IBAnimatable/IBAnimatable

@atrick
Copy link
Member Author

atrick commented Oct 31, 2018

XFAIL PR, in case someone wants to force merge it.

apple/swift-source-compat-suite#280

@atrick
Copy link
Member Author

atrick commented Oct 31, 2018

My SILCloner cleanup caught a bug in LetPropertiesOpt, where it clones the property initialization sequence more than once. In fact, analyzeStaticInitializer could result in an exponential explosion of SIL.

@atrick
Copy link
Member Author

atrick commented Nov 1, 2018

PR: #20207

@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
Projects
None yet
Development

No branches or pull requests

2 participants