[llvm-bugs] [Bug 37130] New: StackColoring Segfault

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Apr 13 17:15:58 PDT 2018


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

            Bug ID: 37130
           Summary: StackColoring Segfault
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: mascasa at google.com
                CC: llvm-bugs at lists.llvm.org

Starting two weeks ago, we started getting segfaults while compiling libmwaw on
OSS-Fuzz: 
https://github.com/google/oss-fuzz/issues/1279#issuecomment-381239577.

Seems to be coming from StackColoring:

#0 0x000000000149008a llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/usr/local/bin/clang-7.0+0x149008a)
#1 0x000000000148e16e llvm::sys::RunSignalHandlers()
(/usr/local/bin/clang-7.0+0x148e16e)
#2 0x000000000148e2bc SignalHandler(int) (/usr/local/bin/clang-7.0+0x148e2bc)
#3 0x00007ffbbfeb6390 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x11390)
#4 0x0000000000f1209a (anonymous
namespace)::StackColoring::runOnMachineFunction(llvm::MachineFunction&)
(/usr/local/bin/clang-7.0+0xf1209a)
#5 0x0000000000ce5631 llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
(/usr/local/bin/clang-7.0+0xce5631)
#6 0x000000000101ae5a llvm::FPPassManager::runOnFunction(llvm::Function&)
(/usr/local/bin/clang-7.0+0x101ae5a)
#7 0x000000000101af03 llvm::FPPassManager::runOnModule(llvm::Module&)
(/usr/local/bin/clang-7.0+0x101af03)
#8 0x000000000101aa14 llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/usr/local/bin/clang-7.0+0x101aa14)
#9 0x000000000165d5ee (anonymous
namespace)::EmitAssemblyHelper::EmitAssembly(clang::BackendAction,
std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >)
(/usr/local/bin/clang-7.0+0x165d5ee)
#10 0x000000000165f6c2 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_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >)
(/usr/local/bin/clang-7.0+0x165f6c2)
#11 0x0000000001d41394
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(/usr/local/bin/clang-7.0+0x1d41394)
#12 0x000000000253d7a0 clang::ParseAST(clang::Sema&, bool, bool)
(/usr/local/bin/clang-7.0+0x253d7a0)
#13 0x0000000001d40977 clang::CodeGenAction::ExecuteAction()
(/usr/local/bin/clang-7.0+0x1d40977)
#14 0x0000000001a2b96e clang::FrontendAction::Execute()
(/usr/local/bin/clang-7.0+0x1a2b96e)
#15 0x00000000019f70e6
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/usr/local/bin/clang-7.0+0x19f70e6)
#16 0x0000000001abf02c
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/usr/local/bin/clang-7.0+0x1abf02c)
#17 0x00000000008a8c98 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/usr/local/bin/clang-7.0+0x8a8c98)
#18 0x0000000000854191 main (/usr/local/bin/clang-7.0+0x854191)
#19 0x00007ffbbf056830 __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x20830)
#20 0x00000000008a63c9 _start (/usr/local/bin/clang-7.0+0x8a63c9)

Stack dump:
0.      Program arguments: /usr/local/bin/clang-7.0 -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -disable-free -disable-llvm-verifier
-discard-value-names -main-file-name FullWrtText.cxx -mrelocation-model pic
-pic-level 2 -mthread-model posix -mdisable-fp-elim -fmath-errno -masm-verbose
-mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64
-dwarf-column-info -debug-info-kind=line-tables-only -dwarf-version=4
-debugger-tuning=gdb -momit-leaf-frame-pointer -coverage-notes-file
/src/libmwaw/src/lib/FullWrtText.gcno -resource-dir /usr/local/lib/clang/7.0.0
-dependency-file .deps/FullWrtText.Tpo -sys-header-deps -MP -MT FullWrtText.lo
-D HAVE_CONFIG_H -I . -I ../.. -I /src/boost_1_66_0 -I ../../inc -I
/src/librevenge/inc -D NDEBUG -D FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -D
LIBMWAW_VISIBILITY -D PIC -internal-isystem /usr/local/bin/../include/c++/v1
-internal-isystem /usr/local/include -internal-isystem
/usr/local/lib/clang/7.0.0/include -internal-externc-isystem
/usr/include/x86_64-linux-gnu -internal-externc-isystem /include
-internal-externc-isystem /usr/include -O1 -Wall -Wextra -Wshadow
-Wunused-variable -Weffc++ -pedantic -fdeprecated-macro -fdebug-compilation-dir
/src/libmwaw/src/lib -ferror-limit 19 -fmessage-length 80 -fvisibility hidden
-fsanitize-coverage-type=1 -fsanitize-coverage-type=3
-fsanitize-coverage-indirect-calls -fsanitize-coverage-trace-cmp
-fsanitize-coverage-inline-8bit-counters -fsanitize-coverage-pc-table
-fsanitize-coverage-stack-depth -fsanitize=memory,fuzzer-no-link
-fsanitize-blacklist=/usr/local/lib/clang/7.0.0/share/msan_blacklist.txt
-fsanitize-memory-track-origins=2 -fsanitize-memory-use-after-dtor
-fno-assume-sane-operator-new -fobjc-runtime=gcc -fcxx-exceptions -fexceptions
-fdiagnostics-show-option -fcolor-diagnostics -o FullWrtText.o -x c++
FullWrtText.cxx 
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module 'FullWrtText.cxx'.
4.      Running pass 'Merge disjoint stack slots' on function
'@_ZN11FullWrtText12readTextDataENSt3__110shared_ptrIN13FullWrtStruct5EntryEEE'

clang-7.0: error: unable to execute command: Segmentation fault (core dumped)
clang-7.0: error: clang frontend command failed due to signal (use -v to see
invocation)

clang version 7.0.0 (trunk 328716)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin


Preprocessed source and reproducer script are attached.

-- 
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/20180414/f2a7e0d5/attachment.html>


More information about the llvm-bugs mailing list