Mailing List Archive

plugins can't allocate memory
Hi!

While scanning with plugins from CVS HEAD many errors show up in
nessusd.dump:

[12114] Could not allocate a pointer of size 25 !
[12115] Could not allocate a pointer of size 131073 !
malloc: Cannot allocate memory
Could not realloc() a pointer of size 87361 !
mmap : Cannot allocate memory

$ grep alloc nessusd.dump|wc -l
1636

There is enough memory available in the system.

libnasl/nessus-libraries/nessus-core/plugins from today's CVS on
Debian woody.

Older plugins work fine, even used with everything else from HEAD.

At least one other person is experiencing the same problems.

Thomas

--
Email: thomas@intevation.de
http://intevation.de/~thomas/
Re: plugins can't allocate memory [ In reply to ]
* Thomas Arendsen Hein <thomas@intevation.de> [20041221 12:53]:
> While scanning with plugins from CVS HEAD many errors show up in
> nessusd.dump:
>
> [12114] Could not allocate a pointer of size 25 !
> [12115] Could not allocate a pointer of size 131073 !
> malloc: Cannot allocate memory
> Could not realloc() a pointer of size 87361 !
> mmap : Cannot allocate memory
>
> $ grep alloc nessusd.dump|wc -l
> 1636
>
> There is enough memory available in the system.
>
> libnasl/nessus-libraries/nessus-core/plugins from today's CVS on
> Debian woody.
>
> Older plugins work fine, even used with everything else from HEAD.

FYI: Everything from 2.2 branch and plugins from 20041201 yield the
same problems.

Thomas

--
Email: thomas@intevation.de
http://intevation.de/~thomas/
Re: plugins can't allocate memory [ In reply to ]
On Tue, Dec 21, 2004 at 12:52:49PM +0100, Thomas Arendsen Hein wrote:
> Older plugins work fine, even used with everything else from HEAD.

Do you have any other details on your setup, like the scanning options
or anything which could be a bit useful for your "report" ?


Thanks,
-- Renaud
Re: plugins can't allocate memory [ In reply to ]
* Renaud Deraison <deraison@nessus.org> [20041221 19:39]:
> On Tue, Dec 21, 2004 at 12:52:49PM +0100, Thomas Arendsen Hein wrote:
> > Older plugins work fine, even used with everything else from HEAD.
>
> Do you have any other details on your setup, like the scanning options
> or anything which could be a bit useful for your "report" ?

Everything default, i.e. removing ~/.nessus and ~/.nessusrc,
starting the HEAD GUI, new task, new scope, execute.

There is a result, but only 9 instead of 22 notes, 4 instead of 21
warnings and 2 instead of 8 holes found.

Test system is Debian woody 3.0r3 with many services enabled.
Nessus client and server are running on the same machine.

Nessus things are compiled with --enable-debug (except plugins).

So I think there's nothing special in my setup.

Thomas

--
Email: thomas@intevation.de
http://intevation.de/~thomas/
Re: Re: plugins can't allocate memory [ In reply to ]
On Tue, Dec 21, 2004 at 09:36:37PM +0100, Thomas Arendsen Hein wrote:
> > Do you have any other details on your setup, like the scanning options
> > or anything which could be a bit useful for your "report" ?
>
> Everything default, i.e. removing ~/.nessus and ~/.nessusrc,
> starting the HEAD GUI, new task, new scope, execute.


Delete /usr/local/lib/nessus/plugins/.desc/ as well.

> There is a result, but only 9 instead of 22 notes, 4 instead of 21
> warnings and 2 instead of 8 holes found.
>
> Test system is Debian woody 3.0r3 with many services enabled.
> Nessus client and server are running on the same machine.
>
> Nessus things are compiled with --enable-debug (except plugins).

That may also be an issue - I need to double-check that, but this option
has not really been used for a while on our side.
Re: plugins can't allocate memory [ In reply to ]
* Renaud Deraison <deraison@nessus.org> [20041221 22:58]:
> Delete /usr/local/lib/nessus/plugins/.desc/ as well.

Always did that.

> On Tue, Dec 21, 2004 at 09:36:37PM +0100, Thomas Arendsen Hein wrote:
> > Nessus things are compiled with --enable-debug (except plugins).
>
> That may also be an issue - I need to double-check that, but this option
> has not really been used for a while on our side.

I nearly always used that and never had problems with it.

I investigated the problem a little bit: It was introduced with
adding plugins/nessus_tcp_scanner on November 21st. If I delete that
directory but installing everything else from HEAD, this problem
disappears.

Thomas

--
Email: thomas@intevation.de
http://intevation.de/~thomas/
Re: Re: plugins can't allocate memory [ In reply to ]
On Wed Dec 22 2004 at 08:26, Thomas Arendsen Hein wrote:

> I investigated the problem a little bit: It was introduced with
> adding plugins/nessus_tcp_scanner on November 21st.

Odd...

> If I delete that directory but installing everything else from HEAD,
> this problem disappears.

Are you still running a scanner then?
Re: plugins can't allocate memory [ In reply to ]
* Michel Arboi <mikhail@nessus.org> [20041222 11:00]:
> On Wed Dec 22 2004 at 08:26, Thomas Arendsen Hein wrote:
> > I investigated the problem a little bit: It was introduced with
> > adding plugins/nessus_tcp_scanner on November 21st.
>
> Odd...
>
> > If I delete that directory but installing everything else from HEAD,
> > this problem disappears.
>
> Are you still running a scanner then?

With defaut settings I guess it's only the ping scanner, but I also
tried enabling other scanners and they work fine.

I even tried compiling everything without --enable-debug now, but
results are the same, even on a different test machine in another
network (but still Debian woody).

Thomas

--
Email: thomas@intevation.de
http://intevation.de/~thomas/
Re: plugins can't allocate memory [ In reply to ]
* Thomas Arendsen Hein <thomas@intevation.de> [20041221 18:47]:
> * Thomas Arendsen Hein <thomas@intevation.de> [20041221 12:53]:
> > While scanning with plugins from CVS HEAD many errors show up in
> > nessusd.dump:
> >
> > [12114] Could not allocate a pointer of size 25 !
> > [12115] Could not allocate a pointer of size 131073 !
> > malloc: Cannot allocate memory
> > Could not realloc() a pointer of size 87361 !
> > mmap : Cannot allocate memory
> >
> > $ grep alloc nessusd.dump|wc -l
> > 1636
> >
> > There is enough memory available in the system.
> >
> > libnasl/nessus-libraries/nessus-core/plugins from today's CVS on
> > Debian woody.
> >
> > Older plugins work fine, even used with everything else from HEAD.
>
> FYI: Everything from 2.2 branch and plugins from 20041201 yield the
> same problems.

Very strange. I just compiled current 2.2 branch with current
plugins and the problem doesn't appear, but looking at logs from my
other tests, I really used 2.2 branch and plugins from 20041201 in
above test.

Using a HEAD client to connect to this 2.2 server works fine, too.

Very very strange ...
Thomas

--
Email: thomas@intevation.de
http://intevation.de/~thomas/
Re: plugins can't allocate memory [ In reply to ]
* Thomas Arendsen Hein <thomas@intevation.de> [20041222 12:19]:
> * Thomas Arendsen Hein <thomas@intevation.de> [20041221 18:47]:
> > FYI: Everything from 2.2 branch and plugins from 20041201 yield the
> > same problems.
>
> Very strange. I just compiled current 2.2 branch with current
> plugins and the problem doesn't appear, but looking at logs from my
> other tests, I really used 2.2 branch and plugins from 20041201 in
> above test.
>
> Using a HEAD client to connect to this 2.2 server works fine, too.

I found the problem: The HEAD client doesn't set the following
SERVER_PREFS to their default values:

auto_enable_dependencies = yes
cgi_path = /cgi-bin:/scripts
port_range = default
continuous_scan = no
detached_scan = no
save_empty_sessions = no
save_session = no

An unset port_range leads to problems in the new nessus_tcp_scanner.

A quick grep over other parts of nessus shows that port_range really
never should be unset. Bad things will happen in the server.

For a quick solution I'll fix the client, but a better error
checking is really needed, or what do you think?

Thomas

--
Email: thomas@intevation.de
http://intevation.de/~thomas/