Spamassassin problem since upgrading Perl

xy16644

Aspiring Daemon

Reaction score: 13
Messages: 907

I have just finished upgrading my Perl from 5.16.3 to 5.18.1. After upgrading I ran portmaster -r perl. All was looking good until I had a look in my /var/log/maillog. I am getting the following errors:

Code:
Nov 17 16:50:12 alpha spamd[49019]: Use of each() on hash after insertion without resetting hash iterator results in undefined behavior at /usr/local/lib/perl5/site_perl/5.18/Mail/SpamAssassin/AsyncLoop.pm line 363.
Nov 17 16:50:12 alpha spamd[49019]: Use of each() on hash after insertion without resetting hash iterator results in undefined behavior at /usr/local/lib/perl5/site_perl/5.18/Mail/SpamAssassin/AsyncLoop.pm line 363.
Nov 17 16:50:12 alpha spamd[49019]: Use of each() on hash after insertion without resetting hash iterator results in undefined behavior at /usr/local/lib/perl5/site_perl/5.18/Mail/SpamAssassin/AsyncLoop.pm line 363.
Nov 17 16:50:12 alpha spamd[49019]: plugin: eval failed: bayes: (in learn) locker: safe_lock: cannot create tmp lockfile /var/spool/spamd/.spamassassin/bayes.lock.alpha.bsdpanic.com.49019 for /var/spool/spamd/.spamassassin/bayes.lock: No such file or directory
I had a look online and found this: 3.3.2 and Perl 5.18.0: Altering hash requires restarting loop else UNDEFINED... and Revision 1487178

I've had a read through them but am still unsure how to proceed. How do I apply Spamassassin patches? Why am I getting an error saying spamd can't create a temporary lockfile? Has anyone else experienced this and fixed it?

Thanks!
 

cpm@

Moderator
Staff member
Moderator
Developer

Reaction score: 944
Messages: 2,140

Do the following:

First, download the patch and rename it without the filename extension as patch-bug6937, then place it at the /usr/ports/mail/p5-Mail-SpamAssassin/files directory.

Finally, just run portmaster mail/p5-Mail-SpamAssassin
 
OP
OP
X

xy16644

Aspiring Daemon

Reaction score: 13
Messages: 907

Thanks for the reply!

In the end (before reading your post) I checked out the latest trunk version of Spamassassin, overwrote /usr/local/lib/perl5/site_perl/5.18/Mail/SpamAssassin/AsyncLoop.pm with the new file and restarted Spamassassin.

All looks good so far with no more of the errors I reported in the first post.
 
OP
OP
X

xy16644

Aspiring Daemon

Reaction score: 13
Messages: 907

Re:

cpm said:
Do the following:

First, download the patch and rename it without the filename extension as patch-bug6937, then place it at the /usr/ports/mail/p5-Mail-SpamAssassin/files directory.

Finally, just run portmaster mail/p5-Mail-SpamAssassin
I'm having this issue again but this time on my newly built server. I have Perl 5.18.2 installed and SpamAssasin 3.3.2_8. I downloaded patch-bug6937 and copied into /usr/ports/mail/p5-Mail-SpamAssassin/files. But when I run portmaster mail/p5-Mail-SpamAssassin it says:

Code:
File to patch:
and when I enter:

Code:
/usr/ports/mail/p5-Mail-SpamAssassin/files/patch-bug6937
it says:
Code:
File to patch: /usr/ports/mail/p5-Mail-SpamAssassin/files/patch-bug6937
2 out of 2 hunks failed--saving rejects to /usr/ports/mail/p5-Mail-SpamAssassin/files/patch-bug6937.rej
What am I doing wrong?
 
OP
OP
X

xy16644

Aspiring Daemon

Reaction score: 13
Messages: 907

I did follow the instructions in the second post. Hence my post, they didn't work. It wouldn't install the patch.
 

cpm@

Moderator
Staff member
Moderator
Developer

Reaction score: 944
Messages: 2,140

I tested the above patch and it's applied cleanly.
Code:
# cd /usr/ports/mail/p5-Mail-SpamAssassin && make patch
===>  License APACHE20 accepted by the user
===>  Found saved configuration for p5-Mail-SpamAssassin-3.3.2_8
===> Fetching all distfiles required by p5-Mail-SpamAssassin-3.3.2_8 for building
===>  Extracting for p5-Mail-SpamAssassin-3.3.2_8
=> SHA256 Checksum OK for Mail-SpamAssassin-3.3.2.tar.gz.
===>  Patching for p5-Mail-SpamAssassin-3.3.2_8
===>  Applying FreeBSD patches for p5-Mail-SpamAssassin-3.3.2_8
/usr/bin/sed -i.bak -e '/Razor2/s/^#loadplugin/loadplugin/' /usr/ports/mail/p5-Mail-SpamAssassin/work/Mail-SpamAssassin-3.3.2/rules/v312.pre
/usr/bin/sed -i.bak -e '/SPF/s/^loadplugin/#loadplugin/' /usr/ports/mail/p5-Mail-SpamAssassin/work/Mail-SpamAssassin-3.3.2/rules/init.pre
Anyway, show the error output.
 
OP
OP
X

xy16644

Aspiring Daemon

Reaction score: 13
Messages: 907

I explained the error I was getting in post 4. All the details there as to what I did and the error I got.
 
OP
OP
X

xy16644

Aspiring Daemon

Reaction score: 13
Messages: 907

Heres the error:

Code:
(/usr/ports/mail/p5-Mail-SpamAssassin)$ sudo make patch
===>  Patching for p5-Mail-SpamAssassin-3.3.2_8
===>  Applying FreeBSD patches for p5-Mail-SpamAssassin-3.3.2_8
Ignoring previously applied (or reversed) patch.
4 out of 4 hunks ignored--saving rejects to lib/Mail/SpamAssassin/BayesStore/MySQL.pm.rej
=> Patch patch-bug6624 failed to apply cleanly.
*** [do-patch] Error code 1

Stop in /usr/ports/mail/p5-Mail-SpamAssassin.
*** [patch] Error code 1

Stop in /usr/ports/mail/p5-Mail-SpamAssassin.
I copied patch-bug6937 into the /usr/ports/mail/p5-Mail-SpamAssassin/files directory before running the above.
 

cpm@

Moderator
Staff member
Moderator
Developer

Reaction score: 944
Messages: 2,140

Run # make clean before run # make patch

P.S. You can download it here.
 
OP
OP
X

xy16644

Aspiring Daemon

Reaction score: 13
Messages: 907

Ok, ran make clean, downloaded the latest patch and then ran make patch but it still failed.

I'm still getting the following error:

Code:
(/usr/ports/mail/p5-Mail-SpamAssassin)$ sudo make patch
===>  License APACHE20 accepted by the user
===>  Found saved configuration for p5-Mail-SpamAssassin-3.3.2_8
===> Fetching all distfiles required by p5-Mail-SpamAssassin-3.3.2_8 for building
===>  Extracting for p5-Mail-SpamAssassin-3.3.2_8
=> SHA256 Checksum OK for Mail-SpamAssassin-3.3.2.tar.gz.
===>  Patching for p5-Mail-SpamAssassin-3.3.2_8
===>  Applying FreeBSD patches for p5-Mail-SpamAssassin-3.3.2_8
2 out of 2 hunks failed--saving rejects to lib/Mail/SpamAssassin/AsyncLoop.pm.rej
1 out of 1 hunks failed--saving rejects to lib/Mail/SpamAssassin/Conf/Parser.pm.rej
patch: **** malformed patch at line 65:
=> Patch patch-bug6937 failed to apply cleanly.
=> Patch(es) patch-bug6624 patch-bug6655 patch-bug6698 patch-bug6745 applied cleanly.
*** [do-patch] Error code 1

Stop in /usr/ports/mail/p5-Mail-SpamAssassin.
*** [patch] Error code 1

Stop in /usr/ports/mail/p5-Mail-SpamAssassin.
The other patches seem to install fine but not 6937 for some reason?
 

cpm@

Moderator
Staff member
Moderator
Developer

Reaction score: 944
Messages: 2,140

Oops, I just see the problem, please, remove all the ^M characters of the file.
Code:
% tr -d \\r < patch-bug6937.txt > patch-bug6937
 
Top