Bug 2443 - -F option kills segfaults amd
Summary: -F option kills segfaults amd
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: am-utils
Version: 6.0
Hardware: i386
OS: Linux
medium
high
Target Milestone: ---
Assignee: David Lawrence
QA Contact:
URL:
Whiteboard:
: 2912 3476 3741 4463 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 1999-04-30 19:21 UTC by ralph
Modified: 2008-05-01 15:37 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 1999-06-15 15:18:54 UTC
Embargoed:


Attachments (Terms of Use)

Description ralph 1999-04-30 19:21:27 UTC
i.e.
[ralph@todd amd]$ ./amd -F amd.conf
Segmentation fault (core dumped)

[ralph@todd amd]$ cat amd.conf
[ global ]
dismount_interval =             240

Comment 1 kenneths 1999-05-31 15:56:59 UTC
I had the same problem, it occurs whenever you use -F and not
-x noall.

I have traced the problem to the glibc21 patch which sets the logging
facility to NULL in libamu/xutil.c. If any logging is done before
 switch_to_logfile is called in amd/get_args.c, amd will try to log
to a FILE* that is NULL, hence the core dump. A quick hack is to use
this patch instead of the glibc21, but it doesnt really fix the
problem:
 --- am-utils-6.0/libamu/xutil.c.glibc21 Sun Dec 27 07:25:24 1998
+++ am-utils-6.0/libamu/xutil.c Fri May 28 16:21:09 1999
@@ -48,7 +48,7 @@
 #include <am_defs.h>
 #include <amu.h>

-FILE *logfp = stderr;          /* Log errors to stderr initially */
+FILE *logfp = NULL;            /* Log errors to stderr initially */

 static char *am_progname = "unknown";  /* "amd" */
 static char am_hostname[MAXHOSTNAMELEN + 1] = "unknown"; /* Hostname
*/
@@ -310,6 +310,10 @@
   time_t t = clocktime();
   char *sev;

+  if(logfp==NULL){
+       fprintf(stderr, "Setting logging facility to STDERR\n");
+       logfp=stderr;
+  }
   if (t != last_t) {
     last_ctime = ctime(&t);
     last_t = t;
--- am-utils-6.0a16/include/am_defs.h.glibc21   Thu Jan 21 11:15:18
1999
+++ am-utils-6.0a16/include/am_defs.h   Thu Jan 21 11:23:54 1999
@@ -308,7 +308,7 @@
  * like Linux, it also defines "struct datum".
  */
 #ifdef HAVE_NDBM_H
-# include <ndbm.h>
+# include <db1/ndbm.h>
 # ifndef DATUM
 /* ensure that struct datum is not included again from
<rpcsvc/yp_prot.h> */
 #  define DATUM

As you can see, it sets the logfd pointer to stderr if it is NULL, in
static void show_time_host_and_name(int lvl), which is called before
any logging is commited to a FILE*. However, this is probably not the
right place for it. Either the FILE * logfd = NULL should be fixed,
but im not wuite sure why gcc chokes when we set FILE * logfd =
stderr, as is done in the vanilla am-utils distribution. Or perhaps
one should put logfd=stderr early in amd/amd.c: int main(int argc,
char *argv[]).

Anyway, I will put up i386 RPMS and SRPMS of the am-utils with the
previous patch on ftp.oslo.sintef.no/pub/kenneths shortly.

Comment 2 kenneths 1999-05-31 22:23:59 UTC
The bug occured in other programs that came with the am-utils pkg to.
I have fixed them. Patch will be sent to bugzilla. RPMS and
SRPMS are at ftp.oslo.sintef.no/pub/kenneths. Its release 4 of the pkg
that has the full fix.

Comment 3 Jeff Johnson 1999-06-15 15:00:59 UTC
*** Bug 2912 has been marked as a duplicate of this bug. ***

using config files from my 5.2 installation with
the 6.0 version of am-utils causes am-utils to
crash with a core dump.

BTW: I tried picking up the sources from the author and they
      would not compile in the 6.0 environment.

------- Additional Comments From jbj  05/18/99 18:17 -------
Can you supply a (minimal if possible) configuration so that we
can reproduce the problem? A stack back trace would help also.

What type of compile failure are you seeing?

------- Additional Comments From jbj  05/18/99 18:17 -------
Can you supply a (minimal if possible) configuration so that we
can reproduce the problem? A stack back trace would help also.

What type of compile failure are you seeing?

------- Additional Comments From kenneths.no  06/01/99 15:43 -------
I guess this is the same bug as # 2443, I have submitted patches
for this bug, and made some comments on it.*** Bug 3476 has been marked as a duplicate of this bug. ***

I have hit a (show-stopper) problem with am-utils-6.0-3
under
redhat 6.0 (this is after a clean "everything" install). If
you try to use the -F option - which allows you to point to
an
external configuration file - amd promptly dumps core (some
amd options I use in our machines are only accessible from
the
configuration file as opposed to command line switches).

The core dump appears to be related to an fprintf to stderr
that's processed when the configuration is parsed from the
command line and the "-F" flag is found. A message is
supposed
to be printed to stderr but instead the whole thing core
dumps. Commenting out the offending line and rebuilding the
whole package is the workaround I'm currently using. This
might be a problem with the underlying glibc2.1...

Comment 4 Jeff Johnson 1999-06-15 15:18:59 UTC
Fixed in am-utils-6.0-4. Thanks for the patch.

Comment 5 Cristian Gafton 1999-08-29 18:12:59 UTC
*** Bug 4463 has been marked as a duplicate of this bug. ***

If you use the -F option of amd, the it immediately
segfaults. I have tracked it down to one of the patches
applied to deal with glibc 2.1. The problem is that the
output log FILE descriptor has not been set. I will send a
patch.

Comment 6 Cristian Gafton 1999-08-29 18:13:59 UTC
*** Bug 3741 has been marked as a duplicate of this bug. ***

The version of amd distributed with RH 6.0 segfaults while
reading my amd config files.  A previous release (not the RH
5.1 one) that I was running on RH 5.1 works fine.

Here's a uuencoded gzip'd tar file containing my amd config
files.  I do not know if this data survived the cut and
paste into your description window.  I know that Netscape
ate at least the single backquote character that should be
on the next-to-last line right above the "end" keyword.

begin 644 amd.tar.gz
M'XL(".H0=#<``V%M9"YT87(`[5QM;]LX$NY7ZU>P27&]6\2V)%OV;8(L4&"[
M=X?;-D73[7YH%P$MT;9JB=22=!QOT?]^0XJ2)<>6G"*V6YP&"&I)S\SP968X
MI$8ETN^*I?`9'8>3+HZ#)X]/CFT/^GWT!"FRU_Y5-.PA-!BZKF/W[9Z-D./V
M>NX39.^A+?=H+B3F"#WAC,DJ7-WS[Y1>_/R?MY==;+VZ^NWUNS?OKB^M%Z]^
MOE(_GK=_05T"Y@%&H?XZRD90FZ/V'<)1]-PZ=M,;>@0R$ZPG=U\ZE/_;ZWY?
M\'_'`Y\?>)[KN7W75O[ON(-^X_^'H&Y`QG@>28'&XOSRV6<\ERP(^9?NL\]\
MRH3\TE4=5U=C\>6")5)<4B;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T<].Z@H?7^/3C2#GVU#744$,--=100PU]%?T/
(7SN'!`!0````

end


------- Additional Comments From jbj  06/26/99 10:11 -------
Can you reply to this message with your config file attachment?
Thanks ...

------- Additional Comments From gafton  07/28/99 03:24 -------
assigned to jbj


Note You need to log in before you can comment on or make changes to this bug.