[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: monit 4.8 segfaults on Redhat EL4
From: |
Mike Jackson |
Subject: |
Re: monit 4.8 segfaults on Redhat EL4 |
Date: |
Thu, 4 May 2006 13:37:22 -0700 |
Thank you very much for this report Mike. This trace does not make any
sense to me though. It shows 's' with an address and then go on to say
that s is not available. Also not having argc available for main() is
suspicious to say the least. Does this segfault happens all the time or
only sporadic? Do you use any special C libraries that you are aware of?
I cannot reproduce this segfault on any Linux (SMP) machines I have so I
wonder if you can run gdb on monit yourself and set a breakpoint in
'log_log' and step trough to see if anything strange is going on or maybe
where the problem occurs. Use e.g.
I'm not aware of any special libraries - I mean, I have a lot of stuff
installed, but libc and whatnot should be stock installs from Redhat. I was
previously using a CVS copy dated 2006-04-24. This particular segfault
happens every time monit is started - though when I used the command line
flags you specified ('-lv'), it did not segfault and started normally.
Here's the gdb output with -lv specified:
(gdb) break log_log
Breakpoint 1 at 0x408fa0: file log.c, line 360.
(gdb) run -lv
Starting program: /usr/local/src/monit-4.8/monit -lv
[Thread debugging using libthread_db enabled]
[New Thread 182894082848 (LWP 10831)]
[Switching to Thread 182894082848 (LWP 10831)]
Breakpoint 1, log_log (priority=6, s=0x42af60 "Starting %s daemon with http
interface at [%s:%d]\n", ap=0x7fbffff6b0) at log.c:360
360 static void log_log(int priority, const char *s, va_list ap) {
(gdb) n
362 ASSERT(s);
(gdb) n
360 static void log_log(int priority, const char *s, va_list ap) {
(gdb) n
362 ASSERT(s);
(gdb) n
364 LOCK(log_mutex)
(gdb) n
365 vfprintf(stderr, s, ap);
(gdb) n
Starting monit daemon with http interface at [*:2812]
366 fflush(stderr);
(gdb) n
367 END_LOCK;
(gdb) n
369 if(Run.dolog) {
(gdb) n
385 }
(gdb) n
LogInfo (s=Variable "s" is not available.
) at log.c:248
248 va_end(ap);
(gdb) n
main (argc=Variable "argc" is not available.
) at monitor.c:465
465 if(Run.init != TRUE)
(gdb) n
466 daemonize();
(gdb) n
Detaching after fork from child process 11029.
Program exited normally.
And here's the gdb output without -lv (along with a backtrace):
(gdb) break log_log
Breakpoint 1 at 0x408fa0: file log.c, line 360.
(gdb) run
Starting program: /usr/local/src/monit-4.8/monit
[Thread debugging using libthread_db enabled]
[New Thread 182894082848 (LWP 12359)]
[Switching to Thread 182894082848 (LWP 12359)]
Breakpoint 1, log_log (priority=6, s=0x42af60 "Starting %s daemon with http
interface at [%s:%d]\n", ap=0x7fbffff6c0) at log.c:360
360 static void log_log(int priority, const char *s, va_list ap) {
(gdb) n
362 ASSERT(s);
(gdb) n
360 static void log_log(int priority, const char *s, va_list ap) {
(gdb) n
362 ASSERT(s);
(gdb) n
364 LOCK(log_mutex)
(gdb) n
365 vfprintf(stderr, s, ap);
(gdb) n
Starting monit daemon with http interface at [*:2812]
366 fflush(stderr);
(gdb) n
367 END_LOCK;
(gdb) n
369 if(Run.dolog) {
(gdb) n
372 if(Run.use_syslog) {
(gdb) n
373 LOCK(log_mutex)
(gdb) n
374 vsyslog(priority, s, ap);
(gdb) n
Program received signal SIGSEGV, Segmentation fault.
0x0000003106b6fd00 in strlen () from /lib64/tls/libc.so.6
(gdb) bt
#0 0x0000003106b6fd00 in strlen () from /lib64/tls/libc.so.6
#1 0x0000003106b428cc in vfprintf () from /lib64/tls/libc.so.6
#2 0x0000003106bc1e55 in vsyslog () from /lib64/tls/libc.so.6
#3 0x000000000040910c in log_log (priority=6, s=0x42af60 "Starting %s
daemon with http interface at [%s:%d]\n", ap=0x7fbffff6c0)
at log.c:374
#4 0x0000000000409358 in LogInfo (s=Variable "s" is not available.
) at log.c:247
#5 0x000000000040b332 in main (argc=Variable "argc" is not available.
) at monitor.c:460
I tried it again from the command line, and it segfaults without the -l
flag. When it's specified, it starts correctly.