public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: david@blue-labs.org
To: gcc-gnats@gcc.gnu.org
Subject: c/4552: case statement "without range" causes gcc to quickly eat all memory
Date: Fri, 12 Oct 2001 01:36:00 -0000	[thread overview]
Message-ID: <20011012082757.2716.qmail@sourceware.cygnus.com> (raw)

>Number:         4552
>Category:       c
>Synopsis:       case statement "without range" causes gcc to quickly eat all memory
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Oct 12 01:36:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     David Ford <david@blue-labs.org>
>Release:        /home/gccbuild/gcc_auto_build/install/i686-pc-linux-gnu/lib/gcc-lib/i686-pc-linux-gnu/3.0.2
>Organization:
>Environment:
Linux 2.4.10 with GLIBC 2.2.4
>Description:
a case X ... Y where X and Y have either no range or invalid range, a gcc subprocess has an argv[0] of garbage and that process consumes memory at an alarming rate.

gcc -c -DVERSION=0.2.5 -fpic -g3  -DDEBUG=0 -DSQLPostgres -pipe -Wall -W -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline -Wcast-align  -I/usr/local/pgsql/include -I/usr/local/include startup.c
startup.c: In function `parse_options':
startup.c:298: warning: empty range specified

david    25964  0.0  0.1  1468  488 pts/20   S    Oct06   0:00 gcc -c -DVERSION=0.2.5 -fpic -g3 -DDEBUG=0 -DSQLPostgres -pipe -Wall 
david    25965  0.0 84.9 217824 215608 pts/20 R   Oct06   0:03 A@??A@??A@??A@??A@
david    25966  0.0  0.3  2248  988 pts/20   S    Oct06   0:00 as --traditional-format -Qy -o startup.o -

david    26058  0.0  0.3  1764  784 pts/20   S    Oct06   0:00  |       \_ make startup.o
david    26062  0.0  0.2  1472  548 pts/20   S    Oct06   0:00  |           \_ gcc -c -DVERSION=0.2.5 -fpic -g3 -DDEBUG=0 -DSQLPostg
david    26064  0.0  1.3  6344 3468 pts/20   R    Oct06   0:00  |               \_ /home/gccbuild/gcc_auto_build/install/i686-pc-lin

becomes...

david    26064  0.0 87.6 224312 222372 pts/20 D   Oct06   0:03  |               \_ D@0?D@@?D@P?D@`?D@p?D@??D@??D@??D@??D@??D@??D@??D


 switch (c) ... where c is an unsigned integer.

startup.c:298             case o_ADD_USER ... o_OPTIONMAX:

enum {  o_NONE=0, /*skip the lower 256 bits to allow for single char matches*/ 
        o_ADD_USER=1<<8, o_CHECK_CONFIG=1<<9, o_CONVERT_TO_SQL=1<<10,
        o_CREATE_LIST=1<<11, o_CREATE_TABLES=1<<12, o_HELP=1<<13,
        o_IMPORT_MESSAGE=1<<14, o_INITIALIZE_SQL=1<<15, o_MAINTENANCE=1<<16,   
        o_MAKE_DIGESTS=1<<17, o_VERSION=1<<18, o_LISTNAME=1<<19,
        o_LISTGROUP=1<<20, o_LIST_VALUES=1<<21,
        o_OPTIONMAX=1<<31
};

>How-To-Repeat:
I believe any test case utilizing a bad range will suffice.
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


             reply	other threads:[~2001-10-12  1:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-12  1:36 david [this message]
2002-02-20  9:16 jakub
2002-02-20 11:00 David Ford
2002-11-29 20:46 bangerth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20011012082757.2716.qmail@sourceware.cygnus.com \
    --to=david@blue-labs.org \
    --cc=gcc-gnats@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).