Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: CHORNY [...] cpan.org
Cc:
AdminCc:

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



Subject: t/053Resurrect.t fail with new File::Temp on Windows
using INTERNAL_DEBUG => 1: t/053Resurrect.t .. resurrector_loader called with L4pResurrectable.pm File L4pResurrectable.pm found in eg\L4pResurrectable.pm Resurrecting module eg\L4pResurrectable.pm Read 181 bytes from eg\L4pResurrectable.pm resurrector_loader called with Win32.pm File Win32.pm found in C:\strawberry\perl\lib\Win32.pm Resurrecting module C:\strawberry\perl\lib\Win32.pm Read 47736 bytes from C:\strawberry\perl\lib\Win32.pm resurrector_loader called with Win32.pm File Win32.pm found in C:\strawberry\perl\lib\Win32.pm Resurrecting module C:\strawberry\perl\lib\Win32.pm Read 47736 bytes from C:\strawberry\perl\lib\Win32.pm resurrector_loader called with Win32.pm File Win32.pm found in C:\strawberry\perl\lib\Win32.pm Resurrecting module C:\strawberry\perl\lib\Win32.pm Read 47736 bytes from C:\strawberry\perl\lib\Win32.pm -- Alexandr Ciornii, http://chorny.net
I traced this bug and have a trivial fix for it, but no patch at the moment. The bug here is a chicken-and-egg problem. Log::Log4perl::Resurrector creates a source filter, which affects all code loaded from that point forward. The source filter is in resurrector_loader(), which calls resurrector_fh(), which calls File::Temp::tempfile(), which calls Cwd::getcwd(). On Windows, this triggers a load of the "Win32" module, which triggers the source filter, causing an infinite recursion loop. The solution is to force the Win32 module to load BEFORE the source filter is installed, by adding the following line to Log/Log4perl/Resurrector.pm: use if $^O eq "MSWin32", "Win32"; This will pre-load the "Win32" module on Windows platforms, which resolves this chicken-and-egg problem. With this line added, Log::Log4perl 1.42 passes the t/053Resurrect.t test with File::Temp 0.2304.