develooper Front page | perl.perl5.porters | Postings from December 2014

[perl #123503] Bug in POSIX::strerror on 5.21.7

Thread Previous
From:
slaven@rezic.de via RT
Date:
December 26, 2014 14:21
Subject:
[perl #123503] Bug in POSIX::strerror on 5.21.7
Message ID:
rt-4.0.18-9237-1419603669-1542.123503-15-0@perl.org
Dana Pet 26. Pro 2014, 05:29:25, tiago.peczenyj@gmail.com reče:
> Hello,
> 
> I find one bug on POSIX::strerror on 5.21.7 - it erase the $!
> variable!
> 
> I discover this based on this ticket:
> 
> https://github.com/Weborama/Riak-Light/issues/18
> 
> I try to reproduce the error using the 5.21.7 and I discover one
> strange behavior on POSIX::strerror
> 
> IF I do this
> 
> < perl code >
> use POSIX qw(ETIMEDOUT strerror);
> $! = ETIMEDOUT;
> my $errmsg = strerror(ETIMEDOUT);
> < / perl code >
> 
> after the strerror, the content of $! was totally erased. and it has a
> bad impact on my tests.
> 
> Seems the origin of this problem is this change between 5.21.6 and
> 5.21.7
> 
> - strerror  => 'errno => local $! = $_[0]; "$!"',
> + strerror  => 'errno => use locale; local $! = $_[0]; "$!"',
> 
> I attach two files:
> 
> one is a propose to test this bug. it works for 5.12.2 and fails for
> 5.21.7
> 
> another is a more complete test, to show what I am doing.

A possible fix is attached.

Regards,
    Slaven


---
via perlbug:  queue: perl5 status: new
https://rt.perl.org/Ticket/Display.html?id=123503

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About