[llvm-bugs] [Bug 48181] New: new test failure on master with llvm::Any and shared libraries

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Nov 13 22:49:34 PST 2020


https://bugs.llvm.org/show_bug.cgi?id=48181

            Bug ID: 48181
           Summary: new test failure on master with llvm::Any and shared
                    libraries
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: vtjnash at gmail.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org

I noticed the clang tests recently started hitting an assertion failure for me
(because I build it as a shared library). I tracked that down to these symbols
getting the wrong linker type (all should be 'u', so that libclang and libLLVM
will share the same copy of it), and bisected the first culprit to
ce5379f0f0675592fd10a522009fd5b1561ca72b (https://reviews.llvm.org/D88138). I
don't fully understand why, as the `.a` files seem to look okay, but it seems
somehow to definitely be the cause (removing Hexagon Codegen from the linker
list, or removing the new code from that PR also fix the problem).


$ ninja lib/libLLVM-12jl.so && nm lib/libLLVM-12jl.so | grep
ZN4llvm3Any6TypeIdIPKNS

00000000044c6cc6 u _ZN4llvm3Any6TypeIdIPKNS_13LazyCallGraph3SCCEE2IdE
00000000041a1a65 u _ZN4llvm3Any6TypeIdIPKNS_15MachineFunctionEE2IdE
0000000004424d11 r _ZN4llvm3Any6TypeIdIPKNS_4LoopEE2IdE
00000000040e1e34 u _ZN4llvm3Any6TypeIdIPKNS_6ModuleEE2IdE
00000000040e1e35 r _ZN4llvm3Any6TypeIdIPKNS_8FunctionEE2IdE


This specifically causes an abort with any test, such as this, which set
'debug-pass-manager' and run some function pass:
bin/clang -cc1 -internal-isystem lib/clang/12.0.0/include -nostdsysteminc
-triple x86_64-linux-gnu -mllvm -enable-npm-optnone -O0
-fexperimental-new-pass-manager clang/test/CodeGen/O0-no-skipped-passes.c
-fdebug-pass-manager -emit-llvm -o /dev/null -fcoroutines-ts

With a trace like this (and processing it in gdb, I do indeed see that it's of
type _ZN4llvm3Any6TypeIdIPKNS_8FunctionEE2IdE from libclang instead of from
libLLVM):

Starting llvm::Module pass manager run.                                         
Running pass: AlwaysInlinerPass on
/data/vtjnash/julia/deps/srccache/llvm-project-svn-/clang/test/CodeGen/O0-no-skipped-passes.c 
Running analysis:
InnerAnalysisManagerProxy<llvm::AnalysisManager<llvm::Function>, llvm::Module>
on
/data/vtjnash/julia/deps/srccache/llvm-project-svn-/clang/test/CodeGen/O0-no-skipped-passes.c 
Running analysis: ProfileSummaryAnalysis on
/data/vtjnash/julia/deps/srccache/llvm-project-svn-/clang/test/CodeGen/O0-no-skipped-passes.c 
Running pass: CoroEarlyPass on Unknown wrapped IR type                          
UNREACHABLE executed at
/data/vtjnash/julia/deps/srccache/llvm-project-svn-/llvm/lib/Passes/StandardInstrumentations.cpp:241! 
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash
backtrace, preprocessed source, and associated run script.                      
Stack dump:                                                                     
0.      Program arguments:
/data/vtjnash/julia/deps/scratch/llvm-svn/build_Release+Asserts/bin/clang -cc1
-internal-isystem
/data/vtjnash/julia/deps/scratch/llvm-svn/build_Release+Asserts/lib/clang/12.0.0/include
-nostdsysteminc -triple x86_64-linux-gnu -mllvm -enable-np
m-optnone -O0 -fexperimental-new-pass-manager
/data/vtjnash/julia/deps/srccache/llvm-project-svn-/clang/test/CodeGen/O0-no-skipped-passes.c
-fdebug-pass-manager -emit-llvm -o /dev/null -fcoroutines-ts                    
1.      <eof> parser at end of file                                             
2.      Optimizer                                                               
 #0 0x00007f1dae439e41 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int)
/data/vtjnash/julia/deps/srccache/llvm-project-svn-/llvm/lib/Support/Unix/Signals.inc:567:3 
 #1 0x00007f1dae437b14 llvm::sys::RunSignalHandlers()
/data/vtjnash/julia/deps/srccache/llvm-project-svn-/llvm/lib/Support/Signals.cpp:71:20 
 #2 0x00007f1dae438615 SignalHandler(int)
/data/vtjnash/julia/deps/srccache/llvm-project-svn-/llvm/lib/Support/Unix/Signals.inc:395:31 
 #3 0x00007f1dad47f210 (/lib/x86_64-linux-gnu/libc.so.6+0x46210)                
 #4 0x00007f1dad47f18b raise
/build/glibc-YYA7BZ/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51:1   
 #5 0x00007f1dad45e859 abort /build/glibc-YYA7BZ/glibc-2.31/stdlib/abort.c:81:7 
 #6 0x00007f1dae375cbe
(/data/vtjnash/julia/deps/scratch/llvm-svn/build_Release+Asserts/bin/../lib/libLLVM-12jl.so+0xb4ecbe) 
 #7 0x00007f1db177e818 (anonymous
namespace)::unwrapAndPrint(llvm::raw_ostream&, llvm::Any, llvm::StringRef,
bool, bool, bool)
/data/vtjnash/julia/deps/srccache/llvm-project-svn-/llvm/lib/Passes/StandardInstrumentations.cpp:241:3 
 #8 0x00007f1db177ed95 std::unique_ptr<llvm::Any::StorageBase,
std::default_delete<llvm::Any::StorageBase> >::~unique_ptr()
/usr/include/c++/9/bits/unique_ptr.h:291:12                                     
 #9 0x00007f1db177ed95 llvm::Any::~Any()
/data/vtjnash/julia/deps/srccache/llvm-project-svn-/llvm/include/llvm/ADT/Any.h:26:7 
#10 0x00007f1db177ed95 operator()
/data/vtjnash/julia/deps/srccache/llvm-project-svn-/llvm/lib/Passes/StandardInstrumentations.cpp:628:23 
#11 0x00007f1db177ed95 void llvm::detail::UniqueFunctionBase<void,
llvm::StringRef,
llvm::Any>::CallImpl<llvm::PrintPassInstrumentation::registerCallbacks(llvm::PassInstrumentationCallbacks&)::'lambda0'(llvm::StringRef,
llvm::Any)>(void*, llvm::StringRef, llvm::Any&) /da
ta/vtjnash/julia/deps/srccache/llvm-project-svn-/llvm/include/llvm/ADT/FunctionExtras.h:195:16 
#12 0x00007f1db5cce421 std::unique_ptr<llvm::Any::StorageBase,
std::default_delete<llvm::Any::StorageBase> >::~unique_ptr()
/usr/include/c++/9/bits/unique_ptr.h:291:12                                     
#13 0x00007f1db5cce421 llvm::Any::~Any()
/data/vtjnash/julia/deps/srccache/llvm-project-svn-/llvm/include/llvm/ADT/Any.h:26:7 
#14 0x00007f1db5cce421 bool
llvm::PassInstrumentation::runBeforePass<llvm::Function,
llvm::CoroEarlyPass>(llvm::CoroEarlyPass const&, llvm::Function const&) const
/data/vtjnash/julia/deps/srccache/llvm-project-svn-/llvm/include/llvm/IR/PassInstrumentation.h:202:10
#15 0x00007f1db5cce421
llvm::ModuleToFunctionPassAdaptor<llvm::CoroEarlyPass>::run(llvm::Module&,
llvm::AnalysisManager<llvm::Module>&)
/data/vtjnash/julia/deps/srccache/llvm-project-svn-/llvm/include/llvm/IR/PassManager.h:1255:11 
#16 0x00007f1db5cce976 llvm::detail::PassModel<llvm::Module,
llvm::ModuleToFunctionPassAdaptor<llvm::CoroEarlyPass>,
llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Module>
>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&)
/data/vtjnash/julia/deps/srccache
/llvm-project-svn-/llvm/include/llvm/IR/PassManagerInternal.h:86:3              
#17 0x00007f1dae5df14b llvm::SmallPtrSet<void*,
2u>::operator=(llvm::SmallPtrSet<void*, 2u>&&)
/data/vtjnash/julia/deps/srccache/llvm-project-svn-/llvm/include/llvm/ADT/SmallPtrSet.h:481:7 
#18 0x00007f1dae5df14b
llvm::PreservedAnalyses::operator=(llvm::PreservedAnalyses&&)
/data/vtjnash/julia/deps/srccache/llvm-project-svn-/llvm/include/llvm/IR/PassManager.h:155:7 
#19 0x00007f1dae5df14b llvm::PassManager<llvm::Module,
llvm::AnalysisManager<llvm::Module> >::run(llvm::Module&,
llvm::AnalysisManager<llvm::Module>&)
/data/vtjnash/julia/deps/srccache/llvm-project-svn-/llvm/include/llvm/IR/PassManager.h:517:16
#20 0x00007f1db5cd52ea (anonymous
namespace)::EmitAssemblyHelper::EmitAssemblyWithNewPassManager(clang::BackendAction,
std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >)
/data/vtjnash/julia/deps/srccache/llvm-project-svn-/clang/lib/C
odeGen/BackendUtil.cpp:1439:12                                                  
#21 0x00007f1db5cda13d std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >::~unique_ptr()
/usr/include/c++/9/bits/unique_ptr.h:291:12                                     
#22 0x00007f1db5cda13d clang::EmitBackendOutput(clang::DiagnosticsEngine&,
clang::HeaderSearchOptions const&, clang::CodeGenOptions const&,
clang::TargetOptions const&, clang::LangOptions const&, llvm::DataLayout
const&, llvm::Module*, clang::BackendAction, std::unique_p
tr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream> >)
/data/vtjnash/julia/deps/srccache/llvm-project-svn-/clang/lib/CodeGen/BackendUtil.cpp:1608:45 
#23 0x00007f1db6035f82 std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >::~unique_ptr()
/usr/include/c++/9/bits/unique_ptr.h:291:12                                     
#24 0x00007f1db6035f82
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
/data/vtjnash/julia/deps/srccache/llvm-project-svn-/clang/lib/CodeGen/CodeGenAction.cpp:341:24 
#25 0x00007f1db4c468d9 clang::ParseAST(clang::Sema&, bool, bool)
/data/vtjnash/julia/deps/srccache/llvm-project-svn-/clang/lib/Parse/ParseAST.cpp:171:34 
#26 0x00007f1db6034b20 clang::CodeGenAction::ExecuteAction()
/data/vtjnash/julia/deps/srccache/llvm-project-svn-/clang/lib/CodeGen/CodeGenAction.cpp:1187:1 
#27 0x00007f1db68f3469 clang::FrontendAction::Execute()
/data/vtjnash/julia/deps/srccache/llvm-project-svn-/clang/lib/Frontend/FrontendAction.cpp:949:21 
#28 0x00007f1db68a754b llvm::Error::operator bool()
/data/vtjnash/julia/deps/srccache/llvm-project-svn-/llvm/include/llvm/Support/Error.h:236:22 
#29 0x00007f1db68a754b
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
/data/vtjnash/julia/deps/srccache/llvm-project-svn-/clang/lib/Frontend/CompilerInstance.cpp:991:42 
#30 0x00007f1db6970270
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
/data/vtjnash/julia/deps/srccache/llvm-project-svn-/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:279:43 
#31 0x00005575c80ea0a8 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*)
/data/vtjnash/julia/deps/srccache/llvm-project-svn-/clang/tools/driver/cc1_main.cpp:240:40 
#32 0x00005575c80e71c8 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&)
/data/vtjnash/julia/deps/srccache/llvm-project-svn-/clang/tools/driver/driver.cpp:330:20 
#33 0x00005575c80e3dee main
/data/vtjnash/julia/deps/srccache/llvm-project-svn-/clang/tools/driver/driver.cpp:407:26 
#34 0x00007f1dad4600b3 __libc_start_main
/build/glibc-YYA7BZ/glibc-2.31/csu/../csu/libc-start.c:342:3                    
#35 0x00005575c80e6d1e _start
(/data/vtjnash/julia/deps/scratch/llvm-svn/build_Release+Asserts/bin/clang+0x13d1e) 
Aborted

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20201114/a5c03b35/attachment-0001.html>


More information about the llvm-bugs mailing list