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

            Bug ID: 37069
           Summary: Crash compiling wireshark's lemon
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangb...@nondot.org
          Reporter: lom...@gmail.com
                CC: llvm-bugs@lists.llvm.org

Created attachment 20178
  --> https://bugs.llvm.org/attachment.cgi?id=20178&action=edit
See report.

During the standard compilation of wireshark, clang crashed. I turned out that
the source file was Wireshark's version of lemon:

https://code.wireshark.org/review/gitweb?p=wireshark.git;a=blob;f=tools/lemon/lemon.c;h=35ffe8ce91ee646c9a6e9cfae0a10275b506229a;hb=HEAD

[1/2] /usr/bin/clang-7  -DG_DISABLE_DEPRECATED -DG_DISABLE_SINGLE_INCLUDES -I.
-I../ -isystem /usr/include/glib-2.0 -isystem
/usr/lib/x86_64-linux-gnu/glib-2.0/include -isystem /usr/include/lua5.2
-isystem /usr/include/libxml2 -isystem /usr/include/libnl3 -isystem
/usr/include/x86_64-linux-gnu/qt5 -isystem
/usr/include/x86_64-linux-gnu/qt5/QtCore -isystem
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64 -isystem
/usr/include/x86_64-linux-gnu/qt5/QtMultimedia -isystem
/usr/include/x86_64-linux-gnu/qt5/QtNetwork -isystem
/usr/include/x86_64-linux-gnu/qt5/QtGui -isystem
/usr/include/x86_64-linux-gnu/qt5/QtPrintSupport -isystem
/usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem
/usr/include/x86_64-linux-gnu/qt5/QtSvg -isystem /usr/include/x86_64-linux-gnu
-fvisibility=hidden  -Wall -Wextra -Wendif-labels -Wpointer-arith
-Wformat-security -fwrapv -fno-strict-overflow -Wvla -Waddress -Wattributes
-Wdiv-by-zero -Wignored-qualifiers -Wpragmas -Wno-overlength-strings
-Wno-long-long -Wheader-guard -Wframe-larger-than=16384 -Wc++-compat
-Wunused-const-variable -Wshadow -Wno-pointer-sign -Wold-style-definition
-Wstrict-prototypes -Wshorten-64-to-32 -Werror=implicit -Wcomma 
-Qunused-arguments -std=gnu99  -O2 -g -DNDEBUG -fPIE   -Werror -MMD -MT
tools/lemon/CMakeFiles/lemon.dir/lemon.c.o -MF
tools/lemon/CMakeFiles/lemon.dir/lemon.c.o.d -o
tools/lemon/CMakeFiles/lemon.dir/lemon.c.o   -c ../tools/lemon/lemon.c
FAILED: /usr/bin/clang-7  -DG_DISABLE_DEPRECATED -DG_DISABLE_SINGLE_INCLUDES
-I. -I../ -isystem /usr/include/glib-2.0 -isystem
/usr/lib/x86_64-linux-gnu/glib-2.0/include -isystem /usr/include/lua5.2
-isystem /usr/include/libxml2 -isystem /usr/include/libnl3 -isystem
/usr/include/x86_64-linux-gnu/qt5 -isystem
/usr/include/x86_64-linux-gnu/qt5/QtCore -isystem
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64 -isystem
/usr/include/x86_64-linux-gnu/qt5/QtMultimedia -isystem
/usr/include/x86_64-linux-gnu/qt5/QtNetwork -isystem
/usr/include/x86_64-linux-gnu/qt5/QtGui -isystem
/usr/include/x86_64-linux-gnu/qt5/QtPrintSupport -isystem
/usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem
/usr/include/x86_64-linux-gnu/qt5/QtSvg -isystem /usr/include/x86_64-linux-gnu
-fvisibility=hidden  -Wall -Wextra -Wendif-labels -Wpointer-arith
-Wformat-security -fwrapv -fno-strict-overflow -Wvla -Waddress -Wattributes
-Wdiv-by-zero -Wignored-qualifiers -Wpragmas -Wno-overlength-strings
-Wno-long-long -Wheader-guard -Wframe-larger-than=16384 -Wc++-compat
-Wunused-const-variable -Wshadow -Wno-pointer-sign -Wold-style-definition
-Wstrict-prototypes -Wshorten-64-to-32 -Werror=implicit -Wcomma 
-Qunused-arguments -std=gnu99  -O2 -g -DNDEBUG -fPIE   -Werror -MMD -MT
tools/lemon/CMakeFiles/lemon.dir/lemon.c.o -MF
tools/lemon/CMakeFiles/lemon.dir/lemon.c.o.d -o
tools/lemon/CMakeFiles/lemon.dir/lemon.c.o   -c ../tools/lemon/lemon.c
#0 0x00007fad4c2b927a llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/usr/lib/x86_64-linux-gnu/libLLVM-7.so.1+0x8c827a)
#1 0x00007fad4c2b743e llvm::sys::RunSignalHandlers()
(/usr/lib/x86_64-linux-gnu/libLLVM-7.so.1+0x8c643e)
#2 0x00007fad4c2b758c (/usr/lib/x86_64-linux-gnu/libLLVM-7.so.1+0x8c658c)
#3 0x00007fad4f5ed390 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x11390)
#4 0x00007fad4cc9a2a1 (/usr/lib/x86_64-linux-gnu/libLLVM-7.so.1+0x12a92a1)
#5 0x00007fad4cc9d799 (/usr/lib/x86_64-linux-gnu/libLLVM-7.so.1+0x12ac799)
#6 0x00007fad4c38b462 llvm::FPPassManager::runOnFunction(llvm::Function&)
(/usr/lib/x86_64-linux-gnu/libLLVM-7.so.1+0x99a462)
#7 0x00007fad4d031a5e (/usr/lib/x86_64-linux-gnu/libLLVM-7.so.1+0x1640a5e)
#8 0x00007fad4c38b0af llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/usr/lib/x86_64-linux-gnu/libLLVM-7.so.1+0x99a0af)
#9 0x00000000007a02ae 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/lib/llvm-7/bin/clang+0x7a02ae)
#10 0x0000000000cf3064 (/usr/lib/llvm-7/bin/clang+0xcf3064)
#11 0x00000000011a6060 clang::ParseAST(clang::Sema&, bool, bool)
(/usr/lib/llvm-7/bin/clang+0x11a6060)
#12 0x0000000000cf2797 clang::CodeGenAction::ExecuteAction()
(/usr/lib/llvm-7/bin/clang+0xcf2797)
#13 0x0000000000b564de clang::FrontendAction::Execute()
(/usr/lib/llvm-7/bin/clang+0xb564de)
#14 0x0000000000b21a16
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/usr/lib/llvm-7/bin/clang+0xb21a16)
#15 0x0000000000be0552
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/usr/lib/llvm-7/bin/clang+0xbe0552)
#16 0x00000000007543e8 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/usr/lib/llvm-7/bin/clang+0x7543e8)
#17 0x0000000000740917 main (/usr/lib/llvm-7/bin/clang+0x740917)
#18 0x00007fad4ab6e830 __libc_start_main
/build/glibc-Cl5G7W/glibc-2.23/csu/../csu/libc-start.c:325:0
#19 0x0000000000751dc9 _start (/usr/lib/llvm-7/bin/clang+0x751dc9)
Stack dump:
0.      Program arguments: /usr/lib/llvm-7/bin/clang -cc1 -triple
x86_64-pc-linux-gnu -emit-obj -disable-free -disable-llvm-verifier
-discard-value-names -main-file-name lemon.c -mrelocation-model pic -pic-level
2 -pic-is-pie -mthread-model posix -mllvm -warn-stack-size=16384 -fmath-errno
-masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array
-target-cpu x86-64 -dwarf-column-info -debug-info-kind=limited -dwarf-version=4
-debugger-tuning=gdb -momit-leaf-frame-pointer -coverage-notes-file
/home/dario/projects/wireshark/build-clang/tools/lemon/CMakeFiles/lemon.dir/lemon.c.gcno
-resource-dir /usr/lib/llvm-7/lib/clang/7.0.0 -dependency-file
tools/lemon/CMakeFiles/lemon.dir/lemon.c.o.d -MT
tools/lemon/CMakeFiles/lemon.dir/lemon.c.o -isystem /usr/include/glib-2.0
-isystem /usr/lib/x86_64-linux-gnu/glib-2.0/include -isystem
/usr/include/lua5.2 -isystem /usr/include/libxml2 -isystem /usr/include/libnl3
-isystem /usr/include/x86_64-linux-gnu/qt5 -isystem
/usr/include/x86_64-linux-gnu/qt5/QtCore -isystem
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64 -isystem
/usr/include/x86_64-linux-gnu/qt5/QtMultimedia -isystem
/usr/include/x86_64-linux-gnu/qt5/QtNetwork -isystem
/usr/include/x86_64-linux-gnu/qt5/QtGui -isystem
/usr/include/x86_64-linux-gnu/qt5/QtPrintSupport -isystem
/usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem
/usr/include/x86_64-linux-gnu/qt5/QtSvg -isystem /usr/include/x86_64-linux-gnu
-D G_DISABLE_DEPRECATED -D G_DISABLE_SINGLE_INCLUDES -I . -I ../ -D NDEBUG
-internal-isystem /usr/local/include -internal-isystem
/usr/lib/llvm-7/lib/clang/7.0.0/include -internal-externc-isystem
/usr/include/x86_64-linux-gnu -internal-externc-isystem /include
-internal-externc-isystem /usr/include -O2 -Wall -Wextra -Wendif-labels
-Wpointer-arith -Wformat-security -Wvla -Waddress -Wattributes -Wdiv-by-zero
-Wignored-qualifiers -Wpragmas -Wno-overlength-strings -Wno-long-long
-Wheader-guard -Wc++-compat -Wunused-const-variable -Wshadow -Wno-pointer-sign
-Wold-style-definition -Wstrict-prototypes -Wshorten-64-to-32 -Werror=implicit
-Wcomma -Werror -std=gnu99 -fdebug-compilation-dir
/home/dario/projects/wireshark/build-clang -ferror-limit 19 -fmessage-length 0
-fvisibility hidden -fwrapv -fobjc-runtime=gcc -fdiagnostics-show-option
-vectorize-loops -vectorize-slp -o tools/lemon/CMakeFiles/lemon.dir/lemon.c.o
-x c ../tools/lemon/lemon.c 
1.      <eof> parser at end of file
2.      Per-module optimization passes
3.      Running pass 'CallGraph Pass Manager' on module
'../tools/lemon/lemon.c'.
4.      Running pass 'Value Propagation' on function '@Parse'
clang: error: unable to execute command: Segmentation fault (core dumped)
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 7.0.0- (trunk)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
clang: note: diagnostic msg: PLEASE submit a bug report to
https://bugs.llvm.org/ and include the crash backtrace, preprocessed source,
and associated run script.
clang: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /tmp/lemon-57a576.c
clang: note: diagnostic msg: /tmp/lemon-57a576.sh
clang: note: diagnostic msg: 

********************
ninja: build stopped: subcommand failed.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to