On Tue, Aug 10, 2004 at 04:23:25PM -0400, Janine Sisk wrote:
> There haven't been any core files, and, well, I've never learned how to
> use gdb so I wouldn't know what to look at anyway....

Using gdb to show the stack trace of a core file is easy.  I generally
do it from inside Emacs: In Emacs, do "M-x gdb-with-core", tell it the
program and core file, then once gdb starts up, do something like
this:

  dir /web/aol4-src/aolserver
  dir /web/aol4-src/aolserver/nsd
  dir /web/aol4-src/nsopenssl
  set height 0
  bt

The "bt" command is what displays the backtrace, the rest is just
stuff to (hopefully) make the backtrace more informative, tell you the
actual line of code, etc.

More gdb info:  http://sources.redhat.com/gdb/onlinedocs/gdb.html

However, you probably have Linux configured to turn off core file
generation, which makes debugging this sort of thing MUCH harder.  You
need to first enable core files, but offhand I don't remember how.
Googling will probably find it.

Ah, I do have these old notes though, for Solaris:

Getting core files from /etc/inittab:

At least on Solaris, when you run AOLserver from /etc/inittab with the
-u and -g switches to change the unix user and group, when AOLserver
segfaults it will not leave a core file.

This is because, according to 'man core':

  A process with an effective user ID different from the real user
  ID will not produce a core image. This is also true for a process
  with an effective group ID different from the real group ID.

You can't just drop the -u option and leave AOLserver running as root,
because it refuses to run as root. But as long as you want to listen
on a non-privileged port (like 8000, rather than 80), you can run
AOLserver as a non-root user from the very beginning. So e.g., in
/etc/inittab instead of:

  foo:234:respawn:/web/aol3/bin/nsd-oracle -i -t /web/mysite/nsbbapi/nsd.tcl -u 
nsadmin -g web

to get a core file use:

  foo:234:respawn:/bin/su nsadmin -c "/web/aol3/bin/nsd-oracle -i -t 
/web/mysite/nsd.tcl"

--
Andrew Piskorski <[EMAIL PROTECTED]>
http://www.piskorski.com/


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]> with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: field of 
your email blank.

Reply via email to