Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-dev: [Wireshark-dev] clang core dump on plugins/giop/packet-parlay.c

From: Stephen Fisher <steve@xxxxxxxxxxxxxxxxxx>
Date: Thu, 21 Apr 2011 13:30:07 -0600
I'm trying again to get clang to compile Wireshark and after commenting 
out these two lines in configure.in temporarily:

    AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wcast-align)
    AC_WIRESHARK_GCC_CFLAGS_CHECK(-fexcess-precision=fast)

It gets all of the way to plugins/giop/packet-parlay.c and then clang 
core dumps!  Is anyone else having this problem?  This is a FreeBSD 
8.2-RELEASE (amd64) system.  It probably doesn't help that 
packet-parlay.c is 108,692 lines long...


Making all in giop
gmake[3]: Entering directory 
`/usr/local/src/wireshark-clang/plugins/giop'
/bin/bash ../../libtool  --tag=CC   --mode=compile clang -DHAVE_CONFIG_H 
-I. -I../.. -I../..  -I/usr/local/include -I/usr/include/pcap 
-I/usr/include  '-DPLUGIN_DIR="/usr/local/lib/wireshark/plugins/1.5.2"'  
-DINET6 -D_U_="__attribute__((unused))" -g -O2 -Wall -W 
-Werror=unknown-warning-option -Wextra -Werror=unknown-warning-option 
-Wdeclaration-after-statement -Werror=unknown-warning-option 
-Wendif-labels -Werror=unknown-warning-option -Wpointer-arith 
-Werror=unknown-warning-option -Wno-pointer-sign 
-Werror=unknown-warning-option -Wformat-security 
-Werror=unknown-warning-option -I/usr/local/include -D_THREAD_SAFE 
-D_REENTRANT -I/usr/local/include/gtk-2.0 
-I/usr/local/lib/gtk-2.0/include -I/usr/local/include/atk-1.0 
-I/usr/local/include/cairo -I/usr/local/include/gdk-pixbuf-2.0 
-I/usr/local/include/pango-1.0 -I/usr/local/include/gio-unix-2.0/ 
-I/usr/local/include -I/usr/local/include/glib-2.0 
-I/usr/local/lib/glib-2.0/include -I/usr/local/include/pixman-1 
-I/usr/local/include/freetype2   -I/usr/include/pcap -I/usr/include  -MT 
packet-parlay.lo -MD -MP -MF .deps/packet-parlay.Tpo -c -o 
packet-parlay.lo packet-parlay.c
libtool: compile:  clang -DHAVE_CONFIG_H -I. -I../.. -I../.. 
-I/usr/local/include -I/usr/include/pcap -I/usr/include 
-DPLUGIN_DIR=\"/usr/local/lib/wireshark/plugins/1.5.2\" -DINET6 
"-D_U_=__attribute__((unused))" -g -O2 -Wall -W 
-Werror=unknown-warning-option -Wextra -Werror=unknown-warning-option 
-Wdeclaration-after-statement -Werror=unknown-warning-option 
-Wendif-labels -Werror=unknown-warning-option -Wpointer-arith 
-Werror=unknown-warning-option -Wno-pointer-sign 
-Werror=unknown-warning-option -Wformat-security 
-Werror=unknown-warning-option -I/usr/local/include -D_THREAD_SAFE 
-D_REENTRANT -I/usr/local/include/gtk-2.0 
-I/usr/local/lib/gtk-2.0/include -I/usr/local/include/atk-1.0 
-I/usr/local/include/cairo -I/usr/local/include/gdk-pixbuf-2.0 
-I/usr/local/include/pango-1.0 -I/usr/local/include/gio-unix-2.0/ 
-I/usr/local/include -I/usr/local/include/glib-2.0 
-I/usr/local/lib/glib-2.0/include -I/usr/local/include/pixman-1 
-I/usr/local/include/freetype2 -I/usr/include/pcap -I/usr/include -MT 
packet-parlay.lo -MD -MP -MF .deps/packet-parlay.Tpo -c packet-parlay.c  
-fPIC -DPIC -o .libs/packet-parlay.o
packet-parlay.c:85746:13: warning: unused function 
'decode_org_csapi_fw_TpLoadPolicy_st' [-Wunused-function]
static void decode_org_csapi_fw_TpLoadPolicy_st(tvbuff_t *tvb _U_, 
packet_info *pinfo _U_, proto_tree *tree _U_, int *offset _U_, 
MessageHeader ...
            ^
packet-parlay.c:85824:13: warning: unused function 
'decode_org_csapi_fw_TpLoadInitVal_st' [-Wunused-function]
static void decode_org_csapi_fw_TpLoadInitVal_st(tvbuff_t *tvb _U_, 
packet_info *pinfo _U_, proto_tree *tree _U_, int *offset _U_, 
MessageHeader ...
            ^
clang: error: clang frontend command failed due to signal 4 (use -v to 
see invocation)
gmake[3]: *** [packet-parlay.lo] Error 1
gmake[3]: Leaving directory 
`/usr/local/src/wireshark-clang/plugins/giop'
gmake[2]: *** [all-recursive] Error 1
gmake[2]: Leaving directory `/usr/local/src/wireshark-clang/plugins'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/usr/local/src/wireshark-clang'
gmake: *** [all] Error 2

>gdb clang plugins/giop/clang.core
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you 
are
welcome to change it and/or distribute copies of it under certain 
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for 
details.
This GDB was configured as "amd64-marcel-freebsd"...(no debugging 
symbols found)...
Core was generated by `clang'.
Program terminated with signal 4, Illegal instruction.
Reading symbols from /lib/libthr.so.3...(no debugging symbols 
found)...done.
Loaded symbols for /lib/libthr.so.3
Reading symbols from /usr/lib/libstdc++.so.6...(no debugging symbols 
found)...done.
Loaded symbols for /usr/lib/libstdc++.so.6
Reading symbols from /lib/libm.so.5...(no debugging symbols 
found)...done.
Loaded symbols for /lib/libm.so.5
Reading symbols from /lib/libgcc_s.so.1...(no debugging symbols 
found)...done.
Loaded symbols for /lib/libgcc_s.so.1
Reading symbols from /lib/libc.so.7...(no debugging symbols 
found)...done.
Loaded symbols for /lib/libc.so.7
Reading symbols from /libexec/ld-elf.so.1...(no debugging symbols 
found)...done.
Loaded symbols for /libexec/ld-elf.so.1
#0  0x000000000152326f in llvm::LazyValueInfo::getConstant ()
[New Thread 8024041c0 (LWP 100063)]
(gdb) bt 5
#0  0x000000000152326f in llvm::LazyValueInfo::getConstant ()
#1  0x0000000001524c42 in llvm::LazyValueInfo::getConstant ()
#2  0x0000000001523508 in llvm::LazyValueInfo::getConstant ()
#3  0x0000000001524c42 in llvm::LazyValueInfo::getConstant ()
#4  0x0000000001523508 in llvm::LazyValueInfo::getConstant ()
(More stack frames follow...)
(gdb)