Discussion:
mailfront segfault continues
m***@csi.hu
2005-08-17 17:25:45 UTC
Permalink
So even with my installation of mailfront -0.96, I see
segfaults:

Aug 17 12:19:56 thales kernel: smtpfront-qmail[6425]: segfault at 00000001005152cf rip 0000000000408368 rsp 00007fffffa3b578 error 4

My rblsmtpd/smtpfront-qmail logs show

2005-08-17 12:19:52.782631500 tcpserver: pid 6425 from 209.239.35.106
2005-08-17 12:19:52.783065500 tcpserver: ok 6425 thales.memphis.edu:141.225.8.55:25 host2.solucionweb.com:209.239.35.106::60535
2005-08-17 12:19:55.160568500 smtpfront-qmail[6425]: MAIL From:<***@csi.hu> SIZE=79200
2005-08-17 12:19:55.420664500 smtpfront-qmail[6425]: RCPT To:<***@csi.hu>
2005-08-17 12:19:55.420668500 smtpfront-qmail[6425]: 553 Sorry, message not deliverable - bad email addre
2005-08-17 12:19:55.420670500 smtpfront-qmail[6425]: 503 You must send RCPT TO: first
2005-08-17 12:19:56.267786500 smtpfront-qmail[6425]: MAIL From:<> SIZE=80224
2005-08-17 12:19:56.268305500 tcpserver: end 6425 status 11
2005-08-17 12:19:56.268332500 tcpserver: status: 0/40

Thx for any help,

Mate
--
---
Mate Wierdl | Dept. of Math. Sciences | University of Memphis
m***@csi.hu
2005-08-17 17:57:51 UTC
Permalink
This seems like a consistent pattern (bounces):

Aug 17 12:52:08 thales kernel: smtpfront-qmail[7177]: segfault at 00000001005151af rip 0000000000408368 rsp 00007fffff82efd8 error 4

and

2005-08-17 12:52:03.055149500 tcpserver: pid 7177 from 209.239.35.106
2005-08-17 12:52:03.482142500 tcpserver: ok 7177 thales.memphis.edu:141.225.8.55
:25 host2.solucionweb.com:209.239.35.106::35169
SIZE=79437
2005-08-17 12:52:06.975119500 smtpfront-qmail[7177]: RCPT To:<***@csi.hu>
2005-08-17 12:52:06.975123500 smtpfront-qmail[7177]: 553 Sorry, message not deli
verable - bad email addre
2005-08-17 12:52:06.975125500 smtpfront-qmail[7177]: 503 You must send RCPT TO:
first
2005-08-17 12:52:08.953372500 smtpfront-qmail[7177]: MAIL From:<> SIZE=80461
2005-08-17 12:52:08.953913500 tcpserver: end 7177 status 11

How do I investigate?

Mate
So even with my installation of mailfront -0.96, I see
Aug 17 12:19:56 thales kernel: smtpfront-qmail[6425]: segfault at 00000001005152cf rip 0000000000408368 rsp 00007fffffa3b578 error 4
My rblsmtpd/smtpfront-qmail logs show
2005-08-17 12:19:52.782631500 tcpserver: pid 6425 from 209.239.35.106
2005-08-17 12:19:52.783065500 tcpserver: ok 6425 thales.memphis.edu:141.225.8.55:25 host2.solucionweb.com:209.239.35.106::60535
2005-08-17 12:19:55.420668500 smtpfront-qmail[6425]: 553 Sorry, message not deliverable - bad email addre
2005-08-17 12:19:55.420670500 smtpfront-qmail[6425]: 503 You must send RCPT TO: first
2005-08-17 12:19:56.267786500 smtpfront-qmail[6425]: MAIL From:<> SIZE=80224
2005-08-17 12:19:56.268305500 tcpserver: end 6425 status 11
2005-08-17 12:19:56.268332500 tcpserver: status: 0/40
Thx for any help,
Mate
--
---
Mate Wierdl | Dept. of Math. Sciences | University of Memphis
---------------------------------------------------------------------
--
---
Mate Wierdl | Dept. of Math. Sciences | University of Memphis
Dale Woolridge
2005-08-17 18:04:48 UTC
Permalink
On 17-Aug-2005 12:57 mw-list-***@csi.hu wrote:
|
| How do I investigate?

Run through valgrind?
--
-dale
m***@csi.hu
2005-08-17 18:54:58 UTC
Permalink
Well, I have attached strace to tcpserver (that runs rblsmtpd which
then runs smtpfront-qmail). It really seems, creating From: <>
triggers it. First of all, I see

/var/log/messages:
Aug 17 13:44:24 thales kernel: smtpfront-qmail[7894]: segfault at 00000001005152bf rip 0000000000408368 rsp 00007fffffa2f368 error 4

/service/rblsmtpd/log/main/current:
2005-08-17 13:44:22.376625500 tcpserver: pid 7894 from 141.225.11.87
2005-08-17 13:44:22.380667500 tcpserver: ok 7894 thales.memphis.edu:141.225.8.55:25 wierdlmpc.msci.memphis.edu:141.225.11.87::51307
2005-08-17 13:44:24.057094500 smtpfront-qmail[7894]: MAIL FROM:<>
2005-08-17 13:44:24.058039500 tcpserver: end 7894 status 11

In the strace output, as the result of

# strace -p 6362 -t -f -v -o smtpfront.strace &

I see

[...]
7894 13:44:24 write(1, "250 thales.memphis.edu\r\n", 24) = 24
7894 13:44:24 poll([{fd=0, events=POLLIN, revents=POLLIN}], 1, 1200000) = 1
7894 13:44:24 read(0, "MAIL FROM:<>\r\n", 4096) = 14
7894 13:44:24 getpid() = 7894
7894 13:44:24 write(2, "smtpfront-qmail[7894]: MAIL FROM"..., 36) = 36
7894 13:44:24 --- SIGSEGV (Segmentation fault) @ 0 (0) ---
6362 13:44:24 <... accept resumed> 0x7fffffa80950, [16]) = ? ERESTARTSYS (To be resta
rted)
6362 13:44:24 --- SIGCHLD (Child exited) @ 0 (0) ---

I have put the strace output file to

http://www.csi.hu/mw/smtpfront.strace

I'll look at valgrind later.

Mate
Post by Dale Woolridge
|
| How do I investigate?
Run through valgrind?
--
-dale
---------------------------------------------------------------------
--
---
Mate Wierdl | Dept. of Math. Sciences | University of Memphis
m***@csi.hu
2005-08-17 19:26:59 UTC
Permalink
Post by m***@csi.hu
I'll look at valgrind later.
The darn thing does not work:

2005-08-17 14:22:12.823220500 valgrind: do_exec(/usr/local/bin/tcpserver) failed: Exec format error
2005-08-17 14:22:13.850991500 valgrind: wrong executable class (eg. 32-bit instead
2005-08-17 14:22:13.850995500 valgrind: of 64-bit)

I would have to recompile tcpserver, mailfront?

Mate
--
---
Mate Wierdl | Dept. of Math. Sciences | University of Memphis
Charlie Brady
2005-08-18 17:02:41 UTC
Permalink
Post by m***@csi.hu
Aug 17 12:52:08 thales kernel: smtpfront-qmail[7177]: segfault at 00000001005151af rip 0000000000408368 rsp 00007fffff82efd8 error 4
and
2005-08-17 12:52:03.055149500 tcpserver: pid 7177 from 209.239.35.106
2005-08-17 12:52:03.482142500 tcpserver: ok 7177 thales.memphis.edu:141.225.8.55
:25 host2.solucionweb.com:209.239.35.106::35169
SIZE=79437
2005-08-17 12:52:06.975123500 smtpfront-qmail[7177]: 553 Sorry, message not deli
verable - bad email addre
The spelling of "address" is at least suspicious.
m***@csi.hu
2005-08-18 14:40:24 UTC
Permalink
The problem is now completely simple: whenever I give a

mail from:<>

smtpfront-qmail segfaults.

Indeed,

# telnet thales 25
Trying 141.225.8.55...
Connected to thales.memphis.edu (141.225.8.55).
Escape character is '^]'.
220 thales.memphis.edu mailfront ESMTP
helo thales
250 thales.memphis.edu
mail from:<>
Connection closed by foreign host.

and in the the smtp logs (running recordio):

2005-08-18 09:03:47.643562500 tcpserver: pid 23266 from 141.225.8.55
2005-08-18 09:03:47.644223500 tcpserver: ok 23266 thales.memphis.edu:141.225.8.55:25 thales.memphis.edu:141.225.8.55::44278
005-08-18 09:03:47.647996500 23266 > 220 thales.memphis.edu mailfront ESMTP
005-08-18 09:03:55.839784500 23266 < helo thales
005-08-18 09:03:55.840370500 23266 > 250 thales.memphis.edu
005-08-18 09:04:07.654861500 23266 < mail from:<>
2005-08-18 09:04:07.654992500 smtpfront-qmail[23266]: MAIL from:<>
2005-08-18 09:04:07.655575500 23266 > [EOF]
2005-08-18 09:04:07.655577500 tcpserver: end 23266 status 11

Does anybody else get this? If not, are you running a 64 bit machine?

Mate
Post by m***@csi.hu
So even with my installation of mailfront -0.96, I see
Aug 17 12:19:56 thales kernel: smtpfront-qmail[6425]: segfault at 00000001005152cf rip 0000000000408368 rsp 00007fffffa3b578 error 4
My rblsmtpd/smtpfront-qmail logs show
2005-08-17 12:19:52.782631500 tcpserver: pid 6425 from 209.239.35.106
2005-08-17 12:19:52.783065500 tcpserver: ok 6425 thales.memphis.edu:141.225.8.55:25 host2.solucionweb.com:209.239.35.106::60535
2005-08-17 12:19:55.420668500 smtpfront-qmail[6425]: 553 Sorry, message not deliverable - bad email addre
2005-08-17 12:19:55.420670500 smtpfront-qmail[6425]: 503 You must send RCPT TO: first
2005-08-17 12:19:56.267786500 smtpfront-qmail[6425]: MAIL From:<> SIZE=80224
2005-08-17 12:19:56.268305500 tcpserver: end 6425 status 11
2005-08-17 12:19:56.268332500 tcpserver: status: 0/40
Thx for any help,
Mate
--
---
Mate Wierdl | Dept. of Math. Sciences | University of Memphis
---------------------------------------------------------------------
--
---
Mate Wierdl | Dept. of Math. Sciences | University of Memphis
Bruce Guenter
2005-08-18 15:49:24 UTC
Permalink
Post by m***@csi.hu
The problem is now completely simple: whenever I give a
mail from:<>
smtpfront-qmail segfaults.
Does anybody else get this? If not, are you running a 64 bit machine?
Can you reproduce from the command-line? It would be good if I could
get a backtrace (ie from gdb) to see where it is segfaulting. This
issue has happened before, but I haven't seen it (and I am running
mailfront on at least a couple of 64-bit systems).
--
Bruce Guenter <***@untroubled.org> http://untroubled.org/
OpenPGP key: 699980E8 / D0B7 C8DD 365D A395 29DA 2E2A E96F B2DC 6999 80E8
m***@csi.hu
2005-08-19 03:26:27 UTC
Permalink
Post by Bruce Guenter
Post by m***@csi.hu
The problem is now completely simple: whenever I give a
mail from:<>
smtpfront-qmail segfaults.
Does anybody else get this? If not, are you running a 64 bit machine?
Can you reproduce from the command-line? It would be good if I could
get a backtrace (ie from gdb) to see where it is segfaulting. This
issue has happened before, but I haven't seen it (and I am running
mailfront on at least a couple of 64-bit systems).
Well, I just recompiled from sources since the rpm strips the
binaries, and here is what I get when running the new binary from gdb

# gdb ./smtpfront-qmail
GNU gdb Red Hat Linux (6.3.0.0-1.21rh)
Copyright 2004 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-redhat-linux-gnu"...Using host libthread_db l ibrary "/lib64/libthread_db.so.1".

(gdb) run
Starting program: /usr/src/redhat/SOURCES/mailfront-0.96/smtpfront-qmail
220 unknown mailfront ESMTP
mail from: <>
smtpfront-qmail[570]: MAIL from: <>

Program received signal SIGSEGV, Segmentation fault.
0x0000000000408858 in str_findprev ()
(gdb) bt
#0 0x0000000000408858 in str_findprev ()
#1 0x0000000000404af6 in backend_validate_sender (sender=0x50df50)
at qmail-validate.c:49
#2 0x0000000000401db9 in handle_sender (sender=0x50df50) at std-handle.c:119
#3 0x0000000000402b46 in MAIL () at smtp-commands.c:163
#4 0x0000000000403179 in smtp_dispatch () at smtp-commands.c:339
#5 0x00000000004018a5 in smtp_mainloop () at smtp-mainloop.c:47
#6 0x0000000000401781 in main () at smtpfront-qmail.c:10
(gdb) c
Continuing.

Program terminated with signal SIGSEGV, Segmentation fault.
The program no longer exists.
(gdb) q


I have put this freshly compiled directory to

http://www.csi.hu/mw/mailfront-0.96.debug.tar.gz

Mate
--
---
Mate Wierdl | Dept. of Math. Sciences | University of Memphis
Dale Woolridge
2005-08-19 06:49:33 UTC
Permalink
On 18-Aug-2005 22:26 mw-list-***@csi.hu wrote:
|
| Well, I just recompiled from sources since the rpm strips the
| binaries, and here is what I get when running the new binary from gdb

Maybe you should recompile bglibs from source if you haven't
already done that too. str_findlast() is a macro for str_findprev(),
below:

/** Find the previous instance of the given character on or before \c pos */
int str_findprev(const str* s, char ch, unsigned pos)
{
char* p;
if (pos >= s->len) pos = s->len - 1;
for (p = s->s + pos; p >= s->s; --p)
if (*p == ch) return p - s->s;
return -1;
}

What if s->len = 0, which appears to be the case. I think the
pointer arithmetic in the assignment of the for loop works
in 32-bit, but not 64-bit, at least not with the given types.
Anyway, if you could walk through this section of code after
setting a breakpoint in backend_validate_sender, it might
be fruitful.
--
-dale
Gerrit Pape
2005-08-19 07:34:07 UTC
Permalink
Post by m***@csi.hu
Post by Bruce Guenter
Post by m***@csi.hu
Does anybody else get this? If not, are you running a 64 bit machine?
Can you reproduce from the command-line? It would be good if I could
get a backtrace (ie from gdb) to see where it is segfaulting. This
issue has happened before, but I haven't seen it (and I am running
mailfront on at least a couple of 64-bit systems).
Well, I just recompiled from sources since the rpm strips the
binaries, and here is what I get when running the new binary from gdb
# gdb ./smtpfront-qmail
(gdb) run
Starting program: /usr/src/redhat/SOURCES/mailfront-0.96/smtpfront-qmail
220 unknown mailfront ESMTP
mail from: <>
smtpfront-qmail[570]: MAIL from: <>
Program received signal SIGSEGV, Segmentation fault.
0x0000000000408858 in str_findprev ()
Does this help?:
http://lists.untroubled.org/?list=bgware&cmd=showmsg&msgnum=4585

Regards, Gerrit.
m***@csi.hu
2005-08-19 16:36:19 UTC
Permalink
Post by Gerrit Pape
http://lists.untroubled.org/?list=bgware&cmd=showmsg&msgnum=4585
Thx, this solved the problem. Does not vanilla qmail have similar
problems on 64 bit machines?

In any case, for those who need it, I have put the patched bglibs rpm
and the cvm, mailfront rpms built against it to


http://www.csi.hu/mw/bglibs-1.025-2.src.rpm
http://www.csi.hu/mw/bglibs-1.025-2.x86_64.rpm
http://www.csi.hu/mw/cvm-0.71-2.src.rpm
http://www.csi.hu/mw/cvm-0.71-2.x86_64.rpm
http://www.csi.hu/mw/mailfront-0.96-2.src.rpm
http://www.csi.hu/mw/mailfront-0.96-2.x86_64.rpm

The spec file for these already contain the

Copyright -> License

correction. The cvm spec file also has the

echo gcc -s -L/usr/lib64/mysql >conf-ld

correction to the original

echo gcc -s >conf-ld

Mate
--
---
Mate Wierdl | Dept. of Math. Sciences | University of Memphis
Bruce Guenter
2005-08-19 18:04:14 UTC
Permalink
Post by m***@csi.hu
The cvm spec file also has the
echo gcc -s -L/usr/lib64/mysql >conf-ld
Should that read:
echo gcc -s -L%{_libdir}/mysql >conf-ld
? If so, I'll add it to my master spec.
--
Bruce Guenter <***@untroubled.org> http://untroubled.org/
OpenPGP key: 699980E8 / D0B7 C8DD 365D A395 29DA 2E2A E96F B2DC 6999 80E8
m***@csi.hu
2005-08-19 19:04:36 UTC
Permalink
Post by Bruce Guenter
Post by m***@csi.hu
The cvm spec file also has the
echo gcc -s -L/usr/lib64/mysql >conf-ld
echo gcc -s -L%{_libdir}/mysql >conf-ld
? If so, I'll add it to my master spec.
Sure (I just doublechecked).

Mate
--
---
Mate Wierdl | Dept. of Math. Sciences | University of Memphis
Loading...