Op 16-3-2018 om 20:16 schreef Evgeny Leviant:> Hello Carlo, > > I tried your reproducer and faced different problem from one you described > (I'm using MacOS Sierra and lld built from trunk on Mar, 15). The crash happens > when SelectionDAGBuilder::lowerInvokable tries to access EH info of this function: > > ms_t26_RemObjects_d_Elements_d_EUnit_d_Runnerb_RunChildrennt2a_RemObjects_d_Elements_d_EUnit_d_RunContext > > This happens because LLVM doesn't know your personality function (@_elements_exception_handler), so I suggest looking > at llvm::classifyEHPersonality function as well. >hi, I've updated my testcase https://www.dropbox.com/s/ugv9sfqouhlszff/repro.tar?dl=0 to use the standard exception handler. Now it fails with llvm-6.0 from the website exactly the same as it does with my custom build.
Evgeny Leviant via llvm-dev
2018-Mar-20 11:40 UTC
[llvm-dev] lld/lto/win32 crash on DIE code
This one triggers an assertion in calculateSEHStateNumbers due to weird catchpad instruction in @_island_debug_invoke and many other functions. The code expects either pointer to a filter function or null in first operand, while you're passing pointer to structure: catchpad within %80 [{i8*, i8*}* anon..., ...] ________________________________________ От: Carlo Kok <ck at remobjects.com> Отправлено: 20 марта 2018 г. 11:04 Кому: Evgeny Leviant; llvm-dev at lists.llvm.org Тема: Re: [llvm-dev] lld/lto/win32 crash on DIE code Op 16-3-2018 om 20:16 schreef Evgeny Leviant:> Hello Carlo, > > I tried your reproducer and faced different problem from one you described > (I'm using MacOS Sierra and lld built from trunk on Mar, 15). The crash happens > when SelectionDAGBuilder::lowerInvokable tries to access EH info of this function: > > ms_t26_RemObjects_d_Elements_d_EUnit_d_Runnerb_RunChildrennt2a_RemObjects_d_Elements_d_EUnit_d_RunContext > > This happens because LLVM doesn't know your personality function (@_elements_exception_handler), so I suggest looking > at llvm::classifyEHPersonality function as well. >hi, I've updated my testcase https://www.dropbox.com/s/ugv9sfqouhlszff/repro.tar?dl=0 to use the standard exception handler. Now it fails with llvm-6.0 from the website exactly the same as it does with my custom build.
Op 20-3-2018 om 12:40 schreef Evgeny Leviant:> This one triggers an assertion in calculateSEHStateNumbers due to weird catchpad instruction > in @_island_debug_invoke and many other functions. The code expects either pointer to a filter > function or null in first operand, while you're passing pointer to structure: > > catchpad within %80 [{i8*, i8*}* anon..., ...] > > ________________________________________I used the wrong exception method name, using the regular one now (__CxxFrameHandler3). Also tested it in latest clean llvm/debug and crashes how I get it locally too. https://www.dropbox.com/s/n3e2eystps9qvwx/repro.tar?dl=0 > lld.exe!HandleAbort(int Sig) Line 411 C++ Symbols loaded. ucrtbased.dll!raise(int signum) Line 541 C++ Symbols loaded. ucrtbased.dll!abort() Line 64 C++ Symbols loaded. ucrtbased.dll!common_assert_to_stderr_direct(const wchar_t * const expression, const wchar_t * const file_name, const unsigned int line_number) Line 161 C++ Symbols loaded. ucrtbased.dll!common_assert_to_stderr<wchar_t>(const wchar_t * const expression, const wchar_t * const file_name, const unsigned int line_number) Line 175 C++ Symbols loaded. ucrtbased.dll!common_assert<wchar_t>(const wchar_t * const expression, const wchar_t * const file_name, const unsigned int line_number, void * const return_address) Line 415 C++ Symbols loaded. ucrtbased.dll!_wassert(const wchar_t * expression, const wchar_t * file_name, unsigned int line_number) Line 443 C++ Symbols loaded. lld.exe!llvm::DwarfUnit::getOrCreateTypeDIE(const llvm::MDNode * TyNode) Line 753 C++ Symbols loaded. lld.exe!llvm::DwarfUnit::addType(llvm::DIE & Entity, const llvm::DIType * Ty, llvm::dwarf::Attribute Attribute) Line 803 C++ Symbols loaded. lld.exe!llvm::DwarfCompileUnit::applyVariableAttributes(const llvm::DbgVariable & Var, llvm::DIE & VariableDie) Line 980 C++ Symbols loaded. lld.exe!llvm::DwarfCompileUnit::finishVariableDefinition(const llvm::DbgVariable & Var) Line 808 C++ Symbols loaded. lld.exe!llvm::DwarfDebug::finishVariableDefinitions() Line 671 C++ Symbols loaded. lld.exe!llvm::DwarfDebug::finalizeModuleInfo() Line 693 C++ Symbols loaded. lld.exe!llvm::DwarfDebug::endModule() Line 784 C++ Symbols loaded. lld.exe!llvm::AsmPrinter::doFinalization(llvm::Module & M) Line 1352 C++ Symbols loaded. lld.exe!llvm::FPPassManager::doFinalization(llvm::Module & M) Line 1559 C++ Symbols loaded. lld.exe!`anonymous namespace'::MPPassManager::runOnModule(llvm::Module & M) Line 1615 C++ Symbols loaded. lld.exe!llvm::legacy::PassManagerImpl::run(llvm::Module & M) Line 1700 C++ Symbols loaded. lld.exe!llvm::legacy::PassManager::run(llvm::Module & M) Line 1732 C++ Symbols loaded. lld.exe!`anonymous namespace'::codegen(llvm::lto::Config & Conf, llvm::TargetMachine * TM, std::function<std::unique_ptr<llvm::lto::NativeObjectStream,std::default_delete<llvm::lto::NativeObjectStream> > __cdecl(unsigned int)> AddStream, unsigned int Task, llvm::Module & Mod) Line 292 C++ Symbols loaded. lld.exe!llvm::lto::backend(llvm::lto::Config & C, std::function<std::unique_ptr<llvm::lto::NativeObjectStream,std::default_delete<llvm::lto::NativeObjectStream> > __cdecl(unsigned int)> AddStream, unsigned int ParallelCodeGenParallelismLevel, std::unique_ptr<llvm::Module,std::default_delete<llvm::Module> > Mod, llvm::ModuleSummaryIndex & CombinedIndex) Line 393 C++ Symbols loaded. lld.exe!llvm::lto::LTO::runRegularLTO(std::function<std::unique_ptr<llvm::lto::NativeObjectStream,std::default_delete<llvm::lto::NativeObjectStream> > __cdecl(unsigned int)> AddStream) Line 860 C++ Symbols loaded. lld.exe!llvm::lto::LTO::run(std::function<std::unique_ptr<llvm::lto::NativeObjectStream,std::default_delete<llvm::lto::NativeObjectStream> > __cdecl(unsigned int)> AddStream, std::function<std::function<std::unique_ptr<llvm::lto::NativeObjectStream,std::default_delete<llvm::lto::NativeObjectStream> > __cdecl(unsigned int)> __cdecl(unsigned int,llvm::StringRef)> Cache) Line 793 C++ Symbols loaded. lld.exe!lld::coff::BitcodeCompiler::compile() Line 141 C++ Symbols loaded. lld.exe!lld::coff::SymbolTable::compileBitcodeFiles() Line 381 C++ Symbols loaded. lld.exe!lld::coff::SymbolTable::addCombinedLTOObjects() Line 389 C++ Symbols loaded. lld.exe!lld::coff::LinkerDriver::link(llvm::ArrayRef<char const *> ArgsArr) Line 1366 C++ Symbols loaded. lld.exe!lld::coff::link(llvm::ArrayRef<char const *> Args, bool CanExitEarly, llvm::raw_ostream & Diag) Line 75 C++ Symbols loaded. lld.exe!main(int Argc, const char * * Argv) Line 129 C++ Symbols loaded. lld.exe!invoke_main() Line 78 C++ Symbols loaded. lld.exe!__scrt_common_main_seh() Line 283 C++ Symbols loaded. lld.exe!__scrt_common_main() Line 326 C++ Symbols loaded. lld.exe!mainCRTStartup() Line 17 C++ Symbols loaded. kernel32.dll!75568654() Unknown No symbols loaded. [Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll] Annotated Frame ntdll.dll!__RtlUserThreadStart() Unknown Symbols loaded. ntdll.dll!__RtlUserThreadStart at 8 () Unknown Symbols loaded.