Yahoo Groups archive

Milter-greylist

Index last updated: 2026-04-28 23:32 UTC

Thread

Problem with "libspf2"

Problem with "libspf2"

2009-06-09 by Matthias Scheler

Hello,

I'm using 4.2.2 with libspf2 1.2.9 under NetBSD 5.0. In the last few weeks
"milter-greylist" has has been crashing regulary on two mail servers.
I've therefore built a debug version and started it with "-D" I managed to
observe two crashes which both produced the same error message:

spf_expand.c:219     Error: Failed to allocate enough memory to expand string.

I very much doubt that it was really running out of memory. The database
dump is only a few megabytes large and the machine has 8GB of main memory.

Has anybody else seen this?

	Kind regards

-- 
Matthias Scheler                                  http://zhadum.org.uk/

Re: [milter-greylist] Problem with "libspf2"

2009-06-10 by manu@netbsd.org

Matthias Scheler <tron@...> wrote:

> I'm using 4.2.2 with libspf2 1.2.9 under NetBSD 5.0. In the last few weeks
> "milter-greylist" has has been crashing regulary on two mail servers.
> I've therefore built a debug version and started it with "-D" I managed to
> observe two crashes which both produced the same error message:
> 
> spf_expand.c:219     Error: Failed to allocate enough memory to expand string.

That error comes from libspf2 itself. Could you collect a backtrace?

-- 
Emmanuel Dreyfus
http://hcpnet.free.fr/pubz
manu@...

Re: [milter-greylist] Problem with "libspf2"

2009-06-10 by Matthias Scheler

On Wed, Jun 10, 2009 at 06:02:00AM +0200, Emmanuel Dreyfus wrote:
> Matthias Scheler <tron@...> wrote:
> 
> > I'm using 4.2.2 with libspf2 1.2.9 under NetBSD 5.0. In the last few weeks
> > "milter-greylist" has has been crashing regulary on two mail servers.
> > I've therefore built a debug version and started it with "-D" I managed to
> > observe two crashes which both produced the same error message:
> > 
> > spf_expand.c:219     Error: Failed to allocate enough memory to expand string.
> 
> That error comes from libspf2 itself.

Yes, I know. I was just wondering if anybody knew why that's happening.

> Could you collect a backtrace?

I'm trying to.

	Kind regards

-- 
Matthias Scheler                                  http://zhadum.org.uk/

Re: [milter-greylist] Problem with "libspf2"

2009-06-10 by Matthias Scheler

On Wed, Jun 10, 2009 at 08:19:29AM +0100, Matthias Scheler wrote:
> > Could you collect a backtrace?
> 
> I'm trying to.

Here it is:

spf_expand.c:219     Error: Failed to allocate enough memory to expand string.

Program received signal SIGABRT, Aborted.
0x00007f7ffd5dbb1a in _lwp_kill () from /usr/lib/libc.so.12
(gdb) where
#0  0x00007f7ffd5dbb1a in _lwp_kill () from /usr/lib/libc.so.12
#1  0x00007f7ffd5db3f2 in abort () from /usr/lib/libc.so.12
#2  0x00007f7ffda0ef3c in SPF_error_stdio () from /usr/pkg/lib/libspf2.so.2
#3  0x00007f7ffda0eda2 in SPF_errorx () from /usr/pkg/lib/libspf2.so.2
#4  0x00007f7ffda0b191 in SPF_record_expand_data ()
   from /usr/pkg/lib/libspf2.so.2
#5  0x00007f7ffda0d732 in SPF_record_interpret ()
   from /usr/pkg/lib/libspf2.so.2
#6  0x00007f7ffda0d5f9 in SPF_record_interpret ()
   from /usr/pkg/lib/libspf2.so.2
#7  0x00007f7ffda0d5f9 in SPF_record_interpret ()
   from /usr/pkg/lib/libspf2.so.2
#8  0x00007f7ffda0f745 in SPF_request_query_record ()
   from /usr/pkg/lib/libspf2.so.2
#9  0x00007f7ffda0fa8c in SPF_request_query_mailfrom ()
   from /usr/pkg/lib/libspf2.so.2
#10 0x0000000000414530 in spf_check (ad=0x0, as=<value optimized out>,
    ap=<value optimized out>, priv=<value optimized out>) at spf.c:388
#11 0x0000000000406ecb in mlfi_envfrom (ctx=0x7f7ffce03260,
    envfrom=0x7f7ffc40f080) at milter-greylist.c:495
#12 0x000000000041ce39 in st_sender ()
#13 0x000000000041d935 in mi_engine ()
#14 0x000000000041ade8 in mi_handle_session ()
#15 0x0000000000419cc9 in mi_thread_handle_wrapper ()
#16 0x00007f7ffdc0b6a2 in pthread_create () from /usr/lib/libpthread.so.0
#17 0x00007f7ffd5541d0 in swapcontext () from /usr/lib/libc.so.12
#18 0x00007f7ffba00000 in ?? ()
#19 0x0000000611110001 in ?? ()
#20 0x0000000033330003 in ?? ()
#21 0x0000000000000000 in ?? ()

Unfortunately "gdb" refuses to print out any local variables of
spf_check(). I'll try to build without optimization.

	Kind regards

-- 
Matthias Scheler                                  http://zhadum.org.uk/

Re: [milter-greylist] Problem with "libspf2"

2009-06-10 by Matthias Scheler

On Wed, Jun 10, 2009 at 10:20:54AM +0100, Matthias Scheler wrote:
> On Wed, Jun 10, 2009 at 09:14:16AM +0100, Matthias Scheler wrote:
> > Unfortunately "gdb" refuses to print out any local variables of
> > spf_check(). I'll try to build without optimization.
> 
> I got another crash. It dies on a "bellnet.ca" e-mail address.

I've managed to write small program which reproduces the crash.
It is definitely a bug in "libspf2" and not in "milter-greylist".

	Kind regards

-- 
Matthias Scheler                                  http://zhadum.org.uk/

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.