This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/12452] New: segfault with (almost) all warnings enabled


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12452

           Summary: segfault with (almost) all warnings enabled
           Product: gcc
           Version: 3.2.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jwoolley at apache dot org
                CC: gcc-bugs at gcc dot gnu dot org

I decided to try building HEAD of Apache 2.1-dev, which includes PCRE, with 
almost all of the warnings enabled just for kicks.  When I added a ton of 
extra -W... options, I got a segfault in cc1 while compiling pcre.c.  I 
removed the -W... options one at a time until I narrowed it down to 
-Wunreachable-code that was causing the segfault.  The complete preprocessed 
source for that file is available at http://www.apache.org/~jwoolley/pcre.i 
and the compiler output and a backtrace (to the extent that it's useful) 
follows. 
 
----------------------------------------------------------- 
root@deepthought:/root/apache/httpd-2.1/srclib/pcre# gcc -v -save-temps 
-Wunreachable-code  -DLINUX=2 -D_REENTRANT -D_XOPEN_SOURCE=500 -D_BSD_SOURCE 
-D_SVID_SOURCE -D_GNU_SOURCE -DAP_DEBUG -DAP_HAVE_DESIGNATED_INITIALIZER   -I/
root/apache/httpd-2.1/srclib/apr/include -I/root/apache/httpd-2.1/srclib/
apr-util/include -I. -I/root/apache/httpd-2.1/os/unix -I/root/apache/
httpd-2.1/server/mpm/experimental/threadpool -I/root/apache/httpd-2.1/modules/
http -I/root/apache/httpd-2.1/modules/filters -I/root/apache/httpd-2.1/
modules/proxy -I/root/apache/httpd-2.1/include -I/root/apache/httpd-2.1/
modules/generators -I/usr/include -I/root/apache/httpd-2.1/modules/dav/main 
-prefer-non-pic -static -c pcre.c 
Reading specs from /usr/lib/gcc-lib/i486-slackware-linux/3.2.3/specs 
gcc: unrecognized option `-prefer-non-pic' 
Configured with: ../gcc-3.2.3/configure --prefix=/usr --enable-shared 
--enable-threads=posix --enable-__cxa_atexit --disable-checking --with-gnu-ld 
--verbose --target=i486-slackware-linux --host=i486-slackware-linux 
Thread model: posix 
gcc version 3.2.3 
 /usr/lib/gcc-lib/i486-slackware-linux/3.2.3/cpp0 -lang-c -v -I/root/apache/
httpd-2.1/srclib/apr/include -I/root/apache/httpd-2.1/srclib/apr-util/include 
-I. -I/root/apache/httpd-2.1/os/unix -I/root/apache/httpd-2.1/server/mpm/
experimental/threadpool -I/root/apache/httpd-2.1/modules/http -I/root/apache/
httpd-2.1/modules/filters -I/root/apache/httpd-2.1/modules/proxy -I/root/
apache/httpd-2.1/include -I/root/apache/httpd-2.1/modules/generators -I/usr/
include -I/root/apache/httpd-2.1/modules/dav/main -D__GNUC__=3 
-D__GNUC_MINOR__=2 -D__GNUC_PATCHLEVEL__=3 -D__GXX_ABI_VERSION=102 -D__ELF__ 
-Dunix -D__gnu_linux__ -Dlinux -D__ELF__ -D__unix__ -D__gnu_linux__ 
-D__linux__ -D__unix -D__linux -Asystem=posix -D__NO_INLINE__ 
-D__STDC_HOSTED__=1 -Acpu=i386 -Amachine=i386 -Di386 -D__i386 -D__i386__ 
-D__tune_i486__ -DLINUX=2 -D_REENTRANT -D_XOPEN_SOURCE=500 -D_BSD_SOURCE 
-D_SVID_SOURCE -D_GNU_SOURCE -DAP_DEBUG -DAP_HAVE_DESIGNATED_INITIALIZER 
pcre.c -Wunreachable-code pcre.i 
GNU CPP version 3.2.3 (cpplib) (i386 Linux/ELF) 
ignoring nonexistent directory "/usr/i486-slackware-linux/include" 
ignoring duplicate directory "/usr/include" 
  as it is a non-system directory that duplicates a system directory 
#include "..." search starts here: 
#include <...> search starts here: 
 /root/apache/httpd-2.1/srclib/apr/include 
 /root/apache/httpd-2.1/srclib/apr-util/include 
 . 
 /root/apache/httpd-2.1/os/unix 
 /root/apache/httpd-2.1/server/mpm/experimental/threadpool 
 /root/apache/httpd-2.1/modules/http 
 /root/apache/httpd-2.1/modules/filters 
 /root/apache/httpd-2.1/modules/proxy 
 /root/apache/httpd-2.1/include 
 /root/apache/httpd-2.1/modules/generators 
 /root/apache/httpd-2.1/modules/dav/main 
 /usr/local/include 
 /usr/lib/gcc-lib/i486-slackware-linux/3.2.3/include 
 /usr/include 
End of search list. 
 /usr/lib/gcc-lib/i486-slackware-linux/3.2.3/cc1 -fpreprocessed pcre.i -quiet 
-dumpbase pcre.c -Wunreachable-code -version -o pcre.s 
GNU CPP version 3.2.3 (cpplib) (i386 Linux/ELF) 
GNU C version 3.2.3 (i486-slackware-linux) 
        compiled by GNU C version 3.2.3. 
pcre.c: In function `is_anchored': 
pcre.c:2359: internal error: Segmentation fault 
Please submit a full bug report, 
with preprocessed source if appropriate. 
See <URL:http://gcc.gnu.org/bugs.html> for instructions. 
----------------------------------------------------------- 
root@deepthought:/root/apache/httpd-2.1/srclib/pcre# gdb /usr/lib/gcc-lib/
i486-slackware-linux/3.2.3/cc1 
GNU gdb 5.3 
Copyright 2002 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 "i386-slackware-linux"... 
(no debugging symbols found)... 
(gdb) run  -fpreprocessed pcre.i -quiet -dumpbase pcre.c -Wunreachable-code 
-version -o pcre.s 
Starting program: /usr/lib/gcc-lib/i486-slackware-linux/3.2.3/cc1 
-fpreprocessed pcre.i -quiet -dumpbase pcre.c -Wunreachable-code -version -o 
pcre.s 
GNU CPP version 3.2.3 (cpplib) (i386 Linux/ELF) 
GNU C version 3.2.3 (i486-slackware-linux) 
        compiled by GNU C version 3.2.3. 
 
Program received signal SIGSEGV, Segmentation fault. 
0x0816f2d0 in error () 
(gdb) bt 
#0  0x0816f2d0 in error () 
#1  0x0808dc08 in strcpy () 
#2  0x0808dd21 in strcpy () 
#3  0x081f27b6 in error () 
#4  0x081f2c6f in error () 
#5  0x081c55ff in error () 
#6  0x08058e57 in strcpy () 
#7  0x08058c1d in strcpy () 
#8  0x08049e79 in strcpy () 
#9  0x081c4393 in error () 
#10 0x081c8c95 in error () 
#11 0x081c8d15 in error () 
#12 0x0807e439 in strcpy () 
#13 0x40044d06 in __libc_start_main () from /lib/libc.so.6


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]