https://bz.apache.org/SpamAssassin/show_bug.cgi?id=8431

            Bug ID: 8431
           Summary: sa-learn: timeout every 10 seconds due to change of
                    /etc/resolv.conf (temporary VPN when sa-learn was
                    started)
           Product: Spamassassin
           Version: 4.0.3
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Learner
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: Undefined

This morning, I got failures from sa-learn:

bayes: cannot open bayes databases /home/vinc17/.spamassassin/bayes_* R/W: lock
failed: File exists

and I could see that there was already a running sa-learn process since
yesterday, which increments the .spamassassin/bayes.lock file every 10 seconds:

vinc17    787191  787172  0 Sep30 ?        00:01:31 /usr/bin/perl -T -w
/usr/bin/sa-learn --ham /home/vinc17/Mail/arc/cur

It was started by cron yesterday at 05:08:01.

A "strace -o str.out -tt -p 787191" shows:

[...]
09:21:03.189483 bind(5, {sa_family=AF_INET, sin_port=htons(0),
sin_addr=inet_addr("0.0.0.0")}, 16) = 0
09:21:03.189565 sendto(5,
"W\355\1\0\0\1\0\0\0\0\0\1\4bugs\6debian\3org\0\0\5\0"..., 44, 0,
{sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("193.51.196.179")},
16) = 44
09:21:03.189825 pselect6(8, [5], NULL, NULL, {tv_sec=10, tv_nsec=0}, NULL) = 0
(Timeout)
09:21:13.200451 close(5)                = 0
09:21:13.200916 utimensat(AT_FDCWD, "/home/vinc17/.spamassassin/bayes.lock",
[{tv_sec=1790839273, tv_nsec=0} /* 2026-10-01T09:21:13+0200 */,
{tv_sec=1790839273, tv_nsec=0} /* 2026-10-01T09:21:13+0200 */], 0) = 0
[...]
09:21:13.211082 bind(5, {sa_family=AF_INET, sin_port=htons(0),
sin_addr=inet_addr("0.0.0.0")}, 16) = 0
09:21:13.211121 sendto(5,
"D\225\1\0\0\1\0\0\0\0\0\1\6nongnu\3org\0\0\5\0\1\0\0)\20"..., 39, 0,
{sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("193.51.196.179")},
16) = 39
[...]
09:21:13.211676 bind(6, {sa_family=AF_INET, sin_port=htons(0),
sin_addr=inet_addr("0.0.0.0")}, 16) = 0
09:21:13.211707 sendto(6,
"Ee\1\0\0\1\0\0\0\0\0\1\5lists\6nongnu\3org\0\0\5"..., 45, 0,
{sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("193.51.196.179")},
16) = 45
[...]
09:21:13.212253 bind(8, {sa_family=AF_INET, sin_port=htons(0),
sin_addr=inet_addr("0.0.0.0")}, 16) = 0
09:21:13.212302 sendto(8,
"\277?\1\0\0\1\0\0\0\0\0\1\003163\3com\0\0\5\0\1\0\0)\20\0\0\0"..., 36, 0,
{sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("193.51.196.179")},
16) = 36
09:21:13.212402 pselect6(16, [5 6 8], NULL, NULL, {tv_sec=10, tv_nsec=0}, NULL)
= 0 (Timeout)
09:21:23.223172 close(8)                = 0
09:21:23.223619 close(6)                = 0
09:21:23.223937 close(5)                = 0
09:21:23.224501 utimensat(AT_FDCWD, "/home/vinc17/.spamassassin/bayes.lock",
[{tv_sec=1790839283, tv_nsec=0} /* 2026-10-01T09:21:23+0200 */,
{tv_sec=1790839283, tv_nsec=0} /* 2026-10-01T09:21:23+0200 */], 0) = 0
[...]

193.51.196.179 is ns-vip-dc1.inria.fr. According to some past information,
193.51.196.179 is a DNS server at Inria, while my machine is not on the Inria
network. However, I had temporarily the Inria VPN active at about the time
sa-learn was started by cron; in such a case, this DNS server is put in the
/etc/resolv.conf file. But /etc/resolv.conf was restored when I closed the VPN.
I can see:

-rw-r--r-- 1 root root 87 2026-09-30 05:09:55 /etc/resolv.conf

So I closed the VPN less than 2 minutes after sa-learn was started, and the old
/etc/resolv.conf information should no longer be used!

In addition to that, in case of many timeouts, I suppose that sa-learn should
terminate with an error instead of looping on all the messages.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to