"upstream-with-swift" testing on Linux?

How if at all are the "upstream-with-swift" branches tested on Linux? For whatever it may be worth, I'm seeing an IRGen crash in the test suite right now (CC @John_McCall):

/home/dave/s/uu/swift/test/Interpreter/enum.swift:31:13: warning: variable 'int' was never mutated; consider changing to 'let' constant
case .x(var int, var char):
        ~~~ ^
        let
/home/dave/s/uu/swift/test/Interpreter/enum.swift:31:22: warning: variable 'char' was never mutated; consider changing to 'let' constant
case .x(var int, var char):
                 ~~~ ^
                 let
swift: /home/dave/s/uu/llvm/lib/IR/Instructions.cpp:398: void llvm::CallInst::init(llvm::FunctionType *, llvm::Value *, ArrayRef<llvm::Value *>, ArrayRef<llvm::OperandBundleDef>, const llvm::Twine &): Assertion `(i >= FTy->getNumParams() || FTy->getParamType(i) == Args[i]->getType()) && "Calling a function with a bad signature!"' failed.
Stack dump:
0.	Program arguments: /home/dave/s/uu/d/bin/swift -frontend -c -primary-file /home/dave/s/uu/swift/test/Interpreter/enum.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-cache-path /home/dave/s/uu/d/swift-test-results/x86_64-unknown-linux-gnu/clang-module-cache -swift-version 4 -module-name a -o /tmp/lit_tmp_Ngzwuu/enum-0fdfa6.o 
1.	While emitting IR for source file /home/dave/s/uu/swift/test/Interpreter/enum.swift
2.	While emitting metadata for 'Goof' (at /home/dave/s/uu/swift/test/Interpreter/enum.swift:476:1)
 #0 0x00007f781aecb8c9 llvm::sys::PrintStackTrace(llvm::raw_ostream&) /home/dave/s/uu/llvm/lib/Support/Unix/Signals.inc:494:11
 #1 0x00007f781aecba79 PrintStackTraceSignalHandler(void*) /home/dave/s/uu/llvm/lib/Support/Unix/Signals.inc:558:1
 #2 0x00007f781aeca396 llvm::sys::RunSignalHandlers() /home/dave/s/uu/llvm/lib/Support/Signals.cpp:67:5
 #3 0x00007f781aecc11b SignalHandler(int) /home/dave/s/uu/llvm/lib/Support/Unix/Signals.inc:357:1
 #4 0x00007f781de21030 __restore_rt (/lib64/libpthread.so.0+0x13030)
 #5 0x00007f7813a5553f __GI_raise (/lib64/libc.so.6+0x3853f)
 #6 0x00007f7813a3f895 __GI_abort (/lib64/libc.so.6+0x22895)
 #7 0x00007f7813a3f769 _nl_load_domain.cold.0 (/lib64/libc.so.6+0x22769)
 #8 0x00007f7813a4d9f6 (/lib64/libc.so.6+0x309f6)
 #9 0x00007f781b52c431 llvm::CallInst::init(llvm::FunctionType*, llvm::Value*, llvm::ArrayRef<llvm::Value*>, llvm::ArrayRef<llvm::OperandBundleDefT<llvm::Value*> >, llvm::Twine const&) /home/dave/s/uu/llvm/lib/IR/Instructions.cpp:396:5
#10 0x00000000014cad1c llvm::CallInst::CallInst(llvm::FunctionType*, llvm::Value*, llvm::ArrayRef<llvm::Value*>, llvm::ArrayRef<llvm::OperandBundleDefT<llvm::Value*> >, llvm::Twine const&, llvm::Instruction*) /home/dave/s/uu/llvm/include/llvm/IR/Instructions.h:1761:1
#11 0x00000000014ca90d llvm::CallInst::Create(llvm::FunctionType*, llvm::Value*, llvm::ArrayRef<llvm::Value*>, llvm::ArrayRef<llvm::OperandBundleDefT<llvm::Value*> >, llvm::Twine const&, llvm::Instruction*) /home/dave/s/uu/llvm/include/llvm/IR/Instructions.h:1521:9
#12 0x00000000014ca6f0 llvm::IRBuilder<llvm::ConstantFolder, llvm::IRBuilderDefaultInserter>::CreateCall(llvm::FunctionType*, llvm::Value*, llvm::ArrayRef<llvm::Value*>, llvm::Twine const&, llvm::MDNode*) /home/dave/s/uu/llvm/include/llvm/IR/IRBuilder.h:2012:15
#13 0x00000000014ca4bb llvm::IRBuilder<llvm::ConstantFolder, llvm::IRBuilderDefaultInserter>::CreateCall(llvm::Value*, llvm::ArrayRef<llvm::Value*>, llvm::Twine const&, llvm::MDNode*) /home/dave/s/uu/llvm/include/llvm/IR/IRBuilder.h:2043:5
#14 0x00000000014c1952 swift::irgen::IRBuilder::CreateCall(llvm::Constant*, llvm::ArrayRef<llvm::Value*>, llvm::Twine const&, llvm::MDNode*) /home/dave/s/uu/swift/lib/IRGen/IRBuilder.h:334:10
#15 0x00000000016f5de0 (anonymous namespace)::OpaqueExistentialTypeInfo::assignWithCopy(swift::irgen::IRGenFunction&, swift::irgen::Address, swift::irgen::Address, swift::SILType, bool) const /home/dave/s/uu/swift/lib/IRGen/GenExistential.cpp:845:10
#16 0x0000000001728330 swift::irgen::TypeInfo::assign(swift::irgen::IRGenFunction&, swift::irgen::Address, swift::irgen::Address, swift::IsTake_t, swift::SILType, bool) const /home/dave/s/uu/swift/lib/IRGen/GenType.cpp:75:1
#17 0x000000000162af79 (anonymous namespace)::SinglePayloadEnumImplStrategy::emitIndirectAssign(swift::irgen::IRGenFunction&, swift::irgen::Address, swift::irgen::Address, swift::SILType, swift::IsTake_t, bool) const /home/dave/s/uu/swift/lib/IRGen/GenEnum.cpp:2688:13
#18 0x0000000001626c1d (anonymous namespace)::SinglePayloadEnumImplStrategy::assignWithCopy(swift::irgen::IRGenFunction&, swift::irgen::Address, swift::irgen::Address, swift::SILType, bool) const /home/dave/s/uu/swift/lib/IRGen/GenEnum.cpp:2833:7
#19 0x000000000162e20f (anonymous namespace)::EnumTypeInfoBase<swift::irgen::FixedTypeInfo>::assignWithCopy(swift::irgen::IRGenFunction&, swift::irgen::Address, swift::irgen::Address, swift::SILType, bool) const /home/dave/s/uu/swift/lib/IRGen/GenEnum.cpp:5962:7
#20 0x000000000171d8ab swift::irgen::RecordTypeInfoImpl<(anonymous namespace)::FixedStructTypeInfo, swift::irgen::IndirectTypeInfo<(anonymous namespace)::FixedStructTypeInfo, swift::irgen::FixedTypeInfo>, (anonymous namespace)::StructFieldInfo, false>::assignWithCopy(swift::irgen::IRGenFunction&, swift::irgen::Address, swift::irgen::Address, swift::SILType, bool) const /home/dave/s/uu/swift/lib/IRGen/GenRecord.h:170:24
#21 0x000000000175b252 buildValueWitnessFunction(swift::irgen::IRGenModule&, llvm::Function*, swift::irgen::ValueWitness, swift::irgen::FixedPacking, swift::CanType, swift::SILType, swift::irgen::TypeInfo const&) /home/dave/s/uu/swift/lib/IRGen/GenValueWitness.cpp:453:16
#22 0x000000000175776c addValueWitness(swift::irgen::IRGenModule&, swift::irgen::ConstantStructBuilder&, swift::irgen::ValueWitness, swift::irgen::FixedPacking, swift::CanType, swift::SILType, swift::irgen::TypeInfo const&) /home/dave/s/uu/swift/lib/IRGen/GenValueWitness.cpp:862:15
#23 0x000000000175a7e3 addValueWitnesses(swift::irgen::IRGenModule&, swift::irgen::ConstantStructBuilder&, swift::irgen::FixedPacking, swift::CanType, swift::SILType, swift::irgen::TypeInfo const&) /home/dave/s/uu/swift/lib/IRGen/GenValueWitness.cpp:884:56
#24 0x000000000175696c addValueWitnessesForAbstractType(swift::irgen::IRGenModule&, swift::irgen::ConstantStructBuilder&, swift::CanType, bool&) /home/dave/s/uu/swift/lib/IRGen/GenValueWitness.cpp:921:1
#25 0x00000000017560fd swift::irgen::emitValueWitnessTable(swift::irgen::IRGenModule&, swift::CanType, bool) /home/dave/s/uu/swift/lib/IRGen/GenValueWitness.cpp:1057:7
#26 0x000000000168a3d3 (anonymous namespace)::StructMetadataBuilderBase<(anonymous namespace)::StructMetadataBuilder>::emitValueWitnessTable() /home/dave/s/uu/swift/lib/IRGen/GenMeta.cpp:3331:7
#27 0x000000000168a30d (anonymous namespace)::StructMetadataBuilderBase<(anonymous namespace)::StructMetadataBuilder>::addValueWitnessTable() /home/dave/s/uu/swift/lib/IRGen/GenMeta.cpp:3335:13
#28 0x0000000001689fe1 swift::irgen::NominalMetadataVisitor<(anonymous namespace)::StructMetadataBuilder>::layout() /home/dave/s/uu/swift/lib/IRGen/NominalMetadataVisitor.h:46:14
#29 0x0000000001674ce5 swift::irgen::StructMetadataVisitor<(anonymous namespace)::StructMetadataBuilder>::layout() /home/dave/s/uu/swift/lib/IRGen/StructMetadataVisitor.h:46:12
#30 0x00000000016725b0 swift::irgen::emitStructMetadata(swift::irgen::IRGenModule&, swift::StructDecl*) /home/dave/s/uu/swift/lib/IRGen/GenMeta.cpp:3519:15
#31 0x000000000170e45c swift::irgen::IRGenModule::emitStructDecl(swift::StructDecl*) /home/dave/s/uu/swift/lib/IRGen/GenStruct.cpp:877:23
#32 0x00000000014ac656 swift::irgen::IRGenModule::emitGlobalDecl(swift::Decl*) /home/dave/s/uu/swift/lib/IRGen/GenDecl.cpp:1744:5
#33 0x00000000014ac366 swift::irgen::IRGenModule::emitSourceFile(swift::SourceFile&) /home/dave/s/uu/swift/lib/IRGen/GenDecl.cpp:478:19
#34 0x000000000176390e performIRGeneration(swift::IRGenOptions&, swift::ModuleDecl*, std::unique_ptr<swift::SILModule, std::default_delete<swift::SILModule> >, llvm::StringRef, swift::PrimarySpecificPaths const&, llvm::LLVMContext&, swift::SourceFile*, llvm::GlobalVariable**) /home/dave/s/uu/swift/lib/IRGen/IRGen.cpp:798:5
#35 0x0000000001763f83 swift::performIRGeneration(swift::IRGenOptions&, swift::SourceFile&, std::unique_ptr<swift::SILModule, std::default_delete<swift::SILModule> >, llvm::StringRef, swift::PrimarySpecificPaths const&, llvm::LLVMContext&, llvm::GlobalVariable**) /home/dave/s/uu/swift/lib/IRGen/IRGen.cpp:1121:3
#36 0x000000000142be80 generateIR(swift::IRGenOptions&, std::unique_ptr<swift::SILModule, std::default_delete<swift::SILModule> >, swift::PrimarySpecificPaths const&, llvm::StringRef, llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, std::unique_ptr<llvm::Module, std::default_delete<llvm::Module> >&, llvm::GlobalVariable*&, llvm::ArrayRef<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >) /home/dave/s/uu/swift/lib/FrontendTool/FrontendTool.cpp:1107:14
#37 0x0000000001428d35 performCompileStepsPostSILGen(swift::CompilerInstance&, swift::CompilerInvocation&, std::unique_ptr<swift::SILModule, std::default_delete<swift::SILModule> >, bool, llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, swift::PrimarySpecificPaths const&, bool, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) /home/dave/s/uu/swift/lib/FrontendTool/FrontendTool.cpp:1329:3
#38 0x0000000001424ff0 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) /home/dave/s/uu/swift/lib/FrontendTool/FrontendTool.cpp:1056:9
#39 0x000000000142407b swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) /home/dave/s/uu/swift/lib/FrontendTool/FrontendTool.cpp:1786:8
#40 0x0000000001356c74 run_driver(llvm::StringRef, llvm::ArrayRef<char const*>) /home/dave/s/uu/swift/tools/driver/driver.cpp:120:7
#41 0x0000000001356879 main /home/dave/s/uu/swift/tools/driver/driver.cpp:240:5
#42 0x00007f7813a41413 __libc_start_main (/lib64/libc.so.6+0x24413)
#43 0x000000000135602e _start (/home/dave/s/uu/d/bin/swift+0x135602e)

It's certainly possible that there's a hole in our testing there and that we're only testing upstream-with-swift on Darwin. We don't expect anyone to actively develop Swift with upstream-with-swift, so our interest in putting resources into testing it is not very high; we just want to avoid needing one monstrous slog to fix all the bugs at once when we re-branch. But having a bot that periodically checks upstream-with-swift on Linux would be sensible.

Anyway, when we know of bugs like this, we do generally try to take care of them. I'm surprised that that particular code would be failing just on Linux, though.

That is interesting. I think that this would be a fairly recent regression since as of ~2 days ago, I was able to build the standard library with effectively master-next/upstream-with-swift/stable-next (hey, someone want to clean up the branch names? :smiley:). This might be similar to the issue with the ctor and dtor in the boxed existentials (a function reuse with a mismatched signature). We would previously bitcast the function before invocation, but the recent change flips it around to bitcast the parameter on the site of the use. Should be really simple to fix. OpaqueExistentialTypeInfo::assignWithCopy just needs to bitcast the parameter before creating the call.

Bitcast to what? Can you be more specific?

Sorry,

This is a complete shot in the dark, but, going off of my experience with this recently, and the assertion failure: Assertion (i >= FTy->getNumParams() || FTy->getParamType(i) == Args[i]->getType()) && "Calling a function with a bad signature!"' failed. I assume that the problem is the second half of the predicate (FTy->getParamType(i) == Args[i]->getType()).

If you look at the OpaqueExistentialTypeInfo's assignWithCopy method, you will find that it does a CreateCall(fn, {dest.getAddress(), src.getAddress()}). I image that we need a bitcast for one (or both) of the parameters to the argument type to objPtrTy.

I'll put up a patch for that momentarily.

Terms of Service

Privacy Policy

Cookie Policy