[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: monit 4.8 segfaults on Redhat EL4

From: Martin Pala
Subject: Re: monit 4.8 segfaults on Redhat EL4
Date: Thu, 04 May 2006 22:28:21 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20060205 Debian/1.7.12-1.1

Thanks for report .

I think it may be related to amd64 platform ... there was similar problem with this platform in the past.

Unfortunately i don't have access to any opteron based server ... in the attachment is the patch which may fix the problem (not tested).

Example usage:

 tar -xzf monit-4.8.tar.gz
 cd monit-4.8
 patch -p1 < /path/to/.../opteron.patch

 ... and rebuild monit


Mike Jackson wrote:
System is Redhat EL4. It's running on an Opteron processor, with the amd64 install of Redhat.

Configured monit with:  --with-ssl-lib-dir=/usr/lib64

Nothing appears to be out of the ordinary during the build process. However, it segfaults when run. This gets logged to /var/log/messages:

May 4 10:03:58 bonsai kernel: monit[26655]: segfault at 000000000000681f rip 0000003106b6fd00 rsp 0000007fbfffedc8 error 4

I get this when I run it through gdb:

(gdb) run
Starting program: /usr/local/src/monit-4.8/monit
[Thread debugging using libthread_db enabled]
[New Thread 182894082848 (LWP 30022)]
Starting monit daemon with http interface at [*:2812]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 182894082848 (LWP 30022)]
0x0000003106b6fd00 in strlen () from /lib64/tls/
(gdb) backtrace
#0  0x0000003106b6fd00 in strlen () from /lib64/tls/
#1  0x0000003106b428cc in vfprintf () from /lib64/tls/
#2  0x0000003106bc1e55 in vsyslog () from /lib64/tls/
#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'm not a C programmer, so I don't have much idea what all that means. I can provide other details if you need. I also ran it through strace, which produces volumes of output, but I won't send that unless someone needs it.

To unsubscribe:
diff -Naur monit/log.c monit-mp/log.c
--- monit/log.c 2006-04-27 22:56:41.000000000 +0200
+++ monit-mp/log.c      2006-05-04 22:19:47.000000000 +0200
@@ -359,10 +359,22 @@
 static void log_log(int priority, const char *s, va_list ap) {
+#ifdef HAVE_VA_COPY
+  va_list ap_copy;
+#ifdef HAVE_VA_COPY
+  va_copy(ap_copy, ap);
+#ifdef HAVE_VA_COPY
+    vfprintf(stderr, s, ap_copy);
     vfprintf(stderr, s, ap);
@@ -371,17 +383,28 @@
     if(Run.use_syslog) {
+#ifdef HAVE_VA_COPY
+        vsyslog(priority, s, ap_copy);
         vsyslog(priority, s, ap);
     } else if(LOG) {
         fprintf(LOG, "[%s] %-8s : ",
           timefmt(datetime, STRLEN),
+#ifdef HAVE_VA_COPY
+        vfprintf(LOG, s, ap_copy);
         vfprintf(LOG, s, ap);
+#ifdef HAVE_VA_COPY
+  va_end(ap_copy);

reply via email to

[Prev in Thread] Current Thread [Next in Thread]