Skip Menu |

This queue is for tickets about the Log-Log4perl CPAN distribution.

Report information
The Basics
Id: 43740
Status: resolved
Priority: 0/
Queue: Log-Log4perl

People
Owner: Nobody in particular
Requestors: martin.koehler [...] desy.de
Cc:
AdminCc:

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



Subject: Bug in Semphore when using non english locale
Date: Sat, 28 Feb 2009 19:26:24 +0100
To: <bug-Log-Log4perl [...] rt.cpan.org>
From: "Koehler, Martin" <martin.koehler [...] desy.de>
Hi, Thanks for the great module. The Module Log4perl::Util::Semaphore assumes english locale. Creating a semaphore fails e.g. for a german locale, whenever the semaphore already exists. The code generating the error is: if(! defined $self->{id} and $! =~ /exists/) { # <- This does not work in geman, since the message # there is "Die Datei existiert bereits" does # not match print "Semaphore '$self->{key}' already exists\n" if INTERNAL_DEBUG; $self->{id} = semget( $self->{ikey}, 1, 0 ) or die "semget($self->{ikey}) failed: $!"; } elsif($!) { die "Cannot create semaphore $self->{key}/$self->{ikey} ($!)"; } } You might try to force the us locale using use POSIX qw(locale_h); setlocale(LC_ALL,"en_US"); which worked for me :-) Regards ------------------------------------------------------------------------ Dr. Martin Köhler Head of library and documentation Deutsches Elektronen-Synchrotron DESY Building 01 Room 310 phone: +49-40-8998-1814 Notkestr. 85 fax: +49-40-8994-1814 22607 Hamburg e-mail: Martin.Koehler@desy.de Germany ------------------------------------------------------------------------
Now fixed in CVS (patch attached), will be released with 1.21. Thanks for reporting this, Martin! -- Mike
diff -a -u -r1.346 Changes --- Changes 12 Feb 2009 08:49:06 -0000 1.346 +++ Changes 7 Mar 2009 02:56:43 -0000 @@ -6,6 +6,9 @@ * (ms) Documentation typos fixed, reported by Breno G. de Oliveira [rt.cpan.org #42428]. * (ms) Fixed DBI appender error message, bug reported by DavidZ. + * (ms) Fixed [rt.cpan.org #43740] reported by Martin Koehler. Now using + proper POSIX return code EEXISTS instead of error message + depending on English locale. 1.20 (2008/12/09) * (ms) Using semctl to reset the value of the semaphore in the diff -a -u -r1.6 Semaphore.pm --- lib/Log/Log4perl/Util/Semaphore.pm 8 Nov 2008 05:23:00 -0000 1.6 +++ lib/Log/Log4perl/Util/Semaphore.pm 7 Mar 2009 02:56:44 -0000 @@ -4,6 +4,7 @@ use IPC::SysV qw(IPC_RMID IPC_CREAT IPC_EXCL SEM_UNDO IPC_NOWAIT IPC_SET IPC_STAT SETVAL); use IPC::Semaphore; +use POSIX qw(EEXIST); use strict; use warnings; use constant INTERNAL_DEBUG => 0; @@ -57,7 +58,7 @@ ); if(! defined $self->{id} and - $! =~ /exists/) { + $! == EEXIST) { print "Semaphore '$self->{key}' already exists\n" if INTERNAL_DEBUG; $self->{id} = semget( $self->{ikey}, 1, 0 ) or die "semget($self->{ikey}) failed: $!";
Subject: RE: [rt.cpan.org #43740] Bug in Semphore when using non english locale
Date: Sat, 7 Mar 2009 21:50:21 +0100
To: <bug-Log-Log4perl [...] rt.cpan.org>
From: "Koehler, Martin" <martin.koehler [...] desy.de>
Thanks for the quick fix. Regards Martin ------------------------------------------------------------------------ Dr. Martin Köhler Head of library and documentation Deutsches Elektronen-Synchrotron DESY Building 01 Room 310 phone: +49-40-8998-1814 Notkestr. 85 fax: +49-40-8994-1814 22607 Hamburg e-mail: Martin.Koehler@desy.de Germany ------------------------------------------------------------------------ Show quoted text
>-----Original Message----- >From: Michael_Schilli via RT [mailto:bug-Log-Log4perl@rt.cpan.org] >Sent: Saturday, March 07, 2009 3:58 AM >To: Koehler, Martin >Subject: [rt.cpan.org #43740] Bug in Semphore when using non english locale > ><URL: https://rt.cpan.org/Ticket/Display.html?id=43740 > > >Now fixed in CVS (patch attached), will be released with 1.21. > >Thanks for reporting this, Martin! > >-- Mike
Resolved.