could not read from amavisd socket /var/amavis/amavisd.sock: No error: 0

Fabian Wenk fabian at wenks.ch
Wed Dec 27 17:26:49 CET 2023


Hello Damian

On 26.12.2023 20:34, Damian wrote:
>> Dec 26 17:03:28 batman spamd[86118]: spamd: handled cleanup of child pid [5276] due to SIGCHLD: DIED, signal 4 (0004)
> 
> spamd has been killed with signal 4 (illegal instruction). Do you have built perl for the wrong architecture? Mail::DKIM for
> example is used by both Amavis and SpamAssassin, and depends on Digest::SHA which has an XS component. What happens when you feed
> a problematic email into "spamassassin -D" on the terminal?

All my FreeBSD systems are built with amd64 / x86_64. I do the building 
of the packages on one system and install them on the others. So far 
this was not a problem.

As I see, it affects only emails with 2 or more DKIM-Signature: header 
lines. They are also missing the SpamAssassin X-Spam-*: header lines, so 
at least we seem to get closer to the culprit for that. I wonder which 
of the involved Perl Moduls cause that crash.

I have now forced a rebuild of the following packages (as some of them 
have not been rebuilt with the upgrade of perl):

p5-Mail-DKIM-1.20230911
p5-Digest-1.20
p5-Digest-BubbleBabble-0.02_1
p5-Digest-HMAC-1.04
p5-Digest-SHA1-2.13_2
p5-Digest-SHA3-1.05
p5-Mail-Tools-2.21

And restarted amavisd-new and sa-spamd


But still spamassassin crashes (removed a lot of previous debug output):

spamd at batman:~ $ spamassassin -D < /tmp/mail
[...]
Dec 27 16:31:07.757 [67398] dbg: dns: dns reply 36472 is OK, 1 answer 
records
Dec 27 16:31:07.761 [67398] dbg: spf: query for 
2001:8a8:1005:1:0:0:0:4/flashback.wenks.ch: result: pass, comment: , 
text: Mechanism 'a' matched
Dec 27 16:31:07.979 [67398] dbg: dkim: using Mail::DKIM version 1.20230911
Dec 27 16:31:07.995 [67398] dbg: dkim: providing our own resolver: 
Mail::SpamAssassin::DnsResolver
Dec 27 16:31:08.003 [67398] dbg: dkim: performing public DKIM key lookup 
and signature verification
Dec 27 16:31:08.006 [67398] dbg: dns: bgsend, DNS servers: [::1]:53, 
[172.16.1.3]:53, [127.0.0.1]:53
Dec 27 16:31:08.007 [67398] dbg: dns: attempt 1/3, trying connect/sendto 
to [::1]:53
Dec 27 16:31:08.008 [67398] dbg: dns: providing a callback for id: 
45179/IN/TXT/20180905._domainkey.example.com
Dec 27 16:31:08.009 [67398] dbg: dns: bgread: received 477 bytes from ::1
Dec 27 16:31:08.010 [67398] dbg: dns: dns reply 45179 is OK, 1 answer 
records
Dec 27 16:31:08.017 [67398] dbg: dns: bgsend, DNS servers: [::1]:53, 
[172.16.1.3]:53, [127.0.0.1]:53
Dec 27 16:31:08.018 [67398] dbg: dns: attempt 1/3, trying connect/sendto 
to [::1]:53
Dec 27 16:31:08.020 [67398] dbg: dns: providing a callback for id: 
10193/IN/TXT/ed25519._domainkey.example.com
Dec 27 16:31:08.020 [67398] dbg: dns: bgread: received 137 bytes from ::1
Dec 27 16:31:08.022 [67398] dbg: dns: dns reply 10193 is OK, 1 answer 
records
Illegal instruction (core dumped)
spamd at batman:~ $ ls -l perl.core
-rw-------  1 spamd  spamd  138153984 Dec 27 16:31 perl.core
spamd at batman:~ $

spamd at batman:~ $ lldb --core ./perl.core /usr/local/bin/perl
(lldb) target create "/usr/local/bin/perl" --core "./perl.core"
Core file '/var/spool/spamd/perl.core' (x86_64) was loaded.
(lldb) bt
* thread #1, name = 'perl', stop reason = signal SIGILL
   * frame #0: 0x00000008093faa3e CryptX.so`___lldb_unnamed_symbol1175 + 
1502
     frame #1: 0x00000008093fdb96 CryptX.so`___lldb_unnamed_symbol1191 + 246
     frame #2: 0x000000080939a9a6 CryptX.so`___lldb_unnamed_symbol378 + 406
     frame #3: 0x000000080051e041 libperl.so.5.36`Perl_pp_entersub + 2721
     frame #4: 0x0000000800512c36 libperl.so.5.36`Perl_runops_standard + 70
     frame #5: 0x0000000800470d6d 
libperl.so.5.36`___lldb_unnamed_symbol3374 + 237
     frame #6: 0x0000000800470c70 libperl.so.5.36`perl_run + 672
     frame #7: 0x0000000000202080 perl`main + 192
     frame #8: 0x0000000000201dc0 perl`_start + 256
(lldb) exit
spamd at batman:~ $


I did now rebuild the above packages also including p5-CryptX-0.080 
(FreeBSD portupgrade does rebuild them in proper dependency order). But 
still spamassassin -D crashed, this time with dns after some uridnsbl 
checks instead of dkim. Still the same output from the debugger.

As it looks more of a issue with dns, I did rebuild again all above 
packages and also included p5-Net-DNS-1.42,1. It did not help, still the 
same crash.

Any idea where else to dig into?


Best regards,
Fabian


More information about the amavis-users mailing list