[1658] in Athena Bugs
(RTPC) Version 6.0R: syslogd
daemon@ATHENA.MIT.EDU (Jonathan I. Kamens)
Sun Jan 15 21:27:12 1989
Date: Sun, 15 Jan 89 21:26:42 EST
From: Jonathan I. Kamens <jik@ATHENA.MIT.EDU>
To: bugs@ATHENA.MIT.EDU
Cc: probe@ATHENA.MIT.EDU, rfrench@ATHENA.MIT.EDU
System type, version: (RTPC) Version 6.0R
System name: pit-manager
What's wrong:
First, the fix, and then the description of the problem:
---cut here---
*** syslogd.c.orig Sun Jan 15 21:12:24 1989
--- syslogd.c Sun Jan 15 21:03:04 1989
***************
*** 326,334 ****
dprintf("off & running....\n");
- init();
- (void) signal(SIGHUP, init);
-
/* initialize zephyr stuff */
bzero (&znotice, sizeof (znotice));
znotice.z_kind = UNSAFE;
--- 326,331 ----
***************
*** 336,341 ****
--- 333,341 ----
znotice.z_class_inst = LocalHostName;
znotice.z_default_format = "Syslog message from $instance, level $opcode:\n$message";
(void) ZInitialize ();
+
+ init();
+ (void) signal(SIGHUP, init);
for (;;) {
int nfds, readfds = FDMASK(funix) | inetm | klogm;
---cut here---
I like to know exactly what is going on with my workstation, so in
/etc/syslog.conf I have the line "*.debug\t\t\tjik," which is meant to
send any syslog messages at all to me via Zephyr.
I discovered about two months ago that whenever I start a new syslogd
with that line in the syslog.conf file, the syslogd immediately aborts
and exits. However, if I took the line out of syslog.conf, started
the syslogd, then added the line back in and restarted syslogd using
"kill -HUP `cat /etc/syslog.pid`," the syslogd was able to deal with
*.debug line with no problem.
The bug was suprisingly obvious once I ran syslogd in debug mode.
When I did so, the syslogd status messages started out normally and
claimed that they were sending out a restart message to, among other
people, the people who were supposed to be notified via zephyr. The
next line printed out by syslogd was "syslogd: Unknown code zeph 1."
"Hmm..." I said, "that kind of error message means that the zephyr
com_error error table is not getting initialized. But that can't be
so, because syslogd calls ZInitialize right there, right after the
call to init().... Wait a minute, did I say right AFTER the call to
init()?"
So it was. The call to init() was attempting to send out a syslogd
restart message, but it failed to send to zephyr subscribers because
zephyr had not been initialized yet. Since it got an error, it tried
to send out an error message to all of the zephyr subscribers, but
couldn't because zephyr hadn't been initialized... etc... etc... ad
infinitum for several hundred lines until it finally segfaulted.
The fix is simply to move the zephyr initialization above the init()
call.
It's two lines of code being moved, and there isn't even any new code.
I see no reason why it can't go into the 6.1 release.
--> Jonathan Kamens
Project Athena Watchmaker
SIPB (Student Information Processing Board) Member
Volunteer OLC Consultant
jik@ATHENA.MIT.EDU
P.S. Henry, is this bug report detailed enough for you :-)