Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Cannot start spamd - segfaults
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
nitro322
Guru
Guru


Joined: 24 Jul 2002
Posts: 596
Location: USA

PostPosted: Fri Aug 10, 2018 2:41 pm    Post subject: Cannot start spamd - segfaults Reply with quote

Hello. I have a cron job that runs at 06:00 each morning to update spamassasin's rules and restart spamd. Very basic:

However, spamd did not successfully restart this morning. When I try to manually start it, I get a segfault. So far I've tried:

1. Re-running sa-update - same segfault
2. Deleting /var/lib/spamassassin/3.004001 - won't run without an initial update
3. Running sa-update after the delete - same segfault
4. Re-emerging spamassassin - same segfault
4. Updating from 3.4.1-r20 ~3.4.1-r21 - same segfault

I did update a few packages yesterday (since the previous spamd restart), but none appear to be related to spamassassin:
apache-tools, apache, acpid, keyutils, iotop, imagemagick, clamav, udev, lvm2, mysql-connector, mariadb, eselect-php, php, pecl-apcu

Logs don't show anything helpful. Manually running spamd and tacking on -D does show some output, but nothing that really points me to the cause. I'm including that below.

Any ideas what could be causing this, or how to troubleshoot further? I was thinking this may be related to a corrupt update or something from sa-update, but I can't figure out how to install an older update or revert yesterday's changes, nor do I have a backup of that directory.

Spam's already getting out of control in my inbox, so I'd definitely appreciate any pointers. :-) Thanks.

Edit: I don't seem to be able to include the full output from spamd -D, so I've placed a copy for review here.
_________________
https://www.legroom.net/
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10732
Location: Somewhere over Atlanta, Georgia

PostPosted: Fri Aug 10, 2018 3:09 pm    Post subject: Reply with quote

I don't see anything particularly interesting in that log either. You might want to try running strace on your spamd invocation command line to see what it's doing when it segfaults. Something like
Code:
strace -o strace-log.txt {insert_your_spamd_command_line_here}
This may point you to a particular library, at which point you could try rebuilding the package that provides the library.

- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
Back to top
View user's profile Send private message
nitro322
Guru
Guru


Joined: 24 Jul 2002
Posts: 596
Location: USA

PostPosted: Fri Aug 10, 2018 3:31 pm    Post subject: Reply with quote

Thanks for the response. Tried strace, but that doesn't seem to provide any clues, either. Here's the tail end of the output, starting from the last line output in the spamd.log file I shared earlier for context:

Code:
write(4, "<23>Aug 10 10:29:07 spamd[20687]: plugin: Mail::SpamAssassin::Plugin::Bayes=HASH(0x556f939a9140) implements 'learner_close', priority 0\n\0", 137) = 137
rt_sigprocmask(SIG_BLOCK, [PIPE], [], 8) = 0
rt_sigaction(SIGPIPE, {sa_handler=SIG_IGN, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7fefd3e890e0}, {sa_handler=0x7fefd42d1fc0, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7fefd3e890e0}, 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
rt_sigprocmask(SIG_BLOCK, [PIPE], [], 8) = 0
rt_sigaction(SIGPIPE, {sa_handler=SIG_IGN, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7fefd3e890e0}, {sa_handler=SIG_IGN, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7fefd3e890e0}, 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
sendto(9, "\1\0\0\0\1", 5, 0, NULL, 0)  = 5
shutdown(9, SHUT_RDWR)                  = 0
close(9)                                = 0
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x6f945fb348} ---
+++ killed by SIGSEGV +++


Don't see anything helpful there, but this is getting pretty deep for me. Anything set off any red flags for you?
_________________
https://www.legroom.net/
Back to top
View user's profile Send private message
freke
Veteran
Veteran


Joined: 23 Jan 2003
Posts: 1051
Location: Somewhere in Denmark

PostPosted: Fri Aug 10, 2018 3:45 pm    Post subject: Reply with quote

I recently had to restart my mail-server which uses amavisd-new which again uses spamassassin.

I couldn't get spamassassin to start, turned out to be both Bayes and AWL/TxREP that caused trouble and I ended up disabling those in the *.pre-files (I notice that your last line is Bayes) - neither my current working SQL-configuration nor when disabling it worked out.
If it's becuase of an MariaDB-update or what's causing it I don't know (though I couldn't really get Bayes to work in nonSQL-config either)
AWL/TxREP I could just disable SQL-configuration and get to work with plain BerkDB
Back to top
View user's profile Send private message
nitro322
Guru
Guru


Joined: 24 Jul 2002
Posts: 596
Location: USA

PostPosted: Fri Aug 10, 2018 4:43 pm    Post subject: Reply with quote

Huh. Thanks for the suggestion, freke. Disabling this line does get it starting up again:
#loadplugin Mail::SpamAssassin::Plugin::Bayes

Not ideal, obviously, but at least gets the basics covered. I did re-emerge mariadb yesterday, but it was just updating some use flags (as a result of emerge -DNa @world). Can't think what would've changed there, but I'll dig in and report back.

Of course, I've also been thinking about revamping my spam controls and tentatively moving to rspam instead of spamassassin. Might be a good excuse to seriously look into that.

Anyway, thank you both. Much appreciated.
_________________
https://www.legroom.net/
Back to top
View user's profile Send private message
freke
Veteran
Veteran


Joined: 23 Jan 2003
Posts: 1051
Location: Somewhere in Denmark

PostPosted: Fri Aug 10, 2018 5:12 pm    Post subject: Reply with quote

Well thanks, too - didn't know about rspamd - think I'll have a look into that :)
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 23088

PostPosted: Sat Aug 11, 2018 12:52 am    Post subject: Reply with quote

What does the backtrace implicate? That may let you narrow down how the plugin breaks it, and potentially offer a way to use part of the plugin. Having the backtrace could also be useful in getting upstream to fix the crash.
Back to top
View user's profile Send private message
shiznix
Guru
Guru


Joined: 29 Jun 2003
Posts: 367
Location: Adelaide, Australia

PostPosted: Fri Nov 02, 2018 9:32 pm    Post subject: Reply with quote

Don't forget to also check your perl installation is clean and all your installed perl modules are sitting on the same version.
Code:
ls /usr/lib/perl5/vendor_perl

Spamd is simply a Perl script and is susceptible to segfaulting if perl module version mismatches occur, so to fix:
Code:
perl-cleaner --reallyall
Back to top
View user's profile Send private message
siulian
n00b
n00b


Joined: 23 Jan 2014
Posts: 3
Location: Bucharest/Romania

PostPosted: Thu Aug 08, 2019 11:45 am    Post subject: Reply with quote

I know the topic is old but i think this might help others who are having the same issues.

Most probably this happened after you update the mysql/mariadb.
You need to recompile dev-perl/DBD-mysql
_________________
Tux lover ;)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum