Skip Menu |

This queue is for tickets about the Sys-Syslog CPAN distribution.

Report information
The Basics
Id: 29875
Status: resolved
Priority: 0/
Queue: Sys-Syslog

People
Owner: SAPER [...] cpan.org
Requestors: jon.armitage [...] hepworthunited.co.uk
SAPER [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 0.22



Subject: Sys::Syslog
Date: Tue, 09 Oct 2007 22:14:49 +0100
To: maddingue [...] free.fr
From: Jonathan Armitage <jon.armitage [...] hepworthunited.co.uk>
Sebastien, Si vous ne comprenez pas, j'essaierai de traduire en francais. We use your module Sys::Syslog as part of our SpamAssassin installation on a Sun V210 running Solaris 10. When we recently upgraded to the latest release of Sys::Syslog, we began to get this message in the logs when SpamAssassin started: [ Oct 9 21:03:49 Executing start method ("/usr/local/bin/spamd -- daemonize --username=exim --syslog-socket=inet") ] [9732] error: Can't locate Sys/Syslog/Win32.pm in @INC (@INC contains: /usr/local/lib/perl5/site_perl/5.8.8/i86pc-solaris /usr/ local/lib/perl5/site_perl/5.8.8 / usr/local/lib/perl5/5.8.8/i86pc-solaris /usr/local/lib/perl5/5.8.8 / usr/local/lib/perl5/site_perl) at (eval 11) line 2. This seems to be related to these lines in Syslog.pm: # use EventLog on Win32 my $is_Win32 = $^O =~ /Win32/i; eval "use Sys::Syslog::Win32"; If you comment out the eval line, the error disappears. I don't speak perl, but should it not say something like: # use EventLog on Win32 my $is_Win32 = $^O; if (my $is_Win32 =~ /Win32/i) { eval "use Sys::Syslog::Win32"; } That said, this snippet does not error on my machine, whether I test for /Win32/ or /solaris/. Yours in puzzlement, Jon Jon Armitage System Administrator 365 Media Group
Subject: Re: [rt.cpan.org #29875] Can't locate Sys/Syslog/Win32.pm on Solaris
Date: Wed, 10 Oct 2007 01:07:29 +0200
To: bug-Sys-Syslog [...] rt.cpan.org, jon.armitage [...] hepworthunited.co.uk
From: Sébastien Aperghis-Tramoni <saper [...] cpan.org>
Hello, I redirected your mail to the ticket tracking system in order to have a public trace of the discussion. jon.armitage@hepworthunited.co.uk via RT wrote: Show quoted text
> Si vous ne comprenez pas, j'essaierai de traduire en francais.
No problem, I understand enough English to maintain modules, discuss on mailing lists and attend conferences :-) But thanks to have thought about that, very appreciated. Show quoted text
> We use your module Sys::Syslog as part of our SpamAssassin > installation on a Sun V210 running Solaris 10. > > When we recently upgraded to the latest release of Sys::Syslog, we > began to get this message in the logs when SpamAssassin started: > > [ Oct 9 21:03:49 Executing start method ("/usr/local/bin/spamd -- > daemonize --username=exim --syslog-socket=inet") ] > [9732] error: Can't locate Sys/Syslog/Win32.pm in @INC (@INC > contains: /usr/local/lib/perl5/site_perl/5.8.8/i86pc-solaris /usr/ > local/lib/perl5/site_perl/5.8.8 / > usr/local/lib/perl5/5.8.8/i86pc-solaris /usr/local/lib/perl5/5.8.8 / > usr/local/lib/perl5/site_perl) at (eval 11) line 2.
Is SpamAssassin actually running after displaying this message or does it exit? Show quoted text
> This seems to be related to these lines in Syslog.pm: > > # use EventLog on Win32 > my $is_Win32 = $^O =~ /Win32/i; > eval "use Sys::Syslog::Win32"; > > If you comment out the eval line, the error disappears. > > I don't speak perl, but should it not say something like: > > # use EventLog on Win32 > my $is_Win32 = $^O; > if (my $is_Win32 =~ /Win32/i) { > eval "use Sys::Syslog::Win32"; > }
It would seem logical, but this code was done this way in order to allow systems with the Win32 modules, others than Windows, to use the eventlog mechanism. For example Cygwin. Show quoted text
> That said, this snippet does not error on my machine, whether I test > for /Win32/ or /solaris/. > > Yours in puzzlement,
Yes. I can understand :-) In my opinion, SpamAssassin is logging a false positive here. The trick being that Sys::Syslog uses an eval() to find if the Win32 API is available, and if it's the case, use the eventlog mechanism as the default. But the $@ variable isn't reset. Looking (again) at the code of SpamAssassin, I see it's full of eval(), and one of them is probably seeing that $@ isn't empty, and therefore concludes that there was an error. The fix may therefore be simple: reset $@ after the eval()s in Sys::Syslog in order to prevent false errors from leaking to SpamAssassin. I just committed a patch to try addressing this problem: » http://svnweb.mongueurs.net/Sys-Syslog/revision/?rev=147 If you can test from the Subversion repository, can you try SpamAssassin with the latest revision of Sys::Syslog? You can check it out with the following command: $ svn co svn://svn.mongueurs.net/Sys-Syslog Don't hesitate to ask if you encounter a problem while installing this version. -- Sébastien Aperghis-Tramoni Close the world, txEn eht nepO.
Subject: Sys::Syslog and Win32
From: dam [...] modsoftsys.com
On Tue Oct 09 19:08:03 2007, SAPER wrote: Show quoted text
> > This seems to be related to these lines in Syslog.pm: > > > > # use EventLog on Win32 > > my $is_Win32 = $^O =~ /Win32/i; > > eval "use Sys::Syslog::Win32"; > > > > I don't speak perl, but should it not say something like: > > > > # use EventLog on Win32 > > my $is_Win32 = $^O; > > if (my $is_Win32 =~ /Win32/i) { > > eval "use Sys::Syslog::Win32"; > > }
> > It would seem logical, but this code was done this way in order to > allow systems with the Win32 modules, others than Windows, to use the > eventlog mechanism. For example Cygwin. > > In my opinion, SpamAssassin is logging a false positive here. The > trick being that Sys::Syslog uses an eval() to find if the Win32 API > is available, and if it's the case, use the eventlog mechanism as the > default. But the $@ variable isn't reset. Looking (again) at the code > of SpamAssassin, I see it's full of eval(), and one of them is > probably seeing that $@ isn't empty, and therefore concludes that > there was an error. > > The fix may therefore be simple: reset $@ after the eval()s in > Sys::Syslog in order to prevent false errors from leaking to > SpamAssassin.
Wouldn't it be better if "local $@" is used? This will protect the calling module's $@, which may well be non-empty for any reason. Just an idea, dam
Subject: Re: [rt.cpan.org #29875] Sys::Syslog and Win32
Date: Wed, 10 Oct 2007 12:00:52 +0200
To: bug-Sys-Syslog [...] rt.cpan.org
From: Sébastien Aperghis-Tramoni <saper [...] cpan.org>
Damyan Ivanov wrote: Show quoted text
> > The fix may therefore be simple: reset $@ after the eval()s in > > Sys::Syslog in order to prevent false errors from leaking to > > SpamAssassin.
> > Wouldn't it be better if "local $@" is used? This will protect the > calling module's $@, which may well be non-empty for any reason.
$@ is as $! : you're not supposed to expect its value to be valid at any moment other than just after the call that may have set the variable. In the case of $@, there's also this waranty made by Perl: If there is a syntax error or runtime error, or a die statement is executed, an undefined value is returned by eval, and $@ is set to the error message. If there was no error, $@ is guaranteed to be a null string. » http://perldoc.perl.org/functions/eval.html A consequence is that if you nest eval()s without checking $@, you'll loose the diagnostic: $ perl -le 'I->can_has_cheezburger; print "diag=$@" ' Can't locate object method "can_has_cheezburger" via package "I" (perhaps you forgot to load "I"?) at -e line 1. $ perl -le ' eval { I->can_has_cheezburger } ; print "diag=$@" ' diag=Can't locate object method "can_has_cheezburger" via package "I" (perhaps you forgot to load "I"?) at -e line 1. $ perl -le ' eval { eval { I->can_has_cheezburger }} ; print "diag=$@" ' diag= To be honest, I wonder how SpamAssassin can see something in $@ because the test suite already wrap each and every call to test that no diagnostic is generated when used under normal conditions. -- Sébastien Aperghis-Tramoni Close the world, txEn eht nepO.
Subject: Re: [rt.cpan.org #29875] Can't locate Sys/Syslog/Win32.pm on Solaris
Date: Wed, 10 Oct 2007 11:42:08 +0100
To: Sébastien Aperghis-Tramoni <saper [...] cpan.org>
From: Jonathan Armitage <jon.armitage [...] hepworthband.co.uk>
Sébastien Aperghis-Tramoni wrote: Show quoted text
> > jon.armitage@hepworthunited.co.uk via RT wrote: >
>> We use your module Sys::Syslog as part of our SpamAssassin >> installation on a Sun V210 running Solaris 10.
Sorry, this is misleading. I'm actually testing on Solaris 10 x86. Show quoted text
>> When we recently upgraded to the latest release of Sys::Syslog, we >> began to get this message in the logs when SpamAssassin started: >> >> [ Oct 9 21:03:49 Executing start method ("/usr/local/bin/spamd -- >> daemonize --username=exim --syslog-socket=inet") ] >> [9732] error: Can't locate Sys/Syslog/Win32.pm in @INC (@INC >> contains: /usr/local/lib/perl5/site_perl/5.8.8/i86pc-solaris /usr/ >> local/lib/perl5/site_perl/5.8.8 / >> usr/local/lib/perl5/5.8.8/i86pc-solaris /usr/local/lib/perl5/5.8.8 / >> usr/local/lib/perl5/site_perl) at (eval 11) line 2.
> > Is SpamAssassin actually running after displaying this message or does > it exit?
Yes, SA is running. It outputs the error twice, but it does start up. Show quoted text
> I just committed a patch to try addressing this problem: > » http://svnweb.mongueurs.net/Sys-Syslog/revision/?rev=147 > > If you can test from the Subversion repository, can you try SpamAssassin > with the latest revision of Sys::Syslog? >
OK, I've finally managed to check out and build Rev 150. It outputs the same error (warning?) as above, except it now says "...eval 11) line 1." Jon
Subject: Re: [rt.cpan.org #29875] Can't locate Sys/Syslog/Win32.pm on Solaris
Date: Wed, 10 Oct 2007 21:26:49 +0100
To: bug-Sys-Syslog [...] rt.cpan.org
From: Jonathan Armitage <jon.armitage [...] hepworthunited.co.uk>
jon.armitage@hepworthband.co.uk via RT wrote: Show quoted text
> When we recently upgraded to the latest release of Sys::Syslog, we > began to get this message in the logs when SpamAssassin started: > > [ Oct 9 21:03:49 Executing start method ("/usr/local/bin/spamd -- > daemonize --username=exim --syslog-socket=inet") ] > [9732] error: Can't locate Sys/Syslog/Win32.pm in @INC (@INC > contains: /usr/local/lib/perl5/site_perl/5.8.8/i86pc-solaris /usr/ > local/lib/perl5/site_perl/5.8.8 / > usr/local/lib/perl5/5.8.8/i86pc-solaris /usr/local/lib/perl5/5.8.8 / > usr/local/lib/perl5/site_perl) at (eval 11) line 2.
I don't know if this helps to pin down where the message is generated, but I omitted (failed to to cut & paste) this line :( [12726] error: BEGIN failed--compilation aborted at (eval 11) line 1. Jon
Subject: Re: [rt.cpan.org #29875] Can't locate Sys/Syslog/Win32.pm on Solaris
Date: Wed, 10 Oct 2007 23:49:54 +0200
To: bug-Sys-Syslog [...] rt.cpan.org
From: Sébastien Aperghis-Tramoni <saper [...] cpan.org>
jon.armitage@hepworthband.co.uk via RT wrote: Show quoted text
>> I just committed a patch to try addressing this problem: >> » http://svnweb.mongueurs.net/Sys-Syslog/revision/?rev=147 >> >> If you can test from the Subversion repository, can you try >> SpamAssassin >> with the latest revision of Sys::Syslog? >>
> OK, I've finally managed to check out and build Rev 150. It outputs > the same > error (warning?) as above, except it now says "...eval 11) line 1."
The madness begins.. Could you try to install Devel::SimpleTrace and make it load in SpamAssassin, for example by launching it manually with "perl - MDevel::SimpleTrace ..." or by setting the PERL5OPT environment variable to -MDevel::SimpleTrace. Also, are you using specific SpamAssassin settings or does this problem appears with the basic ones? Show quoted text
> I don't know if this helps to pin down where the message is generated, > but I omitted (failed to to cut & paste) this line :( > > [12726] error: BEGIN failed--compilation aborted at (eval 11) line 1.
Not really, this is just a standard line printed after the one you pasted. -- Sébastien Aperghis-Tramoni Close the world, txEn eht nepO.
CC: ajos1 [...] onion.demon.co.uk
Subject: Re: SpamAssasin and Sys/Syslog/Win32.pm
Date: Mon, 5 Nov 2007 02:31:53 +0100
To: bug-Sys-Syslog [...] rt.cpan.org
From: Sébastien Aperghis-Tramoni <saper [...] cpan.org>
Hello, You wrote: Show quoted text
> Just letting you know of a bug... not sure if it is you or > SpamAssasin... > > But SpamAssasin restart on Linux seems to want Sys::Syslog::Win32 > stuff? > [...] > Starting spamd: [18243] error: Can't locate Sys/Syslog/Win32.pm in > @INC
I was already made aware of this bug, see CPAN-RT#29875 » http://rt.cpan.org/Ticket/Display.html?id=29875 The problem is that the person opening this ticket didn't answered my following emails, so I couldn't do further remote investigation (and lacked the time to do this myself because I don't have a running SpamAssassin). So could you try to pull the version from SVN? It has minor functional changes, plus an attempt to fix this problem. To check out the source from SVN: $ svn co svn://svn.mongueurs.net/Sys-Syslog I've just committed some code that should fix this problem. -- Sébastien Aperghis-Tramoni Close the world, txEn eht nepO.
Subject: Re: [rt.cpan.org #29875] Can't locate Sys/Syslog/Win32.pm on Solaris
Date: Thu, 8 Nov 2007 02:50:25 +0100
To: bug-Sys-Syslog [...] rt.cpan.org
From: Sébastien Aperghis-Tramoni <saper [...] cpan.org>
This should be fixed with Sys::Syslog 0.22, just uploaded on the CPAN -- Sébastien Aperghis-Tramoni Close the world, txEn eht nepO.