monit-dev
[Top][All Lists]
Advanced

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

Re: Process Resource Update


From: Martin Pala
Subject: Re: Process Resource Update
Date: Sat, 31 Jul 2004 22:07:43 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.1) Gecko/20040726 Debian/1.7.1-4

Seems to work good :) (i have tested on linux/x86 only).

Yet two cosmetic questions:

1.) maybe it could be better not to use memset after calloc, bacause calloc ensures that the memory is set to zero already. The redundant use of memset will not hurt, but it is extra overhead (though very small):

--8<--
  pt = xcalloc(sizeof(ProcessTree_T), treesize);
  memset(pt, 0, sizeof(ProcessTree_T) * treesize);
--8<--


2.) it seems that the process related stuff needs to be fixed on Darwin and OpenBSD:

monit/process/sysdep_DARWIN.c (seems that process initialization is skipped completely):

--8<--
+  /* Put this here until fixed */
+
+#warning initprocesstree_sysdep: needs to be fixed!
+  return 0;
--8<--

monit/process/sysdep_OPENBSD.c:

--8<--
+#warning initprocesstree_sysdep: needs to be fixed!
+    /* getrusage code is wrong!!!
+       it only measures the rusage of the current process, that means
+       of monit itself.
+    */
--8<--


Summary:
There are probably following options:

1.) either release 4.3.1 without this patch and add it as soon as it will be verified/fixed on Darwin and/or OpenBSD.

2.) or add it now and fix it later (in future release)

3.) or just wait with 4.3.1 release


What do you think?


Martin

Christian Hopp wrote:
On Wed, 28 Jul 2004, Martin Pala wrote:


Ugh - during testing monit with the proc patch crashed on exit in
delprocesstree():

(gdb) bt
#0  0x4022d13c in mallopt () from /lib/tls/i686/cmov/libc.so.6
#1  0x40227247 in _IO_file_xsputn () from /lib/tls/i686/cmov/libc.so.6
#2  0x4022bf80 in free () from /lib/tls/i686/cmov/libc.so.6
#3  0x402ef700 in __after_morecore_hook () from /lib/tls/i686/cmov/libc.so.6
#4  0x08091028 in ?? ()
#5  0x00000000 in ?? ()
#6  0x00001098 in ?? ()
#7  0x08091028 in ?? ()
#8  0x08051a66 in delprocesstree (pt=0x8091028, size=72) at process.c:333
#9  0x0804d77d in gc () at gc.c:84
#10 0x0805037e in do_exit () at monitor.c:422
#11 0x0805049e in do_default () at monitor.c:475
#12 0x0804fdff in main (argc=72, argv=0xbffff8d4) at monitor.c:117

(gdb) info threads
  2 process 7265  0x4002ab34 in start_thread () from
/lib/tls/i686/cmov/libpthread.so.0
* 1 process 7264  0x4022d13c in mallopt () from /lib/tls/i686/cmov/libc.so.6

(gdb) thread 2
[Switching to thread 2 (process 7265)]#0  0x4002ab34 in start_thread ()
from /lib/tls/i686/cmov/libpthread.so.0

(gdb) bt
#0  0x4002ab34 in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#1  0x00000000 in ?? ()


Its fixed... it should run smoothly now.  But please test (esp. on *BSD
systems) before I sync it to CVS.

Christian



------------------------------------------------------------------------

_______________________________________________
monit-dev mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/monit-dev





reply via email to

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