Issue with Perl 5.38 and fix
Posted: 06 Jul 2023, 01:15
[Copied to here as a suggestion to bring to the attention of devs]
Hi,
Following investigation there is a change in Perl 5.38 which breaks LFD (see Debian 12 LFD issues by me in General Discussions).
https://perldoc.perl.org/perldelta#read ... -eof-flags
As soon as one of the log files causes an error (e.g. is simply not present), all future log file reads on any file will fail until the error is cleared.
I solved this by adding a clearerr call before each log read, which is in the LFD file and the function getlogfile (around line 2195 for the function start).
I amended the code as follows:
Now LFD reads the log files under Perl 5.38. Not sure if this has any side effects or might occur elsewhere, so use at your own risk. I've not checked but assume a similar fix would be needed anywhere a file open/read could fail as this will now affect all future opens/reads.
Hi,
Following investigation there is a change in Perl 5.38 which breaks LFD (see Debian 12 LFD issues by me in General Discussions).
https://perldoc.perl.org/perldelta#read ... -eof-flags
As soon as one of the log files causes an error (e.g. is simply not present), all future log file reads on any file will fail until the error is cleared.
I solved this by adding a clearerr call before each log read, which is in the LFD file and the function getlogfile (around line 2195 for the function start).
I amended the code as follows:
Code: Select all
if (!defined($lffd[$lfn])) {
if (&openlogfile($logfile,$lfn)) {return undef}
}
$lffd[$lfn]->clearerr(); # <-- THIS IS THE NEW LINE
(undef, $ino, undef, undef, undef, undef, undef, $size, undef) = stat($logfile);