[llvm-bugs] [Bug 50037] New: MemorySanitizer Assertion `Size != 0 && Store != nullptr' failed

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Apr 20 05:44:24 PDT 2021


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

            Bug ID: 50037
           Summary: MemorySanitizer Assertion `Size != 0 && Store !=
                    nullptr' failed
           Product: compiler-rt
           Version: unspecified
          Hardware: Other
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: msan
          Assignee: unassignedbugs at nondot.org
          Reporter: aik at ozlabs.ru
                CC: llvm-bugs at lists.llvm.org

This was from an attempt to build Linux for POWERPC64LE. clang crashes. LLVM is
upstream sha1 fbc325934661.

I am attaching the c file, it is from the kernel compiled with enabled LTO_THIN
+
-fsanitize=cfi-cast-strict -fsanitize=cfi-derived-cast
-fsanitize=cfi-unrelated-cast -fsanitize=cfi-nvcall -fsanitize=cfi-vcall 
-fsanitize=cfi-mfcall  -fsanitize=memory



clang-13:
/home/aik/p/llvm-project/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp:3707:
void {anonymous}::MemorySanitizerVisitor::visitCallBase(llvm::CallBase&):
Assertion `Size != 0 && Store != nullptr' failed.

Program received signal SIGABRT, Aborted.
0x00007ffff7830468 in __libc_signal_restore_set (set=0x7fffffff8128)
    at ../sysdeps/unix/sysv/linux/internal-signals.h:86
86      ../sysdeps/unix/sysv/linux/internal-signals.h: No such file or
directory.
(gdb) bt
#0  0x00007ffff7830468 in __libc_signal_restore_set (set=0x7fffffff8128)
    at ../sysdeps/unix/sysv/linux/internal-signals.h:86
#1  __GI_raise (sig=<optimized out>) at ../sysdeps/unix/sysv/linux/raise.c:48
#2  0x00007ffff7807cd0 in __GI_abort () at abort.c:79
#3  0x00007ffff781f5dc in __assert_fail_base (fmt=<optimized out>,
    assertion=assertion at entry=0x10e87bc00 "Size != 0 && Store != nullptr",
    file=file at entry=0x10e87a830
"/home/aik/p/llvm-project/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp",
    line=line at entry=3707,
    function=function at entry=0x10e87ba68 "void
{anonymous}::MemorySanitizerVisitor::visitCallBase(llvm::CallBase&)")
    at assert.c:92
#4  0x00007ffff781f680 in __GI___assert_fail (assertion=0x10e87bc00 "Size != 0
&& Store != nullptr",
    file=0x10e87a830
"/home/aik/p/llvm-project/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp",
    line=<optimized out>,
    function=0x10e87ba68 "void
{anonymous}::MemorySanitizerVisitor::visitCallBase(llvm::CallBase&)") at
assert.c:101
#5  0x00000001078dace8 in (anonymous
namespace)::MemorySanitizerVisitor::visitCallBase (this=0x7fffffff8d90, CB=...)
    at
/home/aik/p/llvm-project/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp:3707
#6  0x00000001078ea4a8 in llvm::InstVisitor<(anonymous
namespace)::MemorySanitizerVisitor, void>::visitCallInst (
    this=0x7fffffff8d90, I=...) at
/home/aik/p/llvm-project/llvm/include/llvm/IR/InstVisitor.h:219
#7  0x00000001078ea454 in llvm::InstVisitor<(anonymous
namespace)::MemorySanitizerVisitor, void>::delegateCallInst (
    this=0x7fffffff8d90, I=...) at
/home/aik/p/llvm-project/llvm/include/llvm/IR/InstVisitor.h:299
#8  0x00000001078e958c in llvm::InstVisitor<(anonymous
namespace)::MemorySanitizerVisitor, void>::visitCall (
    this=0x7fffffff8d90, I=...) at
/home/aik/p/llvm-project/llvm/include/llvm/IR/Instruction.def:209
#9  0x00000001078e7a20 in llvm::InstVisitor<(anonymous
namespace)::MemorySanitizerVisitor, void>::visit (
    this=0x7fffffff8d90, I=...) at
/home/aik/p/llvm-project/llvm/include/llvm/IR/Instruction.def:209
#10 0x00000001078ceb2c in (anonymous namespace)::MemorySanitizerVisitor::visit
(this=0x7fffffff8d90, I=...)
    at
/home/aik/p/llvm-project/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp:1895
#11 0x00000001078e890c in llvm::InstVisitor<(anonymous
namespace)::MemorySanitizerVisitor,
void>::visit<llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::Instruction,
false, false, void>, false, false> > (this=0x7fffffff8d90,
    Start=..., End=...) at
/home/aik/p/llvm-project/llvm/include/llvm/IR/InstVisitor.h:90
--Type <RET> for more, q to quit, c to continue without paging--
#12 0x00000001078e73e8 in llvm::InstVisitor<(anonymous
namespace)::MemorySanitizerVisitor, void>::visit (
    this=0x7fffffff8d90, BB=...) at
/home/aik/p/llvm-project/llvm/include/llvm/IR/InstVisitor.h:105
#13 0x00000001078cac38 in (anonymous
namespace)::MemorySanitizerVisitor::runOnFunction (this=0x7fffffff8d90)
    at
/home/aik/p/llvm-project/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp:1306
#14 0x00000001078e6b80 in (anonymous
namespace)::MemorySanitizer::sanitizeFunction (this=0x7fffffff93a0, F=...,
    TLI=...) at
/home/aik/p/llvm-project/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp:5318
#15 0x00000001078c5d6c in llvm::MemorySanitizerPass::run (this=0x113482558,
F=..., FAM=...)
    at
/home/aik/p/llvm-project/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp:671
#16 0x0000000105700cd8 in llvm::detail::PassModel<llvm::Function,
llvm::MemorySanitizerPass, llvm::PreservedAnalyses,
llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&,
llvm::AnalysisManager<llvm::Function>&) (this=0x113482550, 
    IR=..., AM=...) at
/home/aik/p/llvm-project/llvm/include/llvm/IR/PassManagerInternal.h:85
#17 0x000000010423fe5c in llvm::PassManager<llvm::Function,
llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&,
 llvm::AnalysisManager<llvm::Function>&) (this=0x11451dd88, IR=..., AM=...)
    at /home/aik/p/llvm-project/llvm/include/llvm/IR/PassManager.h:517
#18 0x0000000105700a50 in llvm::detail::PassModel<llvm::Function,
llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function>>,
llvm::PreservedAnalyses,
llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&,
llvm::AnalysisManager<llvm::Function>&) (this=0x11451dd80, IR=..., AM=...)
    at /home/aik/p/llvm-project/llvm/include/llvm/IR/PassManagerInternal.h:85
#19 0x000000010423edc0 in llvm::ModuleToFunctionPassAdaptor::run
(this=0x11378bed8, M=..., AM=...)
    at /home/aik/p/llvm-project/llvm/lib/IR/PassManager.cpp:117
#20 0x000000010570090c in llvm::detail::PassModel<llvm::Module,
llvm::ModuleToFunctionPassAdaptor, llvm::PreservedAnalyses,
llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&,
llvm::AnalysisManager<llvm::Module>&) (this=0x11378bed0,
    IR=..., AM=...) at
/home/aik/p/llvm-project/llvm/include/llvm/IR/PassManagerInternal.h:85
#21 0x000000010423f898 in llvm::PassManager<llvm::Module,
llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm:
:AnalysisManager<llvm::Module>&) (this=0x7fffffff9c18, IR=..., AM=...)
    at /home/aik/p/llvm-project/llvm/include/llvm/IR/PassManager.h:517
#22 0x00000001056ca904 in (anonymous
namespace)::EmitAssemblyHelper::EmitAssemblyWithNewPassManager (
    this=0x7fffffffae18, Action=clang::Backend_EmitBC, OS=std::unique_ptr<class
llvm::raw_pwrite_stream> = {...})
    at /home/aik/p/llvm-project/clang/lib/CodeGen/BackendUtil.cpp:1483
--Type <RET> for more, q to quit, c to continue without paging--
#23 0x00000001056cbcf8 in clang::EmitBackendOutput (Diags=..., HeaderOpts=...,
CGOpts=..., TOpts=..., LOpts=...,
    TDesc=..., M=0x1127c7ae0, Action=clang::Backend_EmitBC,
OS=std::unique_ptr<class llvm::raw_pwrite_stream> = {...})
    at /home/aik/p/llvm-project/clang/lib/CodeGen/BackendUtil.cpp:1649
#24 0x00000001072b5f44 in clang::BackendConsumer::HandleTranslationUnit
(this=0x112766510, C=...)
    at /home/aik/p/llvm-project/clang/lib/CodeGen/CodeGenAction.cpp:334
#25 0x0000000109d2810c in clang::ParseAST (S=..., PrintStats=false,
SkipFunctionBodies=false)
    at /home/aik/p/llvm-project/clang/lib/Parse/ParseAST.cpp:171
#26 0x000000010640687c in clang::ASTFrontendAction::ExecuteAction
(this=0x1127a8530)
    at /home/aik/p/llvm-project/clang/lib/Frontend/FrontendAction.cpp:1056
#27 0x00000001072b1378 in clang::CodeGenAction::ExecuteAction
(this=0x1127a8530)
    at /home/aik/p/llvm-project/clang/lib/CodeGen/CodeGenAction.cpp:1038
#28 0x0000000106405eb0 in clang::FrontendAction::Execute (this=0x1127a8530)
    at /home/aik/p/llvm-project/clang/lib/Frontend/FrontendAction.cpp:949
#29 0x00000001062f6e90 in clang::CompilerInstance::ExecuteAction
(this=0x11279e390, Act=...)
    at /home/aik/p/llvm-project/clang/lib/Frontend/CompilerInstance.cpp:960
#30 0x00000001066616e4 in clang::ExecuteCompilerInvocation (Clang=0x11279e390)
    at
/home/aik/p/llvm-project/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:278
#31 0x0000000102a45b30 in cc1_main (Argv=..., Argv0=0x7fffffffed35
"/mnt/sdb/pbuild/llvm-no-lto/bin/clang-13",
    MainAddr=0x102a2e23c <GetExecutablePath[abi:cxx11](char const*, bool)>)
    at /home/aik/p/llvm-project/clang/tools/driver/cc1_main.cpp:246
#32 0x0000000102a30148 in ExecuteCC1Tool (ArgV=...) at
/home/aik/p/llvm-project/clang/tools/driver/driver.cpp:338
#33 0x0000000102a30acc in main (Argc=112, Argv=0x7fffffffe648)
    at /home/aik/p/llvm-project/clang/tools/driver/driver.cpp:415
(gdb)
(gdb) p/x Size
$1 = 0x0
(gdb) p/x Store
$2 = 0x114a1e3e0
(gdb) p/x ByVal
$3 = 0x1

-- 
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/20210420/94cf50ca/attachment-0001.html>


More information about the llvm-bugs mailing list