On 11/21/2007 05:13 AM, Steve wrote:
-------- Original-Nachricht --------
Datum: Wed, 21 Nov 2007 00:30:07 -0500
Von: Jacob Joseph <[EMAIL PROTECTED]>
An: [email protected], Steve <[EMAIL PROTECTED]>
Betreff: Re: [dspam-users] Debugging a Segfault
Hi Steve.
Hallo Jacob
On 11/19/2007 05:10 PM, Steve wrote:
-------- Original-Nachricht --------
Datum: Mon, 19 Nov 2007 15:27:47 -0500
Von: Jacob Joseph <[EMAIL PROTECTED]>
An: [email protected]
Betreff: [dspam-users] Debugging a Segfault
Note: I am cross posting from dspam-dev, after receiving no reply
there.
Hi.
I believe I am in need of assistance in diagnosing and correcting a
crash. Recently, dspam is segfaulting on a great many messages, enough
to preclude its use. I have attached one such message, include a
little
information from gdb, and list contents of dspam.debug below. I'd
greatly appreciate any help with this issue and would be happy to
assist
in any way.
For the record, I am running dspam 3.8.0-r7
There is no DSPAM 3.8.0-r7. Probably you are using Gentoo Linux? They
have dspam-3.8.0-r7 in their portage.
Sorry about this. I thought I had typed something about this being on
Gentoo.
No problem.
along with a postgres 8.0.13
server. Note that the particular crash below occurs only when showing
factors, but disabling this only delays the crash until the next access
to CTX->factorx->first. Recently, I did switch to using postgres from
mysql. I do not believe I received these crashes under mysql. This
crash seems unrelated to the database contents, precluding a conversion
issue, and occurs even during training of new users.
Thanks.
~Jacob
GDB:
Short story: CTX->factors->first->ptr at dspam.c:3092 does not appear
to
be initialized
----------------------------------------------------------------
Starting program: /usr/bin/dspam --debug --user jacob --mode=notrain
--client --stdout --deliver=innocent,spam <
/home/jacob/[EMAIL PROTECTED]
Might I ask you what the point is in using TEFT but running delivery in
NOTRAIN? Would it not be more economic to switch to TOE?
Oh, I only had the notrain during testing so as to not alter the database.
[Thread debugging using libthread_db enabled]
[New Thread -1212545344 (LWP 17038)]
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1212545344 (LWP 17038)]
add_xdspam_headers (CTX=0x80705e0, ATX=0xbfe51b18) at dspam.c:3092
3092 snprintf(scratch, sizeof(scratch), "%s, %2.5f",
(gdb) list
3087 node_ft = c_nt_first(CTX->factors, &c_ft);
3088 while(node_ft != NULL) {
3089 struct dspam_factor *f = (struct dspam_factor *)
node_ft->ptr;
3090 if (f) {
3091 strlcat(data, ",\n\t", sizeof(data));
3092 snprintf(scratch, sizeof(scratch), "%s, %2.5f",
3093 f->token_name, f->value);
3094 strlcat(data, scratch, sizeof(data));
3095 }
3096 node_ft = c_nt_next(CTX->factors, &c_ft);
(gdb) bt
#0 add_xdspam_headers (CTX=0x80705e0, ATX=0xbfe51b18) at dspam.c:3092
#1 0x08053442 in process_message (ATX=0xbfe51b18, message=0x8062bb8,
username=0x8062930 "jacob", result_string=0xbfe519d0) at
dspam.c:727
#2 0x08054295 in process_users (ATX=0xbfe51b18, message=0x8062b10)
at dspam.c:1797
#3 0x08054f30 in main (argc=Cannot access memory at address 0x0
) at dspam.c:258
(gdb) print CTX->factors
$11 = (struct nt *) 0x806e688
(gdb) print *CTX->factors
$12 = {
first = 0x806e570,
insert = 0x616d6c69,
items = 1700146542,
nodetype = 1869181810
}
(gdb) print *CTX->factors->first
$13 = {
ptr = 0x38,
next = 0x20
}
-----------------------------------------------------------
Strange. Adding the headers is crashing it. I used the same version as you (now
I am on r8 (see bugs.gentoo.org)) and never had that issue with DSPAM.
dspam.debug
-----------------------------------------------------------
17124: [11/14/2007 00:19:02] No QuarantineAgent option found. Using
standard quarantine.
17124: [11/14/2007 00:19:02] DSPAM Instance Startup
17124: [11/14/2007 00:19:02] input args: /usr/bin/dspam --debug --user
jacob --mode=notrain --client --stdout --deliver=innocent,spam
17124: [11/14/2007 00:19:02] pass-thru args:
17124: [11/14/2007 00:19:02] processing user jacob
17124: [11/14/2007 00:19:02] uid = 0, euid = 0, gid = 0, egid = 503
17124: [11/14/2007 00:19:02] loading preferences for user jacob
17124: [11/14/2007 00:19:02] Loading preferences for uid 680
17124: [11/14/2007 00:19:02] Loading preferences for uid 0
17124: [11/14/2007 00:19:02] default preferences empty. reverting to
dspam.conf preferences.
17124: [11/14/2007 00:19:02] Loading preferences from dspam.conf
17124: [11/14/2007 00:19:02] using
/var/spool/dspam/opt-in/local/jacob.dspam as path
17124: [11/14/2007 00:19:02] using
/var/spool/dspam/opt-out/local/jacob.nodspam as path
17124: [11/14/2007 00:19:02] sedation level set to: 0
17124: [11/14/2007 00:19:02] Connecting to 127.0.0.1:3310 for virus
check
17124: [11/14/2007 00:19:02] Loading 278 BNR patterns
17124: [11/14/2007 00:19:02] bnr reported snr of 6.597
17124: [11/14/2007 00:19:02] Interesting BNR Pattern:
bnr.s|0.05_0.05_0.40_ 0.01000 0s 3i
17124: [11/14/2007 00:19:02] Interesting BNR Pattern:
bnr.s|0.05_0.40_0.40_ 0.01000 0s 7i
17124: [11/14/2007 00:19:02] Interesting BNR Pattern:
bnr.s|0.05_0.05_0.05_ 0.01000 0s 41i
17124: [11/14/2007 00:19:02] Interesting BNR Pattern:
bnr.s|0.00_0.00_0.05_ 0.01000 0s 38i
17124: [11/14/2007 00:19:02] Interesting BNR Pattern:
bnr.s|0.05_0.40_0.05_ 0.01000 0s 3i
17124: [11/14/2007 00:19:02] Interesting BNR Pattern:
bnr.s|0.40_0.05_0.40_ 0.01000 0s 7i
17124: [11/14/2007 00:19:02] Interesting BNR Pattern:
bnr.s|0.40_0.40_0.40_ 0.01000 0s 8i
17124: [11/14/2007 00:19:02] Interesting BNR Pattern: bnr.t| 0.01000 0s
46i
17124: [11/14/2007 00:19:02] Interesting BNR Pattern:
bnr.s|0.40_0.05_0.05_ 0.01000 0s 3i
17124: [11/14/2007 00:19:02] Interesting BNR Pattern:
bnr.s|0.40_0.40_0.05_ 0.01000 0s 7i
17124: [11/14/2007 00:19:02] Interesting BNR Pattern:
bnr.s|0.00_0.05_0.05_ 0.01000 0s 38i
17124: [11/14/2007 00:19:02] Whitelist threshold: 10
17124: [11/14/2007 00:19:02] [burton] [0.001190] is+> (1frq, 0s, 614i)
17124: [11/14/2007 00:19:02] [burton] [0.002290] >+I (2frq, 8s, 2550i)
17124: [11/14/2007 00:19:02] [burton] [0.002290] >+I (2frq, 8s, 2550i)
17124: [11/14/2007 00:19:02] [burton] [0.002382] >+The (2frq, 3s, 919i)
17124: [11/14/2007 00:19:02] [burton] [0.002382] >+The (2frq, 3s, 919i)
17124: [11/14/2007 00:19:02] [burton] [0.002888] https+// (1frq, 11s,
2778i)
17124: [11/14/2007 00:19:02] [burton] [0.003946]
X-Mailman-Version*2.1.5
(1frq, 29s, 5355i)
17124: [11/14/2007 00:19:02] [burton] [0.004760] >+> (60frq, 38s,
5812i)
17124: [11/14/2007 00:19:02] [burton] [0.004760] >+> (60frq, 38s,
5812i)
17124: [11/14/2007 00:19:02] [burton] [0.005031] wrote+> (2frq, 39s,
5643i)
17124: [11/14/2007 00:19:02] [burton] [0.005031] wrote+> (2frq, 39s,
5643i)
17124: [11/14/2007 00:19:02] [burton] [0.006364] https (1frq, 26s,
2970i)
17124: [11/14/2007 00:19:02] [burton] [0.006518] List-Post*<mailto
(1frq, 62s, 6913i)
17124: [11/14/2007 00:19:02] [burton] [0.006790] List-Help*request
(1frq, 55s, 5886i)
17124: [11/14/2007 00:19:02] [burton] [0.008260] Errors-To*bounces
(1frq, 67s, 5885i)
17124: [11/14/2007 00:19:02] [burton] [0.008264] Sender*bounces (1frq,
67s, 5882i)
17124: [11/14/2007 00:19:02] [burton] [0.008533] Url*redhat (1frq, 0s,
85i)
17124: [11/14/2007 00:19:02] [burton] [0.008634]
List-Help*cluster+request (1frq, 0s, 84i)
17124: [11/14/2007 00:19:02] [burton] [0.008634]
List-Post*cluster+redhat.com> (1frq, 0s, 84i)
17124: [11/14/2007 00:19:02] [burton] [0.008634]
List-Subscribe*<https+//www.redhat.com/mailman/listinfo/linux (1frq,
0s,
84i)
17124: [11/14/2007 00:19:02] [burton] [0.008634] cluster+redhat (1frq,
0s, 84i)
17124: [11/14/2007 00:19:02] [burton] [0.008634]
Subject*[Linux+cluster]
(1frq, 0s, 84i)
17124: [11/14/2007 00:19:02] [burton] [0.008634] list+Linux (1frq, 0s,
84i)
17124: [11/14/2007 00:19:02] [burton] [0.008634] Sender*linux+cluster
(1frq, 0s, 84i)
17124: [11/14/2007 00:19:02] [burton] [0.008634]
List-Subscribe*//www.redhat.com/mailman/listinfo/linux+cluster> (1frq,
0s, 84i)
17124: [11/14/2007 00:19:02] [burton] [0.008634] redhat+com (1frq, 0s,
84i)
17124: [11/14/2007 00:19:02] [burton] [0.008634]
Return-Path*cluster+bounces (1frq, 0s, 84i)
17124: [11/14/2007 00:19:02] Burton-Bayesian Probability: 0.000000
Samples: 27
17124: [11/14/2007 00:19:02] no factors specified; using default
17124: [11/14/2007 00:19:02] Result Confidence: 0.99
17124: [11/14/2007 00:19:02] [burton] [0.001190] is+> (1frq, 0s, 614i)
17124: [11/14/2007 00:19:02] [burton] [0.002290] >+I (2frq, 8s, 2550i)
17124: [11/14/2007 00:19:02] [burton] [0.002290] >+I (2frq, 8s, 2550i)
17124: [11/14/2007 00:19:02] [burton] [0.002382] >+The (2frq, 3s, 919i)
17124: [11/14/2007 00:19:02] [burton] [0.002382] >+The (2frq, 3s, 919i)
17124: [11/14/2007 00:19:02] [burton] [0.002888] https+// (1frq, 11s,
2778i)
17124: [11/14/2007 00:19:02] [burton] [0.003946]
X-Mailman-Version*2.1.5
(1frq, 29s, 5355i)
17124: [11/14/2007 00:19:02] [burton] [0.004760] >+> (60frq, 38s,
5812i)
17124: [11/14/2007 00:19:02] [burton] [0.004760] >+> (60frq, 38s,
5812i)
17124: [11/14/2007 00:19:02] [burton] [0.005031] wrote+> (2frq, 39s,
5643i)
17124: [11/14/2007 00:19:02] [burton] [0.005031] wrote+> (2frq, 39s,
5643i)
17124: [11/14/2007 00:19:02] [burton] [0.006364] https (1frq, 26s,
2970i)
17124: [11/14/2007 00:19:02] [burton] [0.006518] List-Post*<mailto
(1frq, 62s, 6913i)
17124: [11/14/2007 00:19:02] [burton] [0.006790] List-Help*request
(1frq, 55s, 5886i)
17124: [11/14/2007 00:19:02] [burton] [0.008260] Errors-To*bounces
(1frq, 67s, 5885i)
17124: [11/14/2007 00:19:02] [burton] [0.008264] Sender*bounces (1frq,
67s, 5882i)
17124: [11/14/2007 00:19:02] [burton] [0.008533] Url*redhat (1frq, 0s,
85i)
17124: [11/14/2007 00:19:02] [burton] [0.008634]
List-Help*cluster+request (1frq, 0s, 84i)
17124: [11/14/2007 00:19:02] [burton] [0.008634]
List-Post*cluster+redhat.com> (1frq, 0s, 84i)
17124: [11/14/2007 00:19:02] [burton] [0.008634]
List-Subscribe*<https+//www.redhat.com/mailman/listinfo/linux (1frq,
0s,
84i)
17124: [11/14/2007 00:19:02] [burton] [0.008634] cluster+redhat (1frq,
0s, 84i)
17124: [11/14/2007 00:19:02] [burton] [0.008634]
Subject*[Linux+cluster]
(1frq, 0s, 84i)
17124: [11/14/2007 00:19:02] [burton] [0.008634] list+Linux (1frq, 0s,
84i)
17124: [11/14/2007 00:19:02] [burton] [0.008634] Sender*linux+cluster
(1frq, 0s, 84i)
17124: [11/14/2007 00:19:02] [burton] [0.008634]
List-Subscribe*//www.redhat.com/mailman/listinfo/linux+cluster> (1frq,
0s, 84i)
17124: [11/14/2007 00:19:02] [burton] [0.008634] redhat+com (1frq, 0s,
84i)
17124: [11/14/2007 00:19:02] [burton] [0.008634]
Return-Path*cluster+bounces (1frq, 0s, 84i)
17124: [11/14/2007 00:19:02] Burton-Bayesian Probability: 0.000000
Samples: 27
17124: [11/14/2007 00:19:02] Result Confidence: 0.99
17124: [11/14/2007 00:19:02] BNR Decision Concurs
17124: [11/14/2007 00:19:02] total processing time: 0.08533s
17124: [11/14/2007 00:19:02] saving signature as
473a8546171241968551123
17124: [11/14/2007 00:19:02] libdspam returned probability of 0.000000
17124: [11/14/2007 00:19:02] message result: NOT SPAM
--------------------------------------------------------------
I tested with your message and could not reproduce that error. Could you
post your dspam.conf and other relevant information?
I have attached my dspam.conf, as well as another test message that
seems independent of the database contents. In particular, clearing the
user 'jacob' from the database, and running dspam_train on the attached
tarball crashes immediately. I am running 'dspam_train jacob t_spam
t_nonspam'.
I have configured with:
./configure --prefix=/usr --host=i686-pc-linux-gnu
--mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share
--sysconfdir=/etc --localstatedir=/var/lib
--with-storage-driver=hash_drv,mysql_drv,pgsql_drv
--with-dspam-home=/var/spool/dspam --sysconfdir=/etc/mail/dspam
--enable-daemon --enable-ldap --enable-clamav --disable-large-scale
--enable-domain-scale --disable-syslog --enable-debug
--enable-verbose-debug --enable-bnr-debug --enable-long-usernames
--with-dspam-group=dspam --with-dspam-home-group=dspam
--with-dspam-mode=2511 --with-logdir=/var/log/dspam
--disable-virtual-users --enable-preferences-extension --disable-homedir
--with-mysql-includes=/usr/include/mysql
--with-mysql-libraries=/usr/lib/mysql
--with-pgsql-includes=/usr/include/postgresql
--with-pgsql-libraries=/usr/lib/postgresql --build=i686-pc-linux-gnu
What other information might be helpful?
The output of:
emerge --info
dspam --version
Could you try to run: revdep-rebuild -X
Did that rebuild some DSPAM or PostgreSQL related stuff?
Thanks again for the assistance. A revdep-rebuild certainly did not
build anything related. For good measure, I rebuild glibc, postgresql,
openldap, and dpsam (-r7) to no avail.
~Jacob
Here's the rest:
# dspam --version
DSPAM Anti-Spam Suite 3.8.0 (agent/library)
Copyright (c) 2002-2006 Jonathan A. Zdziarski
http://dspam.nuclearelephant.com
DSPAM may be copied only under the terms of the GNU General Public License,
a copy of which can be found with the DSPAM distribution kit.
Configuration parameters: '--prefix=/usr' '--host=i686-pc-linux-gnu'
'--mandir=/usr/share/man' '--infodir=/usr/share/info'
'--datadir=/usr/share' '--sysconfdir=/etc' '--localstatedir=/var/lib'
'--with-storage-driver=hash_drv,mysql_drv,pgsql_drv'
'--with-dspam-home=/var/spool/dspam' '--sysconfdir=/etc/mail/dspam'
'--enable-daemon' '--enable-ldap' '--enable-clamav'
'--disable-large-scale' '--enable-domain-scale' '--disable-syslog'
'--enable-debug' '--enable-bnr-debug' '--enable-long-usernames'
'--with-dspam-group=dspam' '--with-dspam-home-group=dspam'
'--with-dspam-mode=2511' '--with-logdir=/var/log/dspam'
'--disable-virtual-users' '--enable-preferences-extension'
'--disable-homedir' '--with-mysql-includes=/usr/include/mysql'
'--with-mysql-libraries=/usr/lib/mysql'
'--with-pgsql-includes=/usr/include/postgresql'
'--with-pgsql-libraries=/usr/lib/postgresql' '--build=i686-pc-linux-gnu'
'build_alias=i686-pc-linux-gnu' 'host_alias=i686-pc-linux-gnu'
'CFLAGS=-march=athlon-xp -O1 -g -pipe -Wl,-z,now'
'CXXFLAGS=-march=athlon-xp -O1 -g -pipe -Wl,-z,now'
# emerge --info
Portage 2.1.3.19 (default-linux/x86/2006.1/server, gcc-4.1.2,
glibc-2.6.1-r0, 2.6.23.1 i686)
=================================================================
System uname: 2.6.23.1 i686 AMD Sempron(tm) Processor 3100+
Timestamp of tree: Wed, 21 Nov 2007 17:00:03 +0000
app-shells/bash: 3.2_p17
dev-lang/python: 2.1.3-r1, 2.3.5-r3, 2.4.4-r4, 2.5.1-r3
dev-python/pycrypto: 2.0.1-r6
sys-apps/baselayout: 1.12.9-r2
sys-apps/sandbox: 1.2.18.1-r2
sys-devel/autoconf: 2.13, 2.61-r1
sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils: 2.18-r1
sys-devel/gcc-config: 1.3.16
sys-devel/libtool: 1.5.24
virtual/os-headers: 2.6.22-r2
ACCEPT_KEYWORDS="x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=athlon-xp -O1 -g -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.3/env /usr/kde/3.3/share/config
/usr/kde/3.3/shutdown /usr/share/X11/xkb /usr/share/config /var/bind"
CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf
/etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/
/etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-march=athlon-xp -O1 -g -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks metadata-transfer nostrip sandbox sfperms strict
unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org
http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LINGUAS="en"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times
--compress --force --whole-file --delete --delete-after --stats
--timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages
--filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="apache2 bash-completion berkdb bitmap-fonts cli cracklib crypt cups
dba dri emacs fortran gd gdbm gpm hardened iconv ipv6 isdnlog jpeg
jpeg2k ldap mailwrapper midi mudflap mysql ncurses nls nptl nptlonly
openmp pam pcre perl png ppds pppd python readline reflection session
snmp spl ssl tcpd truetype truetype-fonts type1-fonts unicode vhosts x86
xml xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x
ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801
hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx
via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare
dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter
mulaw multi null plug rate route share shm softvol" ELIBC="glibc"
INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad
cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text"
LINGUAS="en" USERLAND="GNU" VIDEO_CARDS="apm ark chips cirrus cyrix
dummy fbdev glint i128 i740 i810 imstt mach64 mga neomagic nsc nv r128
radeon rendition s3 s3virge savage siliconmotion sis sisusb tdfx tga
trident tseng v4l vesa vga via vmware voodoo"
Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG,
LC_ALL, LDFLAGS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS,
PORTAGE_RSYNC_EXTRA_OPTS