public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/23125] New: OpenBSD's zic.c causes g++ but not gcc to segfault
@ 2005-07-29  3:25 flash at pobox dot com
  2005-07-29  3:50 ` [Bug c++/23125] " flash at pobox dot com
                   ` (11 more replies)
  0 siblings, 12 replies; 14+ messages in thread
From: flash at pobox dot com @ 2005-07-29  3:25 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 4313 bytes --]

The OpenBSD file zic.c causes g++ 4.0.1 to segfault, though plain gcc 4.0.1 does not.  The plainest 
way to reproduce this is to get the OpenBSD version from 
<http://www.openbsd.org/cgi-bin/cvsweb/~checkout~/src/lib/libc/time/zic.c?rev=1.24&content-
type=text/plain>, but I'll attach a Delta-reduced version of our modified copy.  g++ 3.3.4 rejects it 
without crashing, but with "confused by earlier errors, bailing out," so this is presumably invalid code, 
though it seems to be a popular file.  (Perhaps I should add OpenBSD to section I of my article :-)
    I'm not sure if this is the same as my two other segfault bugs:  Running the --enable-checking 
version under GDB fails to catch the segfault, so I couldn't get a stacktrace.  (I'm trying to build an --
enable-checking=all version, but it's taken more than twenty-four hours so far.)

Session:
74> /opt/gcc401chk/bin/g++ -v  ../cpp/bugfiles/GCC_bugfiles/error/105198_zic_min.c
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../configure --enable-checking --prefix=/opt/gcc401chk --enable-languages=c,c+
+
Thread model: posix
gcc version 4.0.1
 /opt/gcc401chk/libexec/gcc/i686-pc-linux-gnu/4.0.1/cc1plus -quiet -v -D_GNU_SOURCE ../cpp/
bugfiles/GCC_bugfiles/error/105198_zic_min.c -quiet -dumpbase 105198_zic_min.c -
mtune=pentiumpro -auxbase 105198_zic_min -version -o /tmp/ccGy60bj.s
ignoring nonexistent directory "/opt/gcc401chk/lib/gcc/i686-pc-linux-gnu/4.0.1/../../../../i686-pc-
linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /opt/gcc401chk/lib/gcc/i686-pc-linux-gnu/4.0.1/../../../../include/c++/4.0.1
 /opt/gcc401chk/lib/gcc/i686-pc-linux-gnu/4.0.1/../../../../include/c++/4.0.1/i686-pc-linux-gnu
 /opt/gcc401chk/lib/gcc/i686-pc-linux-gnu/4.0.1/../../../../include/c++/4.0.1/backward
 /usr/local/include
 /opt/gcc401chk/include
 /opt/gcc401chk/lib/gcc/i686-pc-linux-gnu/4.0.1/include
 /usr/include
End of search list.
GNU C++ version 4.0.1 (i686-pc-linux-gnu)
        compiled by GNU C version 3.3.4 (pre 3.3.5 20040809).
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
../cpp/bugfiles/GCC_bugfiles/error/105198_zic_min.c:1: error: expected unqualified-id before ‘{’ 
token
../cpp/bugfiles/GCC_bugfiles/error/105198_zic_min.c:31: error: expected unqualified-id before ‘{’ 
token
../cpp/bugfiles/GCC_bugfiles/error/105198_zic_min.c:36: error: expected unqualified-id before ‘{’ 
token
../cpp/bugfiles/GCC_bugfiles/error/105198_zic_min.c:37: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.



Delta-reduced file:
{
        if (sscanf(cp, scheck(cp, "%d"), &year) != 1) {
        }
        while (j != year) {
                if (year > j) {
                }
        }
        while (j != month) {
        }
        {
                if (strcmp(cp, "") == 0) { /* infile() turns "-" into "" */
                }
        }
        for (i = 0; i < zonecount; ++i) {
                if (zp->z_nrules == 0) {
                        if (usestart) {
                                if (useuntil) {
                                        if (k < 0 || jtime < ktime) {
                                        }
                                }
                                if (usestart) {
                                        if (ktime < starttime) {
                                        }
                                }
                        }
                }
                if (usestart) {
                }
        }
}
{
                (timecnt == 1 && attypes[0].at < min_time)) {
        }
}
int     a;
{
}
register const char *   bp;

PalmSource bug 105198.

-- 
           Summary: OpenBSD's zic.c causes g++ but not gcc to segfault
           Product: gcc
           Version: 4.0.1
            Status: UNCONFIRMED
          Severity: minor
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: flash at pobox dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2005-09-27 16:25 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-07-29  3:25 [Bug c++/23125] New: OpenBSD's zic.c causes g++ but not gcc to segfault flash at pobox dot com
2005-07-29  3:50 ` [Bug c++/23125] " flash at pobox dot com
2005-07-29  5:04 ` flash at pobox dot com
2005-07-29  5:35 ` [Bug c++/23125] [4.0/4.1 Regression] " pinskia at gcc dot gnu dot org
2005-09-10  3:29 ` pinskia at gcc dot gnu dot org
2005-09-10  3:30 ` [Bug middle-end/23125] " pinskia at gcc dot gnu dot org
2005-09-10  4:41 ` pinskia at gcc dot gnu dot org
2005-09-10  4:56 ` pinskia at gcc dot gnu dot org
2005-09-10 20:34 ` geoffk at geoffk dot org
2005-09-11 15:40   ` Andrew Pinski
2005-09-11 15:40 ` pinskia at physics dot uc dot edu
2005-09-14  6:32 ` pinskia at gcc dot gnu dot org
2005-09-16 19:39 ` mrs at apple dot com
2005-09-27 16:25 ` mmitchel at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).