public inbox for gnats-prs@sourceware.org
help / color / mirror / Atom feed
* gnats/1: Error in gnatsd.c
@ 1999-08-30  0:34 andrew.ruthven
  0 siblings, 0 replies; only message in thread
From: andrew.ruthven @ 1999-08-30  0:34 UTC (permalink / raw)
  To: gnats-gnats

>Number:         1
>Category:       gnats
>Synopsis:       Error in gnatsd.c
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    jsm
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Aug 30 00:34:01 PDT 1999
>Closed-Date:
>Last-Modified:
>Originator:     Andrew Ruthven
>Release:        Gnats 3.111
>Organization:
>Environment:
Redhat Linux 6.0
>Description:
When trying to run a query via nquery-pr (or telneting to
the gnatsd port, or when running it by hand) it is possible
to select a database and login but not to perform a query.

gnatsd never returns when used via the network, when run
by hand (using --not-inetd) it seg faults.
>How-To-Repeat:
Just run it...
>Fix:
Add:
FILE *outfile;

Somewhere towards the top of gnatsd.c and then do:
outfile = stdout;

In main() of gnatsd.c.  I haven't bothered attaching a
patch since you'll probably want to put this elsewhere in
the code...
>Release-Note:
>Audit-Trail:
>Unformatted:
>From andrew.ruthven@chelmer.co.nz Mon Aug 30 00:44:00 1999
From: andrew.ruthven@chelmer.co.nz
To: gnats-gnats@sourceware.cygnus.com
Subject: gnats/2: Trying to access freed memory in file-pr.c
Date: Mon, 30 Aug 1999 00:44:00 -0000
Message-id: <19990830074200.15047.qmail@egcs.cygnus.com>
X-SW-Source: 1999-q3/msg00001.html
Content-length: 1150

>Number:         2
>Category:       gnats
>Synopsis:       Trying to access freed memory in file-pr.c
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    jsm
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Aug 30 00:44:01 PDT 1999
>Closed-Date:
>Last-Modified:
>Originator:     Andrew Ruthven
>Release:        Gnats 3.111
>Organization:
>Environment:
Redhat Linux 6.0
>Description:
In file-pr.c (at about line 747) a strrchr is being called
on xnotify.  Now, xnotify had xfree called on it about 5
lines earlier.

This causes a seg fault while tring to process new bugs.
>How-To-Repeat:

>Fix:
Swallow that strrchr (and the gobbling of the \n) up into
the if which checks to see if xnotify exists, and more the
xfree to several lines further down.

Looking back at the code again, I'm slightly confused.  I
believe that strrchr is being called on the wrong variable.
Surely if it is supposed to be on xnotify, it should be
before the strcat (on line 741) since xnotify is never
used again.  It's quite possible I've missed something.
>Release-Note:
>Audit-Trail:
>Unformatted:
>From rickmacd@home.com Tue Sep 07 15:54:00 1999
From: Rick Macdonald <rickmacd@home.com>
To: jsm@cygnus.com
Cc: gnats-prs@sourceware.cygnus.com
Subject: Re: gnats/2
Date: Tue, 07 Sep 1999 15:54:00 -0000
Message-id: <19990907225404.4946.qmail@egcs.cygnus.com>
X-SW-Source: 1999-q3/msg00003.html
Content-length: 492

The following reply was made to PR gnats/2; it has been noted by GNATS.

From: Rick Macdonald <rickmacd@home.com>
To: jsm@cygnus.com, andrew.ruthven@chelmer.co.nz,
        gnats-prs@sourceware.cygnus.com
Cc:  
Subject: Re: gnats/2
Date: Tue, 07 Sep 1999 16:37:37 -0600

 My original file-pr.c code was OK, but line 747 got an error when
 release 3.111 was made.
 
 Line 747:
 
   p = (char *) strrchr (xnotify, ',');
 
 should be:
 
   p = (char *) strrchr (notify, ',');
 
 -- 
 ...RickM...
>From rickmacd@home.com Tue Sep 07 15:54:00 1999
From: Rick Macdonald <rickmacd@home.com>
To: jsm@cygnus.com
Cc: gnats-prs@sourceware.cygnus.com
Subject: Re: gnats/1
Date: Tue, 07 Sep 1999 15:54:00 -0000
Message-id: <19990907225402.4919.qmail@egcs.cygnus.com>
X-SW-Source: 1999-q3/msg00002.html
Content-length: 461

The following reply was made to PR gnats/1; it has been noted by GNATS.

From: Rick Macdonald <rickmacd@home.com>
To: jsm@cygnus.com, andrew.ruthven@chelmer.co.nz,
        gnats-prs@sourceware.cygnus.com
Cc:  
Subject: Re: gnats/1
Date: Tue, 07 Sep 1999 16:35:42 -0600

 Since a patch for this has been made for this by the Debian/Linux
 people, I suggest that a bugfix 3.112 release be considered, to include
 this fix and gnats/2 as well.
 
 -- 
 ...RickM...
>From vilmossotiAThome.com Tue Sep 14 18:04:00 1999
From: vilmossoti AT home.com
To: gnats-gnats AT sourceware.cygnus.com
Subject: gnats/3: showstopping bug in file-pr.c under RedHat 6.0
Date: Tue, 14 Sep 1999 18:04:00 -0000
Message-id: <19990915005416.21417.qmail@egcs.cygnus.com>
X-SW-Source: 1999-q3/msg00004.html
Content-length: 1108

>Number:         3
>Category:       gnats
>Synopsis:       showstopping bug in file-pr.c under RedHat 6.0
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Sep 14 18:04:00 PDT 1999
>Closed-Date:
>Last-Modified:
>Originator:     Vilmos Soti
>Release:        gnats-3.111
>Organization:
>Environment:
RedHat Linux 6.0, kernel 2.2.5, glibc 2.1.1
Pretty much a fresh install. (Not I installed)
>Description:
  if (xnotify)
    {
      strcat (notify, xnotify);
      xfree (xnotify);
    };
  xfree (gnotify);
/*xnotify is zero or released but next will work with it.*/
  p = (char *) strrchr (xnotify, ',');
>How-To-Repeat:
I submitted a test bug report to my machine with emacs'
send-pr. After queue-pr -r ran for a long time (timeout of
about 10 seconds). Later I checked file-pr, and it
Segmentation faulted.
>Fix:
Change
p = (char *) strrchr (xnotify, ',');
to
p = (char *) strrchr (notify, ',');
in file-pr.c at around line 745.
>Release-Note:
>Audit-Trail:
>Unformatted:
>From ralph_pursifull@hp.com Tue Sep 21 16:44:00 1999
From: ralph_pursifull@hp.com
To: gnats-gnats@sourceware.cygnus.com
Subject: gnats/4: FILE *outfile = stdout;  # doesn't compile on Redhat 6
Date: Tue, 21 Sep 1999 16:44:00 -0000
Message-id: <19990921233322.21867.qmail@egcs.cygnus.com>
X-SW-Source: 1999-q3/msg00005.html
Content-length: 913

>Number:         4
>Category:       gnats
>Synopsis:       FILE *outfile = stdout;  # doesn't compile on Redhat 6
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Sep 21 16:44:03 PDT 1999
>Closed-Date:
>Last-Modified:
>Originator:     ralph_pursifull@hp.com
>Release:        gnats3.111
>Organization:
>Environment:
freshly installed Redhat 6 with all components
using gcc
>Description:
This error:

gcc -c -I. -I. -I./../include  -g  -DHAVE_CONFIG_H qvariable.c
qvariable.c:97: initializer element is not constant
make[1]: *** [qvariable.o] Error 1
make[1]: Leaving directory `/var/gnats/gnats'
make: *** [all-gnats] Error 2

caused by:
FILE *outfile = stdout;
>How-To-Repeat:
New Redhat 6 installation
CC=gcc  ./configure
make
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
>From jsm@cygnus.com Tue Sep 21 16:48:00 1999
From: jsm@cygnus.com
To: andrew.ruthven@chelmer.co.nz, gnats-prs@sourceware.cygnus.com, jsm@cygnus.com
Subject: Re: gnats/1
Date: Tue, 21 Sep 1999 16:48:00 -0000
Message-id: <19990921234807.25093.qmail@egcs.cygnus.com>
X-SW-Source: 1999-q3/msg00006.html
Content-length: 438

Synopsis: Error in gnatsd.c

State-Changed-From-To: open->feedback
State-Changed-By: jsm
State-Changed-When: Tue Sep 21 16:48:06 1999
State-Changed-Why:
    Hi, thanks for the Problem Report.
    
    This is fixed in the imminent GNATS 3.112 snapshot.  I'll
    leave this PR in 'feedback' for now--if the problem is solved,
    for you, please let me know.

http://sourceware.cygnus.com/cgi-bin/gnatsweb.pl?cmd=view&database=gnats&pr=1
>From jsm@cygnus.com Tue Sep 21 16:49:00 1999
From: jsm@cygnus.com
To: andrew.ruthven@chelmer.co.nz, gnats-prs@sourceware.cygnus.com, jsm@cygnus.com
Subject: Re: gnats/2
Date: Tue, 21 Sep 1999 16:49:00 -0000
Message-id: <19990921234942.26251.qmail@egcs.cygnus.com>
X-SW-Source: 1999-q3/msg00007.html
Content-length: 523

Synopsis: Trying to access freed memory in file-pr.c

State-Changed-From-To: open->feedback
State-Changed-By: jsm
State-Changed-When: Tue Sep 21 16:49:41 1999
State-Changed-Why:
    Hi, a patch for this is included in the GNATS 3.112 release
    which should be available on the GNATS ftp site shortly.  I'll
    put this PR in 'feedback' for now; please let me know if this
    problem is fixed for you by the 3.112 release and I'll close it.

http://sourceware.cygnus.com/cgi-bin/gnatsweb.pl?cmd=view&database=gnats&pr=2
>From jsm@cygnus.com Tue Sep 21 16:51:00 1999
From: jsm@cygnus.com
To: cmail@milinx.com, gnats-prs@sourceware.cygnus.com, nobody@sourceware.cygnus.com, vilmossoti@home.com
Subject: Re: gnats/3
Date: Tue, 21 Sep 1999 16:51:00 -0000
Message-id: <19990921235139.26465.qmail@egcs.cygnus.com>
X-SW-Source: 1999-q3/msg00008.html
Content-length: 575

Synopsis: showstopping bug in file-pr.c under RedHat 6.0

State-Changed-From-To: open->feedback
State-Changed-By: jsm
State-Changed-When: Tue Sep 21 16:51:39 1999
State-Changed-Why:
    Hi, thanks for the Problem Report.  This problem has been fixed
    in the just-released GNATS 3.112 snapshot.  Please give this release
    a try and let me know if it works correctly for you.  I'll move
    this PR to 'feedback' for now; once I get confirmation from you that it is
    fixed, I'll close it.

http://sourceware.cygnus.com/cgi-bin/gnatsweb.pl?cmd=view&database=gnats&pr=3
>From jsm@cygnus.com Tue Sep 21 16:52:00 1999
From: jsm@cygnus.com
To: gnats-prs@sourceware.cygnus.com, nobody@sourceware.cygnus.com, ralph_pursifull@hp.com
Subject: Re: gnats/4
Date: Tue, 21 Sep 1999 16:52:00 -0000
Message-id: <19990921235259.26590.qmail@egcs.cygnus.com>
X-SW-Source: 1999-q3/msg00009.html
Content-length: 559

Synopsis: FILE *outfile = stdout;  # doesn't compile on Redhat 6

State-Changed-From-To: open->feedback
State-Changed-By: jsm
State-Changed-When: Tue Sep 21 16:52:59 1999
State-Changed-Why:
    Hi, thanks for the PR.  This problem has been fixed in the
    just-now-released GNATS 3.112 snapshot.  Please download this
    new version of GNATS and give it a go.  I'll move this PR to
    'feedback'--if your problem has been resolved, please let me 
    know and I will close it.

http://sourceware.cygnus.com/cgi-bin/gnatsweb.pl?cmd=view&database=gnats&pr=4
>From rfay@peakss.com Thu Sep 23 14:14:00 1999
From: rfay@peakss.com
To: gnats-gnats@sourceware.cygnus.com
Subject: gnats/5: file-pr cores in gnats-3.111
Date: Thu, 23 Sep 1999 14:14:00 -0000
Message-id: <19990923210718.26782.qmail@egcs.cygnus.com>
X-SW-Source: 1999-q3/msg00010.html
Content-length: 2504

>Number:         5
>Category:       gnats
>Synopsis:       file-pr cores in gnats-3.111
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Sep 23 14:14:00 PDT 1999
>Closed-Date:
>Last-Modified:
>Originator:     rfay@peakss.com
>Release:        gnats-3.111
>Organization:
>Environment:

>Description:
I upgraded to gnats-3.111 and found that file-pr was
coring *and* leaving the defect locked, not cleaning up.
On investigation, I found that a strrchr() command was being
done on a potentially NULL pointer.  I fixed that; While I was 
at it, I changed the calls to "unblock_signals()", which doesn't
unblock at all, but rather sets to default handlers. When they
get set back to default handlers, the unlock of a defect doesn't
happen when a core happens.

The patch is provided below.
>How-To-Repeat:

>Fix:
--- /tmp/gnats-3.111/gnats/file-pr.c	Thu Aug 26 17:20:08 1999
+++ gnats/file-pr.c	Wed Sep 15 14:33:35 1999
@@ -630,7 +630,7 @@
 
   close_mail_file (msg);
 
-  unblock_signals ();
+  /* unblock_signals (); */
 }
 \f
 /* Look up PERSON's possible responsible alias, and return it.  If
@@ -709,7 +709,7 @@
 {
   FILE *msg;
   char *notify = (char *) alloca (BUFSIZ); /* FIXME - huge */
-  char *subc = NULL, *subn = NULL, *cnote = NULL, *xnotify = NULL, *gnotify, *p;
+  char *subc = NULL, *subn = NULL, *cnote = NULL, *xnotify = NULL, *gnotify, *p=NULL;
   char buf[GNATS_TIME_LENGTH];
   Header_Name i;
 
@@ -744,7 +744,7 @@
   xfree (gnotify);
 
   /* Strip away the trailing comma that was added by append_notify (). */
-  p = (char *) strrchr (xnotify, ',');
+  if (xnotify) p = (char *) strrchr (xnotify, ',');
   if (p != NULL)
     {
       *p = '\0';
@@ -826,7 +826,7 @@
 
   close_mail_file (msg);
 
-  unblock_signals ();
+  /* unblock_signals (); */
 }
 \f
 /*  Write a file out to FILENAME with all of the GNATS info in it.  If
@@ -856,7 +856,7 @@
   write_pr (outfile, NUM_PR_ITEMS);
 
   fclose (outfile);
-  unblock_signals ();
+  /* unblock_signals (); */
 }
 
 
@@ -1061,7 +1061,7 @@
   xfree (date);
 
   close_mail_file (msg);
-  unblock_signals ();
+  /* unblock_signals (); */
 }
 
 /* Return the next available unique GNATS id.  */
@@ -1101,7 +1101,7 @@
   fprintf (bug_file, "%d", bug_number);
 
   fclose (bug_file);
-  unblock_signals ();
+  /* unblock_signals (); */
 
   return bug_number;
 }
>Release-Note:
>Audit-Trail:
>Unformatted:
>From m.seaman@inpharmatica.co.uk Fri Sep 24 01:54:00 1999
From: m.seaman@inpharmatica.co.uk
To: gnats-gnats@sourceware.cygnus.com
Subject: gnats/6: at-pr argument counting mangled
Date: Fri, 24 Sep 1999 01:54:00 -0000
Message-id: <19990924084539.24990.qmail@egcs.cygnus.com>
X-SW-Source: 1999-q3/msg00011.html
Content-length: 1221

>Number:         6
>Category:       gnats
>Synopsis:       at-pr argument counting mangled
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Sep 24 01:54:03 PDT 1999
>Closed-Date:
>Last-Modified:
>Originator:     m.seaman@inpharmatica.co.uk
>Release:        gnats-3.111, also appears to be in 3.112.1
>Organization:
>Environment:
victoria:~:% uname -a 
SunOS victoria.inpharmatica.co.uk 5.7 Generic_106541-04 sun4u sparc
>Description:
at-pr requires at least seven arguments, plus optionally
`-d gnats-root'.  The code as distributed expects only
the optional arguments. 
>How-To-Repeat:
Edit $GNATS_ROOT/gnats-adm/submitters to enable at-pr
Submit appropriate test PR.  Wait...
>Fix:
 diff -u at-pr.orig at-pr 
--- at-pr.orig  Fri Sep 24 09:30:05 1999
+++ at-pr       Mon Sep 13 08:52:18 1999
@@ -37,7 +37,7 @@
 PATH=/bin:/usr/bin; export PATH
 
 # process command line options
-while [ $# -gt 0 ]; do
+while [ $# -gt 7 ]; do
   case "$1" in
     -d | --directory)
       if [ $# -eq 1 ]; then echo "value required for $1 option"; exit 1; fi
>Release-Note:
>Audit-Trail:
>Unformatted:
>From martti.kuparinen@research.zopps.fi Sat Sep 25 23:14:00 1999
From: martti.kuparinen@research.zopps.fi
To: gnats-gnats@sourceware.cygnus.com
Subject: gnats/8: EEST timezone not recognised
Date: Sat, 25 Sep 1999 23:14:00 -0000
Message-id: <19990926060845.12473.qmail@egcs.cygnus.com>
X-SW-Source: 1999-q3/msg00012.html
Content-length: 1396

>Number:         8
>Category:       gnats
>Synopsis:       EEST timezone not recognised
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Sep 25 23:14:00 PDT 1999
>Closed-Date:
>Last-Modified:
>Originator:     Martti Kuparinen <martti.kuparinen@research.zopps.fi>
>Release:        GNATS 3.112.1
>Organization:
>Environment:
# echo $LANG
fi_FI.ISO_8859-1
# date
Su  26 Syy 1999 09:04:06 EEST
>Description:
When I try edit-pr I get the following error:

pr-edit: Couldn't parse the ARRIVAL_DATE date: Sat Sep 25 15:40:13 EEST 1999.

I have patched getdate.y and hopefully the following patch
will make it to the next maintenance release...
>How-To-Repeat:

>Fix:
Apply the following patch:

--- gnats/getdate.y.orig        Thu Nov  5 21:54:10 1998
+++ gnats/getdate.y     Sun Sep 26 08:40:31 1999
@@ -483,6 +483,7 @@
     { "sst",   tDAYZONE,  -HOUR (1) }, /* Swedish Summer */
     { "fwt",   tZONE,     -HOUR (1) }, /* French Winter */
     { "fst",   tDAYZONE,  -HOUR (1) }, /* French Summer */
+    { "eest",  tZONE,     -HOUR (2) }, /* Eastern European Standard Time */
     { "eet",   tZONE,     -HOUR (2) }, /* Eastern Europe, USSR Zone 1 */
     { "bt",    tZONE,     -HOUR (3) }, /* Baghdad, USSR Zone 2 */
 #if 0
>Release-Note:
>Audit-Trail:
>Unformatted:
>From seph@emode.com Mon Oct 04 06:44:00 1999
From: seph@emode.com
To: gnats-gnats@sourceware.cygnus.com
Subject: gnats/9: gnats fails to build on linux libc6 machines
Date: Mon, 04 Oct 1999 06:44:00 -0000
Message-id: <19991004133758.32544.qmail@egcs.cygnus.com>
X-SW-Source: 1999-q4/msg00000.html
Content-length: 979

>Number:         9
>Category:       gnats
>Synopsis:       gnats fails to build on linux libc6 machines
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Oct 04 06:44:01 PDT 1999
>Closed-Date:
>Last-Modified:
>Originator:     seph@emode.com
>Release:        3.111
>Organization:
>Environment:
linux mandrake 6.0
(something based on redhat 6.0)
>Description:
when trying to build gnats, I got this error:
make: *** [qvariable.o] Error 1
line 97 is "FILE *outfile = stdout;"

poking indicates that libc6 changed stdout so it was not a 
compile time constant (as ANSI doesn't require it)
>How-To-Repeat:
try to build gnats normally on a libc6 system
>Fix:
changed to "FILE *outfile;" and added a "outfile = stdout;"
everywhere needed. there's probably a cleaner fix, but this
worked well enough for me.
>Release-Note:
>Audit-Trail:
>Unformatted:


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1999-08-30  0:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-08-30  0:34 gnats/1: Error in gnatsd.c andrew.ruthven

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).