Mailing List Archive

Segmentation fault in libspf2-1.2.5
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Sorry for my english. I hope you will understand me:

I'm trying to configure exim-4.69 with libsfp2-1.2.5.

Exim receives Segmentation Fault while processing spf condition. It crashes
every time when the message should not be delivered.

I'm using 64-bit Debian Etch.

I tried to use:
  * Exim-4.68 and Exim-4.69 (compiled with libspf2, libsrs_alt and openldap)
  * Debian package libspf2-1.2.5-2
  * libspf2-1.2.5 compiled from sources with the default options (i.e.
configure; make; make install)

Every time there was the same problem.

I tried to debug it:

11:48:15 root@lookout:~# gdb /usr/local/bin/exim
GNU gdb 6.4.90-debian
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu"...Using host libthread_db
library "/lib/libthread_db.so.1".

(gdb) run -bh 192.168.0.191
Starting program: /usr/local/bin/exim -bh 192.168.0.191
[Thread debugging using libthread_db enabled]
[New Thread 46972538120544 (LWP 10604)]

**** SMTP testing session as if from host 192.168.0.191
**** but without any ident (RFC 1413) callback.
**** This is not for real!

>>> host in hosts_connection_nolog? no (option unset)
>>> host in host_lookup? no (end of list)
>>> host in host_reject_connection? no (option unset)
>>> host in sender_unqualified_hosts? no (option unset)
>>> host in recipient_unqualified_hosts? no (option unset)
>>> host in helo_verify_hosts? no (option unset)
>>> host in helo_try_verify_hosts? no (option unset)
>>> host in helo_accept_junk_hosts? no (option unset)
220 betamail.touk.pl ESMTP Thu, 27 Dec 2007 11:48:47 +0100; TouK e-mail
server.
helo z
>>> z in helo_lookup_domains? no (end of list)
250 betamail.touk.pl Hello z [192.168.0.191]
mail from: z@onet.pl
250 OK
rcpt to: pzz@touk.pl
>>> using ACL "acl_check_rcpt"
>>> processing "accept"
>>> check hosts = :
>>> host in ":"? no (end of list)
>>> accept: condition test failed
>>> processing "deny"
>>> check domains = +local_domains
>>> touk.pl in "touk.pl : chatka0.touk.pl : mail.touk.pl : apps.touk.pl"? yes
(matched "touk.pl")
>>> touk.pl in "+local_domains"? yes (matched "+local_domains")
>>> check local_parts = ^[.] : ^.*[@%!/|]
>>> pzz in "^[.] : ^.*[@%!/|]"? no (end of list)
>>> deny: condition test failed
>>> processing "deny"
>>> check domains = !+local_domains
>>> touk.pl in "!+local_domains"? no (matched "!+local_domains" - cached)
>>> deny: condition test failed
>>> processing "accept"
>>> check hosts = +relay_from_hosts
>>> host in "127.0.0.1"? no (end of list)
>>> host in "+relay_from_hosts"? no (end of list)
>>> accept: condition test failed
>>> processing "accept"
>>> check local_parts = postmaster
>>> pzz in "postmaster"? no (end of list)
>>> accept: condition test failed
>>> processing "accept"
>>> check authenticated = *
>>> accept: condition test failed
>>> processing "deny"
>>> check hosts = ! 213.180.128.0/19
>>> host in "! 213.180.128.0/19"? yes (end of list)
>>> check condition = ${if eq{$sender_address}{kartki@onet.pl}{yes}{no}}
>>>                 = no
>>> deny: condition test failed
>>> processing "deny"
>>> check delay = 5s
>>> delay modifier requests 5-second delay
>>> delay skipped in -bh checking mode
>>> check dnslists = zen.spamhaus.org
>>> DNS list check: zen.spamhaus.org
>>> new DNS lookup for 191.0.168.192.zen.spamhaus.org
>>> DNS lookup for 191.0.168.192.zen.spamhaus.org failed
>>> => that means 192.168.0.191 is not listed at zen.spamhaus.org
>>> deny: condition test failed
>>> processing "deny"
>>> check hosts = ! +our_relays
>>> host in "127.0.0.1"? no (end of list)
>>> host in "! +our_relays"? yes (end of list)
>>> check spf = fail

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 46972538120544 (LWP 10604)]
0x00002ab8a4b2b9e0 in memset () from /lib/libc.so.6
(gdb) backtrace
#0  0x00002ab8a4b2b9e0 in memset () from /lib/libc.so.6
#1  0x00002ab8a48a4d2f in SPF_record_expand_data (spf_server=<value optimized
out>, spf_request=0x5e0120, spf_response=<value optimized out>,
data=0x5e00b4, data_len=0,
    bufp=0x7fff06ec6ec0, buflenp=0x7fff06ec6ecc) at spf_expand.c:169
#2  0x00002ab8a48a53e7 in SPF_server_get_default_explanation
(spf_server=0x5e48c0, spf_request=0x0, spf_response=0x400000141,
bufp=0x7fff06ec6ec0,
    buflenp=<value optimized out>) at spf_get_exp.c:57
#3  0x00002ab8a48a55e6 in SPF_request_get_exp (spf_server=0x5d4fb0,
spf_request=0x5e0120, spf_response=0x5e4230, spf_record=0x5e4850,
bufp=0x7fff06ec6ec0,
    buflenp=0x7fff06ec6ecc) at spf_get_exp.c:141
#4  0x00002ab8a48a68c0 in SPF_i_done (spf_response=0x5e4230, result=<value
optimized out>, reason=<value optimized out>, err=SPF_E_SUCCESS) at
spf_interpret.c:77
#5  0x00002ab8a48a75d0 in SPF_record_interpret (spf_record=0x5e4850,
spf_request=0x5e0120, spf_response=0x5e4230, depth=0) at spf_interpret.c:1166
#6  0x00002ab8a48a9735 in SPF_request_query_record (spf_request=0x5e0120,
spf_response=0x5e4230, spf_record=0x5e4850, err=SPF_E_SUCCESS) at
spf_request.c:224
#7  0x00002ab8a48a9a77 in SPF_request_query_mailfrom (spf_request=0x5e0120,
spf_responsep=0x5c3c08) at spf_request.c:255
#8  0x000000000046aa71 in spf_process ()
#9  0x000000000040a63f in acl_check_condition ()
#10 0x00000000004085de in acl_check_internal ()
#11 0x0000000000408c43 in acl_check ()
#12 0x0000000000455049 in smtp_setup_msg ()
#13 0x000000000042024f in main ()
(gdb)

I do not know what kind of information should I attache. Do you need my exim
configuration? Or my exim/libspf binaries?

- --
Pawel Zuzelski TouK s.k.a.
e-mail: pzz@touk.pl jid: pzz@touk.pl
gpg key: http://user.touk.pl/pzz/gpg.key
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFHc75XWK8wWdpYeNARAj9WAJ4vEokI6KiqHIxYaEOsIkZzEllccwCfcEaI
X8j0ZNBWHYssYCIeBypxynk=
=nKJ3
-----END PGP SIGNATURE-----

-------------------------------------------
Sender Policy Framework: http://www.openspf.org
Archives: http://v2.listbox.com/member/archive/1007/=now
RSS Feed: http://v2.listbox.com/member/archive/rss/1007/
Modify Your Subscription: http://v2.listbox.com/member/?member_id=1311533&id_secret=79494539-0c836a
Powered by Listbox: http://www.listbox.com
Re: Segmentation fault in libspf2-1.2.5 [ In reply to ]
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Paweł Zuzelski wrote:
> I'm trying to configure exim-4.69 with libsfp2-1.2.5.
>
> Exim receives Segmentation Fault while processing spf condition. It
> crashes every time when the message should not be delivered.
>
> I'm using 64-bit Debian Etch.
>
> I tried to use:
>   * Exim-4.68 and Exim-4.69 (compiled with libspf2, libsrs_alt and
> openldap)
> * Debian package libspf2-1.2.5-2
>   * libspf2-1.2.5 compiled from sources with the default options (i.e.
> configure; make; make install)

Can you please try upgrading the libspf2 package to the version in Debian/
testing, i.e., 1.2.5.dfsg-4 (Etch has only 1.2.5-4). The newer Debian
packages have some issues with 64 bit architectures fixed.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFHc8SQwL7PKlBZWjsRAuEAAJ9BYTl8d7rvxV+d3mwk2bo5oemFAgCfSpRD
oacYHxFcBUmpWM6yBUIlZt0=
=OEqR
-----END PGP SIGNATURE-----

-------------------------------------------
Sender Policy Framework: http://www.openspf.org
Archives: http://v2.listbox.com/member/archive/1007/=now
RSS Feed: http://v2.listbox.com/member/archive/rss/1007/
Modify Your Subscription: http://v2.listbox.com/member/?member_id=1311533&id_secret=79500505-444de0
Powered by Listbox: http://www.listbox.com
Re: Segmentation fault in libspf2-1.2.5 [ In reply to ]
Pawel,

Not sure if this is the same thing or not, but I had a similar problem
with exim-4.68 & libspf2-1.2.5 on Sun Solaris 10. One of the Solaris
patches tightened up some of the Solaris code and then Exim/libspf started
failing. It came down to a structure in libspf2 not being initialized to
zeros when it should have been. In src/libspf2/spf_dns_resolve.c, in the
SPF_dns_resolv_lookup routine, I had to change the 'malloc' call, to a
'calloc' call as below, from:

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

res_spec = pthread_getspecific(res_state_key);
if (res_spec == NULL) {
res_state = (struct __res_state *)
malloc(sizeof(struct
__res_state));
if (res_ninit(res_state) != 0) {
SPF_error("Failed to call res_ninit()");
}
pthread_setspecific(res_state_key, (void *)res_state);
}
else {
res_state = (struct __res_state *)res_spec;
}

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

to:

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

res_spec = pthread_getspecific(res_state_key);
if (res_spec == NULL) {
res_state = (struct __res_state *)
calloc(1,sizeof(struct
__res_state));
if (res_ninit(res_state) != 0) {
SPF_error("Failed to call res_ninit()");
}
pthread_setspecific(res_state_key, (void *)res_state);
}
else {
res_state = (struct __res_state *)res_spec;
}

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

I have not had any problems since and it has been a few months now. Like
I said, I don't know if this is your problem, but it might be worth a try.
Good Luck.

Dan



Please respond to spf-devel@v2.listbox.com

To: SPF Development <spf-devel@v2.listbox.com>
cc: (bcc: Dan Mitton/YD/RWDOE)
Subject: [spf-devel] Segmentation fault in libspf2-1.2.5
LSN: Not Relevant
User Filed as: Not a Record

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Sorry for my english. I hope you will understand me:

I'm trying to configure exim-4.69 with libsfp2-1.2.5.

Exim receives Segmentation Fault while processing spf condition. It
crashes
every time when the message should not be delivered.

I'm using 64-bit Debian Etch.

I tried to use:
* Exim-4.68 and Exim-4.69 (compiled with libspf2, libsrs_alt and
openldap)
* Debian package libspf2-1.2.5-2
* libspf2-1.2.5 compiled from sources with the default options (i.e.
configure; make; make install)

Every time there was the same problem.

I tried to debug it:

11:48:15 root@lookout:~# gdb /usr/local/bin/exim
GNU gdb 6.4.90-debian
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you
are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for
details.
This GDB was configured as "x86_64-linux-gnu"...Using host libthread_db
library "/lib/libthread_db.so.1".

(gdb) run -bh 192.168.0.191
Starting program: /usr/local/bin/exim -bh 192.168.0.191
[Thread debugging using libthread_db enabled]
[New Thread 46972538120544 (LWP 10604)]

**** SMTP testing session as if from host 192.168.0.191
**** but without any ident (RFC 1413) callback.
**** This is not for real!

>>> host in hosts_connection_nolog? no (option unset)
>>> host in host_lookup? no (end of list)
>>> host in host_reject_connection? no (option unset)
>>> host in sender_unqualified_hosts? no (option unset)
>>> host in recipient_unqualified_hosts? no (option unset)
>>> host in helo_verify_hosts? no (option unset)
>>> host in helo_try_verify_hosts? no (option unset)
>>> host in helo_accept_junk_hosts? no (option unset)
220 betamail.touk.pl ESMTP Thu, 27 Dec 2007 11:48:47 +0100; TouK e-mail
server.
helo z
>>> z in helo_lookup_domains? no (end of list)
250 betamail.touk.pl Hello z [192.168.0.191]
mail from: z@onet.pl
250 OK
rcpt to: pzz@touk.pl
>>> using ACL "acl_check_rcpt"
>>> processing "accept"
>>> check hosts = :
>>> host in ":"? no (end of list)
>>> accept: condition test failed
>>> processing "deny"
>>> check domains = +local_domains
>>> touk.pl in "touk.pl : chatka0.touk.pl : mail.touk.pl : apps.touk.pl"?
yes
(matched "touk.pl")
>>> touk.pl in "+local_domains"? yes (matched "+local_domains")
>>> check local_parts = ^[.] : ^.*[@%!/|]
>>> pzz in "^[.] : ^.*[@%!/|]"? no (end of list)
>>> deny: condition test failed
>>> processing "deny"
>>> check domains = !+local_domains
>>> touk.pl in "!+local_domains"? no (matched "!+local_domains" - cached)
>>> deny: condition test failed
>>> processing "accept"
>>> check hosts = +relay_from_hosts
>>> host in "127.0.0.1"? no (end of list)
>>> host in "+relay_from_hosts"? no (end of list)
>>> accept: condition test failed
>>> processing "accept"
>>> check local_parts = postmaster
>>> pzz in "postmaster"? no (end of list)
>>> accept: condition test failed
>>> processing "accept"
>>> check authenticated = *
>>> accept: condition test failed
>>> processing "deny"
>>> check hosts = ! 213.180.128.0/19
>>> host in "! 213.180.128.0/19"? yes (end of list)
>>> check condition = ${if eq{$sender_address}{kartki@onet.pl}{yes}{no}}
>>> = no
>>> deny: condition test failed
>>> processing "deny"
>>> check delay = 5s
>>> delay modifier requests 5-second delay
>>> delay skipped in -bh checking mode
>>> check dnslists = zen.spamhaus.org
>>> DNS list check: zen.spamhaus.org
>>> new DNS lookup for 191.0.168.192.zen.spamhaus.org
>>> DNS lookup for 191.0.168.192.zen.spamhaus.org failed
>>> => that means 192.168.0.191 is not listed at zen.spamhaus.org
>>> deny: condition test failed
>>> processing "deny"
>>> check hosts = ! +our_relays
>>> host in "127.0.0.1"? no (end of list)
>>> host in "! +our_relays"? yes (end of list)
>>> check spf = fail

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 46972538120544 (LWP 10604)]
0x00002ab8a4b2b9e0 in memset () from /lib/libc.so.6
(gdb) backtrace
#0 0x00002ab8a4b2b9e0 in memset () from /lib/libc.so.6
#1 0x00002ab8a48a4d2f in SPF_record_expand_data (spf_server=<value
optimized
out>, spf_request=0x5e0120, spf_response=<value optimized out>,
data=0x5e00b4, data_len=0,
bufp=0x7fff06ec6ec0, buflenp=0x7fff06ec6ecc) at spf_expand.c:169
#2 0x00002ab8a48a53e7 in SPF_server_get_default_explanation
(spf_server=0x5e48c0, spf_request=0x0, spf_response=0x400000141,
bufp=0x7fff06ec6ec0,
buflenp=<value optimized out>) at spf_get_exp.c:57
#3 0x00002ab8a48a55e6 in SPF_request_get_exp (spf_server=0x5d4fb0,
spf_request=0x5e0120, spf_response=0x5e4230, spf_record=0x5e4850,
bufp=0x7fff06ec6ec0,
buflenp=0x7fff06ec6ecc) at spf_get_exp.c:141
#4 0x00002ab8a48a68c0 in SPF_i_done (spf_response=0x5e4230, result=<value

optimized out>, reason=<value optimized out>, err=SPF_E_SUCCESS) at
spf_interpret.c:77
#5 0x00002ab8a48a75d0 in SPF_record_interpret (spf_record=0x5e4850,
spf_request=0x5e0120, spf_response=0x5e4230, depth=0) at
spf_interpret.c:1166
#6 0x00002ab8a48a9735 in SPF_request_query_record (spf_request=0x5e0120,
spf_response=0x5e4230, spf_record=0x5e4850, err=SPF_E_SUCCESS) at
spf_request.c:224
#7 0x00002ab8a48a9a77 in SPF_request_query_mailfrom
(spf_request=0x5e0120,
spf_responsep=0x5c3c08) at spf_request.c:255
#8 0x000000000046aa71 in spf_process ()
#9 0x000000000040a63f in acl_check_condition ()
#10 0x00000000004085de in acl_check_internal ()
#11 0x0000000000408c43 in acl_check ()
#12 0x0000000000455049 in smtp_setup_msg ()
#13 0x000000000042024f in main ()
(gdb)

I do not know what kind of information should I attache. Do you need my
exim
configuration? Or my exim/libspf binaries?

- --
Pawel Zuzelski TouK s.k.a.
e-mail: pzz@touk.pl jid: pzz@touk.pl
gpg key: http://user.touk.pl/pzz/gpg.key
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFHc75XWK8wWdpYeNARAj9WAJ4vEokI6KiqHIxYaEOsIkZzEllccwCfcEaI
X8j0ZNBWHYssYCIeBypxynk=
=nKJ3
-----END PGP SIGNATURE-----

-------------------------------------------
Sender Policy Framework: http://www.openspf.org
Archives: http://v2.listbox.com/member/archive/1007/=now
RSS Feed: http://v2.listbox.com/member/archive/rss/1007/
Modify Your Subscription:
http://v2.listbox.com/member/?&
Powered by Listbox: http://www.listbox.com



-------------------------------------------
Sender Policy Framework: http://www.openspf.org
Archives: http://v2.listbox.com/member/archive/1007/=now
RSS Feed: http://v2.listbox.com/member/archive/rss/1007/
Modify Your Subscription: http://v2.listbox.com/member/?member_id=1311533&id_secret=79508691-7db42c
Powered by Listbox: http://www.listbox.com
Re: Re: Segmentation fault in libspf2-1.2.5 [ In reply to ]
On Thu, 27 Dec 2007 15:28:13 +0000 Julian Mehnle <julian@mehnle.net> wrote:
>PaweB Zuzelski wrote:
>> I'm trying to configure exim-4.69 with libsfp2-1.2.5.
>>
>> Exim receives Segmentation Fault while processing spf condition. It
>> crashes every time when the message should not be delivered.
>>
>> I'm using 64-bit Debian Etch.
>>
>> I tried to use:
>>   * Exim-4.68 and Exim-4.69 (compiled with libspf2, libsrs_alt and
>> openldap)
>> * Debian package libspf2-1.2.5-2
>>   * libspf2-1.2.5 compiled from sources with the default options (i.e.
>> configure; make; make install)
>
>Can you please try upgrading the libspf2 package to the version in Debian/
>testing, i.e., 1.2.5.dfsg-4 (Etch has only 1.2.5-4). The newer Debian
>packages have some issues with 64 bit architectures fixed.

Also, you should report this in the Debian BTS. The Debian maintainer for the packge is active and may have other suggestions.

Scott K

-------------------------------------------
Sender Policy Framework: http://www.openspf.org
Archives: http://v2.listbox.com/member/archive/1007/=now
RSS Feed: http://v2.listbox.com/member/archive/rss/1007/
Modify Your Subscription: http://v2.listbox.com/member/?member_id=1311533&id_secret=79566144-15b0b3
Powered by Listbox: http://www.listbox.com
Re: Re: Segmentation fault in libspf2-1.2.5 [ In reply to ]
On Thursday 27 December 2007 16:28:13 Julian Mehnle wrote:
> Paweł Zuzelski wrote:
> > I'm trying to configure exim-4.69 with libsfp2-1.2.5.
> >
> > Exim receives Segmentation Fault while processing spf condition. It
> > crashes every time when the message should not be delivered.
> >
> > I'm using 64-bit Debian Etch.
> >
> > I tried to use:
> >   * Exim-4.68 and Exim-4.69 (compiled with libspf2, libsrs_alt and
> > openldap)
> > * Debian package libspf2-1.2.5-2
> >   * libspf2-1.2.5 compiled from sources with the default options (i.e.
> > configure; make; make install)
>
> Can you please try upgrading the libspf2 package to the version in Debian/
> testing, i.e., 1.2.5.dfsg-4 (Etch has only 1.2.5-4). The newer Debian
> packages have some issues with 64 bit architectures fixed.

It works on libspf2-1.2.5.dfsg-4 (64-bit debian lenny).

Thanks.

--
Paweł Zuzelski TouK s.k.a.
e-mail: pzz@touk.pl jid: pzz@touk.pl
gpg key: http://user.touk.pl/pzz/gpg.key

-------------------------------------------
Sender Policy Framework: http://www.openspf.org
Archives: http://v2.listbox.com/member/archive/1007/=now
RSS Feed: http://v2.listbox.com/member/archive/rss/1007/
Modify Your Subscription: http://v2.listbox.com/member/?member_id=1311533&id_secret=80849863-3a3a25
Powered by Listbox: http://www.listbox.com