[Openswan dev] [Openswan Users] FATAL ERROR: unable to malloc 0 bytes for state array

Paul Wouters paul at xelerance.com
Mon May 12 22:58:04 EDT 2008

On Mon, 12 May 2008, Ming-Ching Tiew wrote:

Thanks for the malloc pointer and the the pluto leak logs.

> Subject: Re: [Openswan Users] FATAL ERROR: unable to malloc 0 bytes for state
>     array

> By the way, I have confirmed that change uclibc GLIBC_COMPATIBILITY ( ie to allow malloc(0) to succeeed ) indeed fixes the problem.

Does uclibc needs to be recompiled with GLIBC_COMPATIBILITY, or did you need to define it
within Openswan to make it work?

Still malloc(0) makes no sense. Do you know where in the code this malloc() was happening?

> There is an (old) internet thread about someone has posted a patch for freeswan on this issue.

A google for GLIBC_COMPATIBILITY gives me 0 results....

As for the leaks, your logs show:

leak: self-vendor ID
leak: myid string
leak: my FQDN
leak: esp string
leak: struct event in event_schedule()
leak: myid string
leak: pluto helpers
leak: 2 * struct event in event_schedule()
leak: ocspcerts path
leak: aacerts path
leak: certs path
leak: private path
leak: crls path
leak: cacert path
leak: acert path

Of these, struct event in event_schedule() is the most interesting, as it will occur
regularly. The others are mostly a one-time use (except "esp string" which was fixed
already in cvs/git)

This seems to be bug 652, see http://bugs.xelerance.com/view.php?id=652

I see an alloc_thing of struct event, and no associating free call. I am not
entirely sure where this is supposed to be freed.

Building and integrating Virtual Private Networks with Openswan:

More information about the Dev mailing list