Skip to content

Revert "Merge pull request #33767 ..." #39067

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

Merged
merged 1 commit into from
Aug 26, 2021

Conversation

kavon
Copy link
Member

@kavon kavon commented Aug 26, 2021

The following regression test added for this feature is not passing:

Swift(linux-x86_64) :: decl/protocol/protocols_with_self_or_assoc_reqs_executable.swift

with a compiler crash happening during SILFunctionTransform "Devirtualizer".

Reverting PR #33767 to unblock CI.

This reverts commit f96057e, reversing
changes made to 3fc18f3.

The specific failure that triggered this revert is this one:

: 'RUN: at line 1';   rm -rf "/home/buildnode/jenkins/workspace/swift-PR-Linux/branch-main/buildbot_linux/swift-linux-x86_64/test-linux-x86_64/decl/protocol/Output/protocols_with_self_or_assoc_reqs_executable.swift.tmp" && mkdir -p "/home/buildnode/jenkins/workspace/swift-PR-Linux/branch-main/buildbot_linux/swift-linux-x86_64/test-linux-x86_64/decl/protocol/Output/protocols_with_self_or_assoc_reqs_executable.swift.tmp" && /home/buildnode/jenkins/workspace/swift-PR-Linux/branch-main/buildbot_linux/swift-linux-x86_64/bin/swiftc -target x86_64-unknown-linux-gnu -toolchain-stdlib-rpath  -module-cache-path /home/buildnode/jenkins/workspace/swift-PR-Linux/branch-main/buildbot_linux/swift-linux-x86_64/swift-test-results/x86_64-unknown-linux-gnu/clang-module-cache -swift-version 4  -Xfrontend -define-availability -Xfrontend 'SwiftStdlib 5.5:macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0' -O -module-cache-path /home/buildnode/jenkins/workspace/swift-PR-Linux/branch-main/buildbot_linux/swift-linux-x86_64/swift-test-results/x86_64-unknown-linux-gnu/clang-module-cache /home/buildnode/jenkins/workspace/swift-PR-Linux/branch-main/swift/test/decl/protocol/protocols_with_self_or_assoc_reqs_executable.swift -o /home/buildnode/jenkins/workspace/swift-PR-Linux/branch-main/buildbot_linux/swift-linux-x86_64/test-linux-x86_64/decl/protocol/Output/protocols_with_self_or_assoc_reqs_executable.swift.tmp/a.out -module-name main  && echo /home/buildnode/jenkins/workspace/swift-PR-Linux/branch-main/buildbot_linux/swift-linux-x86_64/test-linux-x86_64/decl/protocol/Output/protocols_with_self_or_assoc_reqs_executable.swift.tmp/a.out && /usr/bin/env DYLD_LIBRARY_PATH='/home/buildnode/jenkins/workspace/swift-PR-Linux/branch-main/buildbot_linux/swift-linux-x86_64/lib/swift/linux' LD_LIBRARY_PATH='/home/buildnode/jenkins/workspace/swift-PR-Linux/branch-main/buildbot_linux/swift-linux-x86_64/lib/swift/linux:/home/buildnode/jenkins/workspace/swift-PR-Linux/branch-main/buildbot_linux/libdispatch-linux-x86_64' SIMCTL_CHILD_DYLD_LIBRARY_PATH='/home/buildnode/jenkins/workspace/swift-PR-Linux/branch-main/buildbot_linux/swift-linux-x86_64/lib/swift/linux'  /home/buildnode/jenkins/workspace/swift-PR-Linux/branch-main/buildbot_linux/swift-linux-x86_64/test-linux-x86_64/decl/protocol/Output/protocols_with_self_or_assoc_reqs_executable.swift.tmp/a.out
--
Exit Code: 254

Command Output (stderr):
--
/home/buildnode/jenkins/workspace/swift-PR-Linux/branch-main/swift/test/decl/protocol/protocols_with_self_or_assoc_reqs_executable.swift:103:23: warning: 'is' test is always true
  expectEqual(true, p is P)
                      ^
/home/buildnode/jenkins/workspace/swift-PR-Linux/branch-main/swift/test/decl/protocol/protocols_with_self_or_assoc_reqs_executable.swift:104:25: warning: 'is' test is always true
  expectEqual(true, S() is P)
                        ^
Source type: $Array<S>
Destination type: $Array<@opened("4FF10B8C-06C4-11EC-A2AE-0634DB30D26D") P>
Unknown combination of types for casting
UNREACHABLE executed at /home/buildnode/jenkins/workspace/swift-PR-Linux/branch-main/swift/lib/SILOptimizer/Utils/InstOptUtils.cpp:1115!
Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the project and the crash backtrace.
Stack dump:
0.	Program arguments: /home/buildnode/jenkins/workspace/swift-PR-Linux/branch-main/buildbot_linux/swift-linux-x86_64/bin/swift-frontend -frontend -c -primary-file /home/buildnode/jenkins/workspace/swift-PR-Linux/branch-main/swift/test/decl/protocol/protocols_with_self_or_assoc_reqs_executable.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-cache-path /home/buildnode/jenkins/workspace/swift-PR-Linux/branch-main/buildbot_linux/swift-linux-x86_64/swift-test-results/x86_64-unknown-linux-gnu/clang-module-cache -swift-version 4 -O -define-availability "SwiftStdlib 5.5:macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0" -module-name main -o /home/buildnode/jenkins/workspace/swift-PR-Linux/branch-main/tmp/protocols_with_self_or_assoc_reqs_executable-461415.o
1.	Swift version 5.6-dev (LLVM 5d814636634b8c0, Swift 63b4dfaf9441f1c)
2.	Compiling with effective version 4.1.50
3.	While evaluating request ExecuteSILPipelineRequest(Run pipelines { PrepareOptimizationPasses, EarlyModulePasses, HighLevel,Function+EarlyLoopOpt, HighLevel,Module+StackPromote, Serialize, MidLevel,Function, ClosureSpecialize, LowLevel,Function, LateLoopOpt, SIL Debug Info Generator } on SIL for main)
4.	While running pass #11929 SILFunctionTransform "Devirtualizer" on SILFunction "@$s4mainyycfU0_".
 for expression at [/home/buildnode/jenkins/workspace/swift-PR-Linux/branch-main/swift/test/decl/protocol/protocols_with_self_or_assoc_reqs_executable.swift:51:40 - line:105:1] RangeText="{
  struct S: P {
    static let str = "Success"
    func getString() -> String { Self.str }
  }

  let p: P = S()

  // Partial Application
  do {
    let covariantSelfSimplePartialApp = p.covariantSelfSimple
    let covariantSelfArrayPartialApp = p.covariantSelfArray
    let covariantSelfDictionaryPartialApp = p.covariantSelfDictionary
    let covariantSelfClosurePartialApp = p.covariantSelfClosure

    expectEqual(S.str, covariantSelfSimplePartialApp().getString())
    expectEqual(S.str, covariantSelfArrayPartialApp().first.unsafelyUnwrapped.getString())
    expectEqual(S.str, covariantSelfDictionaryPartialApp()[#file].unsafelyUnwrapped.getString())
    covariantSelfClosurePartialApp { expectEqual(S.str, $0.getString()) }
  }

  // Instance method reference on metatype
  do {
    let covariantSelfSimpleRef = P.covariantSelfSimple
    let covariantSelfArrayRef = P.covariantSelfArray
    let covariantSelfDictionaryRef = P.covariantSelfDictionary
    let covariantSelfClosureRef = P.covariantSelfClosure

    expectEqual(S.str, covariantSelfSimpleRef(p)().getString())
    expectEqual(S.str, covariantSelfArrayRef(p)().first.unsafelyUnwrapped.getString())
    expectEqual(S.str, covariantSelfDictionaryRef(p)()[#file].unsafelyUnwrapped.getString())
    covariantSelfClosureRef(p)({ expectEqual(S.str, $0.getString()) })
  }

  // Regular calls
  expectEqual(S.str, p.covariantSelfSimple().getString())
  expectEqual(S.str, p.covariantSelfArray().first.unsafelyUnwrapped.getString())
  expectEqual(S.str, p.covariantSelfDictionary()[#file].unsafelyUnwrapped.getString())
  p.covariantSelfClosure { expectEqual(S.str, $0.getString()) }

  expectEqual(S.str, p.covariantSelfPropSimple.getString())
  expectEqual(S.str, p.covariantSelfPropArray.first.unsafelyUnwrapped.getString())
  expectEqual(S.str, p.covariantSelfPropDictionary[#file].unsafelyUnwrapped.getString())
  p.covariantSelfPropClosure { expectEqual(S.str, $0.getString()) }

  expectEqual(S.str, p[covariantSelfSubscriptSimple: ()].getString())
  expectEqual(S.str, p[covariantSelfSubscriptArray: ()].first.unsafelyUnwrapped.getString())
  expectEqual(S.str, p[covariantSelfSubscriptDictionary: ()][#file].unsafelyUnwrapped.getString())
  p[covariantSelfSubscriptClosure: { expectEqual(S.str, $0.getString()) }]

  expectEqual(S.str, (S() as P).getString())

  expectEqual(true, p is P)
  expectEqual(true, S() is P)
"
 #0 0x0000000005b09f63 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/buildnode/jenkins/workspace/swift-PR-Linux/branch-main/buildbot_linux/swift-linux-x86_64/bin/swift-frontend+0x5b09f63)
 #1 0x0000000005b08070 llvm::sys::RunSignalHandlers() (/home/buildnode/jenkins/workspace/swift-PR-Linux/branch-main/buildbot_linux/swift-linux-x86_64/bin/swift-frontend+0x5b08070)
 #2 0x0000000005b0a2ea SignalHandler(int) (/home/buildnode/jenkins/workspace/swift-PR-Linux/branch-main/buildbot_linux/swift-linux-x86_64/bin/swift-frontend+0x5b0a2ea)
 #3 0x00007fa5b2d4e390 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x11390)
 #4 0x00007fa5b18cd438 raise (/lib/x86_64-linux-gnu/libc.so.6+0x35438)
 #5 0x00007fa5b18cf03a abort (/lib/x86_64-linux-gnu/libc.so.6+0x3703a)
 #6 0x0000000005a55ddb (/home/buildnode/jenkins/workspace/swift-PR-Linux/branch-main/buildbot_linux/swift-linux-x86_64/bin/swift-frontend+0x5a55ddb)
 #7 0x0000000000fb04bf swift::castValueToABICompatibleType(swift::SILBuilder*, swift::SILLocation, swift::SILValue, swift::SILType, swift::SILType, llvm::ArrayRef<swift::SILInstruction*>) (/home/buildnode/jenkins/workspace/swift-PR-Linux/branch-main/buildbot_linux/swift-linux-x86_64/bin/swift-frontend+0xfb04bf)
 #8 0x0000000000f3c2ee replaceApplySite(swift::SILBuilder&, swift::SILLocation, swift::ApplySite, swift::SILValue, swift::SubstitutionMap, llvm::ArrayRef<swift::SILValue>, swift::SILFunctionConventions, llvm::ArrayRef<swift::SILValue>) (/home/buildnode/jenkins/workspace/swift-PR-Linux/branch-main/buildbot_linux/swift-linux-x86_64/bin/swift-frontend+0xf3c2ee)
 #9 0x0000000000f3d4b9 swift::tryDevirtualizeWitnessMethod(swift::ApplySite, swift::OptRemark::Emitter*) (/home/buildnode/jenkins/workspace/swift-PR-Linux/branch-main/buildbot_linux/swift-linux-x86_64/bin/swift-frontend+0xf3d4b9)
#10 0x0000000000f3dc7c swift::tryDevirtualizeApply(swift::ApplySite, swift::ClassHierarchyAnalysis*, swift::OptRemark::Emitter*) (/home/buildnode/jenkins/workspace/swift-PR-Linux/branch-main/buildbot_linux/swift-linux-x86_64/bin/swift-frontend+0xf3dc7c)
#11 0x0000000000e4100b (anonymous namespace)::Devirtualizer::run() (/home/buildnode/jenkins/workspace/swift-PR-Linux/branch-main/buildbot_linux/swift-linux-x86_64/bin/swift-frontend+0xe4100b)
#12 0x0000000000d7810c swift::SILPassManager::runPassOnFunction(unsigned int, swift::SILFunction*) (/home/buildnode/jenkins/workspace/swift-PR-Linux/branch-main/buildbot_linux/swift-linux-x86_64/bin/swift-frontend+0xd7810c)
#13 0x0000000000d790f1 swift::SILPassManager::runFunctionPasses(unsigned int, unsigned int) (/home/buildnode/jenkins/workspace/swift-PR-Linux/branch-main/buildbot_linux/swift-linux-x86_64/bin/swift-frontend+0xd790f1)
#14 0x0000000000d7b990 swift::SILPassManager::execute() (/home/buildnode/jenkins/workspace/swift-PR-Linux/branch-main/buildbot_linux/swift-linux-x86_64/bin/swift-frontend+0xd7b990)
#15 0x0000000000d76b71 swift::SILPassManager::executePassPipelinePlan(swift::SILPassPipelinePlan const&) (/home/buildnode/jenkins/workspace/swift-PR-Linux/branch-main/buildbot_linux/swift-linux-x86_64/bin/swift-frontend+0xd76b71)
#16 0x0000000000d7699b swift::ExecuteSILPipelineRequest::evaluate(swift::Evaluator&, swift::SILPipelineExecutionDescriptor) const (/home/buildnode/jenkins/workspace/swift-PR-Linux/branch-main/buildbot_linux/swift-linux-x86_64/bin/swift-frontend+0xd7699b)
#17 0x0000000000d92c4b swift::SimpleRequest<swift::ExecuteSILPipelineRequest, std::tuple<> (swift::SILPipelineExecutionDescriptor), (swift::RequestFlags)1>::evaluateRequest(swift::ExecuteSILPipelineRequest const&, swift::Evaluator&) (/home/buildnode/jenkins/workspace/swift-PR-Linux/branch-main/buildbot_linux/swift-linux-x86_64/bin/swift-frontend+0xd92c4b)
#18 0x0000000000d80e5d llvm::Expected<swift::ExecuteSILPipelineRequest::OutputType> swift::Evaluator::getResultUncached<swift::ExecuteSILPipelineRequest>(swift::ExecuteSILPipelineRequest const&) (/home/buildnode/jenkins/workspace/swift-PR-Linux/branch-main/buildbot_linux/swift-linux-x86_64/bin/swift-frontend+0xd80e5d)
#19 0x0000000000d76c55 swift::executePassPipelinePlan(swift::SILModule*, swift::SILPassPipelinePlan const&, bool, swift::irgen::IRGenModule*) (/home/buildnode/jenkins/workspace/swift-PR-Linux/branch-main/buildbot_linux/swift-linux-x86_64/bin/swift-frontend+0xd76c55)
#20 0x0000000000d8301f swift::runSILOptimizationPasses(swift::SILModule&) (/home/buildnode/jenkins/workspace/swift-PR-Linux/branch-main/buildbot_linux/swift-linux-x86_64/bin/swift-frontend+0xd8301f)
#21 0x00000000006d5a72 swift::CompilerInstance::performSILProcessing(swift::SILModule*) (/home/buildnode/jenkins/workspace/swift-PR-Linux/branch-main/buildbot_linux/swift-linux-x86_64/bin/swift-frontend+0x6d5a72)
#22 0x000000000050e627 performCompileStepsPostSILGen(swift::CompilerInstance&, std::unique_ptr<swift::SILModule, std::default_delete<swift::SILModule> >, llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, swift::PrimarySpecificPaths const&, int&, swift::FrontendObserver*) (/home/buildnode/jenkins/workspace/swift-PR-Linux/branch-main/buildbot_linux/swift-linux-x86_64/bin/swift-frontend+0x50e627)
#23 0x000000000050dea8 performCompileStepsPostSema(swift::CompilerInstance&, int&, swift::FrontendObserver*) (/home/buildnode/jenkins/workspace/swift-PR-Linux/branch-main/buildbot_linux/swift-linux-x86_64/bin/swift-frontend+0x50dea8)
#24 0x0000000000501fb6 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) (/home/buildnode/jenkins/workspace/swift-PR-Linux/branch-main/buildbot_linux/swift-linux-x86_64/bin/swift-frontend+0x501fb6)
#25 0x00000000004cf2c5 swift::mainEntry(int, char const**) (/home/buildnode/jenkins/workspace/swift-PR-Linux/branch-main/buildbot_linux/swift-linux-x86_64/bin/swift-frontend+0x4cf2c5)
#26 0x00007fa5b18b8840 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x20840)
#27 0x00000000004ceea9 _start (/home/buildnode/jenkins/workspace/swift-PR-Linux/branch-main/buildbot_linux/swift-linux-x86_64/bin/swift-frontend+0x4ceea9)
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal 6 (use -v to see invocation)

…ve-self-or-associated-type-diagnostic"

The following regression test added for this feature is not passing:

Swift(linux-x86_64) :: decl/protocol/protocols_with_self_or_assoc_reqs_executable.swift

with a compiler crash happening during SILFunctionTransform "Devirtualizer".

Reverting to unblock CI.

This reverts commit f96057e, reversing
changes made to 3fc18f3.
@kavon kavon merged commit bc8657b into swiftlang:main Aug 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant