Mailing List Archive

Re: nessus-core/nessusd utils.c,1.117,1.118
* mikhail@nessus.org <mikhail@nessus.org> [20050430 11:07]:
> Update of /usr/local/cvs/nessus-core/nessusd
>
> Modified Files:
> utils.c
> Log Message:
> Paranoia in wait_for_children1: clear errno before calling waitpid.
> This might be the cause of an infinite loop I got.
>
> Index: utils.c
> ===================================================================
> RCS file: /usr/local/cvs/nessus-core/nessusd/utils.c,v
> retrieving revision 1.117
> retrieving revision 1.118
> diff -u -d -r1.117 -r1.118
> --- utils.c 23 Mar 2005 19:22:30 -0000 1.117
> +++ utils.c 30 Apr 2005 09:07:37 -0000 1.118
> @@ -500,7 +500,9 @@
> void wait_for_children1()
> {
> int e;
> - do {
> - e = waitpid(-1, NULL, WNOHANG);
> - } while ( e > 0 || errno == EINTR );
> + do
> + {
> + errno = 0;
> + e = waitpid(-1, NULL, WNOHANG);
> + } while ( e > 0 || errno == EINTR );
> }

This doesn't help on our server with bug #1199, I still get 100%
CPU after completing the scan.

Thomas

--
Email: thomas@intevation.de
http://intevation.de/~thomas/
Re: nessus-core/nessusd utils.c,1.117,1.118 [ In reply to ]
* Thomas Arendsen Hein <thomas@intevation.de> [20050430 12:28]:
> * mikhail@nessus.org <mikhail@nessus.org> [20050430 11:07]:
> > Modified Files:
> > utils.c
> > Log Message:
> > Paranoia in wait_for_children1: clear errno before calling waitpid.
> > This might be the cause of an infinite loop I got.
>
> This doesn't help on our server with bug #1199, I still get 100%
> CPU after completing the scan.

Sorry, I just noticed that utils.c didn't get updated on my last
'cvs up', maybe the anonymous CVS lagged some minutes behind the
mailing list?

Your change indeed solved bug #1199 in HEAD, so only NESSUS_2_2
still has to be fixed.

Thanks,
Thomas

--
Email: thomas@intevation.de
http://intevation.de/~thomas/
Re: Re: nessus-core/nessusd utils.c,1.117,1.118 [ In reply to ]
On Sat Apr 30 2005 at 12:27, Thomas Arendsen Hein wrote:

> This doesn't help on our server with bug #1199, I still get 100%
> CPU after completing the scan.

This does not surprise me much. My tiny modification was more witchcraft
than programming.
Re: Re: nessus-core/nessusd utils.c,1.117,1.118 [ In reply to ]
On Sat Apr 30 2005 at 12:42, Thomas Arendsen Hein wrote:

> Sorry, I just noticed that utils.c didn't get updated on my last
> 'cvs up', maybe the anonymous CVS lagged some minutes behind the
> mailing list?

I'm not sure. I believe so. Renaud, do you confirm that?

> Your change indeed solved bug #1199 in HEAD

That's mysterious. This looks like a bug in the OS or the C library.
Or maybe a nasty memory corruption, but I could not get it with valgrind.
Re: Re: nessus-core/nessusd utils.c,1.117,1.118 [ In reply to ]
On Sat, Apr 30, 2005 at 12:42:28PM +0200, Thomas Arendsen Hein wrote:
> Your change indeed solved bug #1199 in HEAD, so only NESSUS_2_2
> still has to be fixed.

The 2.2 code for wait_for_children1() has always contained an equivalent
fix.


-- Renaud