After upgrading to dkim-milter 2.5.2, running /etc/init.d/dkim-milter start results in a segfault. Look at /var/log/messages, here's some interesting information: Apr 4 00:37:46 irrational /etc/init.d/dkim-filter[28028]: start-stop-daemon: fopen `/var/run/dkim-filter/dkim-filter.pid': No such file or directory Apr 4 00:37:46 irrational [4022072.402432] dkim-filter[28040]: segfault at 5 rip 3508a7b420 rsp 7fffd58d20c8 error 4 Apr 4 00:37:46 irrational /etc/init.d/dkim-filter[28039]: start-stop-daemon: failed to start `/usr/sbin/dkim-filter' Apr 4 00:37:46 irrational /etc/init.d/dkim-filter[28019]: ERROR: dkim-filter failed to start Reproducible: Always Steps to Reproduce: 1. Install dkim-milter 2.5.2 2. Run /etc/init.d/dkim-milter start Actual Results: Segfault and the daemon doesn't start Expected Results: The daemon starts and happily runs. # emerge --info Portage 2.1.4.4 (default-linux/amd64/2007.0/desktop, gcc-4.2.3, glibc-2.7-r2, 2.6.24-gentoo-r2 x86_64) ================================================================= System uname: 2.6.24-gentoo-r2 x86_64 AMD Athlon(tm) 64 Processor 3300+ Timestamp of tree: Thu, 03 Apr 2008 22:15:01 +0000 distcc 2.18.3 x86_64-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled] ccache version 2.4 [enabled] app-shells/bash: 3.2_p33 dev-java/java-config: 1.3.7, 2.1.5 dev-lang/python: 2.5.1-r5 dev-util/ccache: 2.4-r7 sys-apps/baselayout: 2.0.0 sys-apps/sandbox: 1.2.18.1-r2 sys-devel/autoconf: 2.13, 2.61-r1 sys-devel/automake: 1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.1 sys-devel/binutils: 2.18-r1 sys-devel/gcc-config: 1.4.0-r4 sys-devel/libtool: 1.5.26 virtual/os-headers: 2.6.24 ACCEPT_KEYWORDS="amd64 ~amd64" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-O2 -march=athlon64 -pipe -fomit-frame-pointer" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config" CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/splash /etc/terminfo /etc/udev/rules.d" CXXFLAGS="-O2 -march=athlon64 -pipe -fomit-frame-pointer" DISTDIR="/usr/portage/distfiles" FEATURES="ccache distlocks metadata-transfer parallel-fetch prelink sandbox sfperms strict unmerge-orphans userfetch usersandbox" GENTOO_MIRRORS="http://gentoo.chem.wisc.edu/gentoo" LDFLAGS="-Wl,--hash-style=both,-z,relro,--enable-new-dtags,-O1,-z,now,--as-needed" LINGUAS="en" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/portage/local/layman/sunrise /usr/portage/local/layman/webapps-experimental /usr/portage/local/layman/openrc /usr/local/portage" SYNC="rsync://rsync21.us.gentoo.org/gentoo-portage" USE="3dnow X a52 aac acl acpi aiglx alsa amd64 animation apache2 artworkextra asf aspnet2 asyncns authdaemond avahi avi bash-completion berkdb bitmap-fonts bluetooth bzip2 cairo caps cdda cdparanoia cdr chm cli cracklib crypt cups curl daap dbus dga divx4linux dlloader dpms dri dts dv dvb dvd dvdr dvdread emboss encode exif fam fame fat fbcondecor fbsplash ffmpeg fftw firefox flac foomaticdb fortran freetype gaim gd gdbm geoip gif gimpprint glib glibc-omitfp glitz glut gnome gnutls gphoto2 gpm gstreamer gstreamer10 gtk gtk2 hal hardenedphp hbci howl howl-compat iconv ieee1394 imagemagick imap imlib innodb ipv6 isdnlog java java5 joystick jpeg jpeg2k junit kde kdehiddenvisibility lcms libfame libnotify libsamplerate libusb lirc live lm_sensors lzo mad maildir mdnsresponder-compat midi mikmod mjpeg mmap mmx mmxext mng mono motif mozilla mozsvg mp3 mpeg mpeg2 mplayer mudflap musepack mysql mythtv nautilus ncurses network nls nptl nptlonly ntfs nvidia offensive ofx ogg oggvorbis openexr opengl openmp pam pango pcre pdf pdflib perl pic pie png pnp ppd ppds pppd prelude pulseaudio python qt qt3 qt3support qt4 quicktime rar readline reflection rtc samba sasl screensaver sdl session sharedmem shout snmp sox speex spell spl sqlite sse sse2 ssl suspend2 svg tcpd theora threads tiff transcode truetype truetype-fonts type-fonts unicode unzip upnp ups usb v4l v4l2 vcd videos vorbis webdav webservices wifi wmf wv x264 xanim xcb xine xinerama xml xml2 xorg xpm xprint xrandr xscreensaver xv xvid xvmc zeroconf zip zlib" ALSA_CARDS="via82xx" 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" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias auth_digest proxy proxy_ajp proxy_connect proxy_http" ELIBC="glibc" INPUT_DEVICES="evdev joystick keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en" LIRC_DEVICES="mceusb2" USERLAND="GNU" VIDEO_CARDS="nv nvidia" Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
any chance of getting a backtrace http://www.gentoo.org/proj/en/qa/backtraces.xml and your config file.
Created attachment 148815 [details] dkim-filter.conf
It's going to take me a bit to get the backtrace - hopefully I'll be able to do it tomorrow.
thanks candrews. can you also include '/usr/sbin/dkim-filter -V' for completeness. btw this is close to when I'm away for two weeks so I'm sorry if a response doesn't come quickly.
# /usr/sbin/dkim-filter -V dkim-filter: Sendmail DKIM Filter v2.5.2 Compiled with OpenSSL 0.9.8g 19 Oct 2007 Supported signing algorithms: rsa-sha1 rsa-sha256 Supported canonicalization algorithms: relaxed simple Active code options: QUERY_CACHE _FFR_STATS
I don't get it at all. I recompiled with splitdebug in features and -ggdb in cflags, and when I ran "/etc/init.d/dkim-milter start" it segfaulted. I then ran "/usr/sbin/dkim-filter -x /etc/mail/dkim-filter/dkim-filter.conf -P /var/run/dkim-filter/dkim-filter.pid" (which I got from reading "/etc/init.d/dkim-milter"), the milter started and ran perfectly. Confused, I killed the process, and then tried to start dkim-milter via its init script, and it worked this time. I'm completely confused as to what happened - I can no longer reproduce the segfault after running dkim-milter manually once.
(In reply to comment #6) > I'm completely confused as to what happened - I can no > longer reproduce the segfault after running dkim-milter manually once. Thanks for getting back with this info. I can't fault what you tried to do and I'm 1/2 glad its working now and 1/2 confused why it did occur. Only things I can think of are stray process or sockets interfering somehow. Anyhow I'm going to close this for now and if it happens again I'm keen to know what you find.
In dkim-filter.conf AutoRestart Yes If AutoRestart=Yes, the filter segfaults on startup. If it is no, the filter works fine. AutoRestart works if I compile with the "-ggdb" cflag - so I have no idea how to get a stack trace. But this is definitely what breaks it. In summary: if(AutoRestart && !debug){ segfault; } else { runokay; }
Ok I'm trying to replicate your described fault. Other things to try: 1. remove your LDFLAGS settings As a poor substitute for a backtrace try a ltrace or failing that a strace. This may give some idea as to how far the program got. I'm starting to suspect a compiler/linker bug in the way that the fault seems to be dependant on these conditions.