From: Kevin G. <ke...@go...> - 2002-11-11 17:50:45
|
I tracked it down into Sys::Syslog, the xlate() sub has a truth/defined problem, returning eval { &$name } || -1; where EMERG returns 0, which is correct but false. I verified on comp.lang.perl* (Google) that this is a problem with perl 5.6.1 (fixed in 5.8.0): http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&threadm=rt-18190-40904.16.0654694398814%40bugs6.perl.org&rnum=7&prev=/groups%3Fq%3DSys::Syslog%2BEMERG%26hl%3Den%26lr%3D%26ie%3DUTF-8%26selm%3Drt-18190-40904.16.0654694398814%2540bugs6.perl.org%26rnum%3D7 here is their fix to Sys/Syslog.pm: # Can't have just eval { &$name } || -1 #because some LOG_XXX may be zero. my $value = eval { &$name }; defined $value ? $value : -1; So we (log4perl) are ok, and our tests will pass as long as we don't log to FATAL. Our unit tests probably shouldn't log to FATAL anyway, since that translates to EMERG and might have other consequences, like bothering the boxes' sysadmin. Interestingly enough, there doesn't seem to be a patch to fix Sys::Syslog short of upgrading to perl 5.8.0. msc...@ao... wrote: > In a message dated 11/8/2002 12:26:32 PM Eastern Standard Time, ke...@go... writes: > > >>Interesting, I get mostly failures and some success >> FreeBSD 4.4 ok >> RedHat 7.0 fail >> RedHat 7.1 fail >> RedHat 7.2 fail > > > Weird. Just tried it on my RH7.1 Linux box at home and got the correct result again: > > 1..5 > ok 1 > ok 2 > ok 3 > ok 4 > ok 5 > $ > Message from syslogd@michael at Fri Nov 8 21:37:29 2002 ... > michael ./syslog.pl: FATAL - foo > > > What's also weird is that the error message you're seeing points to line 78 in Log::Dispatch::Syslog, which reads > > Sys::Syslog::closelog; > > and shouldn't print any errors. Have you found out anything else? > -- Happy Trails . . . Kevin M. Goess (and Anne and Frank) 904 Carmel Ave. Albany, CA 94706 (510) 525-5217 |