Skip Menu |

This queue is for tickets about the ExtUtils-MakeMaker CPAN distribution.

Report information
The Basics
Id: 133762
Status: open
Priority: 0/
Queue: ExtUtils-MakeMaker

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

Bug Information
Severity: (no value)
Broken in:
  • 7.52
  • 7.54
Fixed in: (no value)



Subject: EU::MM in Perl 5 blead throwing 'printf on closed filehandle' warnings
ExtUtils::MakeMaker is frequently invoked while running 'make' during the Perl 5 build process. Today I happened to spot warnings like this in the output of 'make': ##### ./miniperl -Ilib make_ext.pl lib/auto/Unicode/Collate/Collate.so MAKE="make" LIBPERL_A=libperl.a LINKTYPE=dynamic Making header files for XS... printf() on closed filehandle $fh_h at /home/jkeenan/gitwork/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm line 1233. print() on closed filehandle $fh_h at /home/jkeenan/gitwork/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm line 1234. make[1]: Entering directory '/home/jkeenan/gitwork/perl/cpan/Unicode-Collate' ##### I have observed these warnings in the output of 'make' at the following recent commits embedded in filenames: ##### $ zgrep -l 'closed filehandle' *.txt.gz 2ce8ebb919.freebsd.maketp.output.txt.gz 5fd7c63cc7.freebsd.maketp.output.txt.gz ec5a5b629f.freebsd.make.output.txt.gz $ zgrep -l 'closed filehandle' *.txt.gz blead.2ce8ebb919.linux.clang-10.debugging.maketp.output.txt.gz blead.2ce8ebb919.linux.clang-10.maketp.output.txt.gz blead.2ce8ebb919.linux.clang-10.threaded.maketp.output.txt.gz blead.2ce8ebb919.linux.unthreaded.maketp.output.txt.gz blead.c49e90e1c5.linux.g++-9.3.0.maketp.output.txt.gz ##### The earliest of these commits is: ##### commit ec5a5b629f2f5a9b63b27eb6d71233781d32ae61 Author: Tony Cook <tony@develop-help.com> AuthorDate: Tue Oct 27 11:36:46 2020 Commit: Tony Cook <tony@develop-help.com> CommitDate: Wed Nov 4 23:47:30 2020 ##### That suggests that the source of the warnings was the last sync-into-blead of EU-MM prior to Nov 4. That would be version 7.52 or possibly 7.48: ##### uthor: Chris 'BinGOs' Williams <chris@bingosnet.co.uk> AuthorDate: Wed Nov 4 15:34:01 2020 Commit: Chris 'BinGOs' Williams <chris@bingosnet.co.uk> CommitDate: Wed Nov 4 15:34:01 2020 Update ExtUtils-MakeMaker to CPAN version 7.52 [DELTA] 7.52 Wed 4 Nov 19:49:43 GMT 2020 -- Author: Todd Rinaldo <toddr@cpan.org> AuthorDate: Mon Oct 5 15:40:53 2020 Commit: Todd Rinaldo <toddr@cpan.org> CommitDate: Tue Oct 6 15:37:32 2020 Update ExtUtils-MakeMaker to CPAN version 7.48 ##### Now, the lines referenced in the warnings in the 'make' output have not changed since 2016-03-16. ##### 880b77c77 (Derek Lamb 2016-03-16 12:15:29 -0600 1233) printf "Generating a %s %s\n", $self->make_type, $finalname if $Verbose || !$self->{PARENT}; 880b77c77 (Derek Lamb 2016-03-16 12:15:29 -0600 1234) print "Writing $finalname for $self->{NAME}\n" if $Verbose || !$self->{PARENT}; ##### So some other change must have caused these lines to be reached. Can you investigate? Thank you very much. Jim Keenan
On Tue Nov 17 15:55:37 2020, JKEENAN wrote: Show quoted text
> ExtUtils::MakeMaker is frequently invoked while running 'make' during > the Perl 5 build process. Today I happened to spot warnings like this > in the output of 'make': > > ##### > ./miniperl -Ilib make_ext.pl lib/auto/Unicode/Collate/Collate.so > MAKE="make" LIBPERL_A=libperl.a LINKTYPE=dynamic > Making header files for XS... > printf() on closed filehandle $fh_h at > /home/jkeenan/gitwork/perl/cpan/ExtUtils- > MakeMaker/lib/ExtUtils/MakeMaker.pm line 1233. > print() on closed filehandle $fh_h at > /home/jkeenan/gitwork/perl/cpan/ExtUtils- > MakeMaker/lib/ExtUtils/MakeMaker.pm line 1234. > make[1]: Entering directory '/home/jkeenan/gitwork/perl/cpan/Unicode- > Collate' > ##### >
I'm trying to determine whether this is an interaction with a recent sync-to-blead of Unicode-Collate.
On Tue Nov 17 17:21:53 2020, JKEENAN wrote: Show quoted text
> On Tue Nov 17 15:55:37 2020, JKEENAN wrote:
> > ExtUtils::MakeMaker is frequently invoked while running 'make' during > > the Perl 5 build process. Today I happened to spot warnings like > > this > > in the output of 'make': > > > > ##### > > ./miniperl -Ilib make_ext.pl lib/auto/Unicode/Collate/Collate.so > > MAKE="make" LIBPERL_A=libperl.a LINKTYPE=dynamic > > Making header files for XS... > > printf() on closed filehandle $fh_h at > > /home/jkeenan/gitwork/perl/cpan/ExtUtils- > > MakeMaker/lib/ExtUtils/MakeMaker.pm line 1233. > > print() on closed filehandle $fh_h at > > /home/jkeenan/gitwork/perl/cpan/ExtUtils- > > MakeMaker/lib/ExtUtils/MakeMaker.pm line 1234. > > make[1]: Entering directory '/home/jkeenan/gitwork/perl/cpan/Unicode- > > Collate' > > ##### > >
> > I'm trying to determine whether this is an interaction with a recent > sync-to-blead of Unicode-Collate.
From what I have found investigating, these errors have always been there, they just weren't visible until 'use warnings;' was added to ExtUtils::MakeMaker I bisected the appearance of the warnings to https://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker/commit/06c035970e07afba9045463afba2f524ae8232d3 which was 'use warnings;' was added to EUMM If I comment out the 'use warnings' warnings disappear. But now we know that they are there, just not visible. Now why are these warnings happening. Unicode-Collate has a script that it executes with a do{} in it's Makefile.PL https://metacpan.org/source/SADAHIRO/Unicode-Collate-1.29/Makefile.PL#L12 That select's the filehandle $fh_h and further on closes it. https://metacpan.org/source/SADAHIRO/Unicode-Collate-1.29/mkheader#L143 https://metacpan.org/source/SADAHIRO/Unicode-Collate-1.29/mkheader#L197 and as it is in a do{} presumably leaves that closed filehandle as the default filehandle so later print()s and printf()s in EUMM fail. I have made the prints explicitly to STDOUT now: https://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker/commit/31c0252376da72051f4e6492fb525e16e0deafb0 The problem has been there a long time, but masked because of the lack of warnings in EUMM.pm Thanks.
On Wed Nov 18 13:21:34 2020, BINGOS wrote: Show quoted text
> On Tue Nov 17 17:21:53 2020, JKEENAN wrote:
> > On Tue Nov 17 15:55:37 2020, JKEENAN wrote:
> > > ExtUtils::MakeMaker is frequently invoked while running 'make' > > > during > > > the Perl 5 build process. Today I happened to spot warnings like > > > this > > > in the output of 'make': > > > > > > ##### > > > ./miniperl -Ilib make_ext.pl lib/auto/Unicode/Collate/Collate.so > > > MAKE="make" LIBPERL_A=libperl.a LINKTYPE=dynamic > > > Making header files for XS... > > > printf() on closed filehandle $fh_h at > > > /home/jkeenan/gitwork/perl/cpan/ExtUtils- > > > MakeMaker/lib/ExtUtils/MakeMaker.pm line 1233. > > > print() on closed filehandle $fh_h at > > > /home/jkeenan/gitwork/perl/cpan/ExtUtils- > > > MakeMaker/lib/ExtUtils/MakeMaker.pm line 1234. > > > make[1]: Entering directory > > > '/home/jkeenan/gitwork/perl/cpan/Unicode- > > > Collate' > > > ##### > > >
> > > > I'm trying to determine whether this is an interaction with a recent > > sync-to-blead of Unicode-Collate.
> > From what I have found investigating, these errors have always been > there, they just weren't visible until 'use warnings;' was added to > ExtUtils::MakeMaker > > I bisected the appearance of the warnings to https://github.com/Perl- > Toolchain-Gang/ExtUtils- > MakeMaker/commit/06c035970e07afba9045463afba2f524ae8232d3 which was > 'use warnings;' was added to EUMM > > If I comment out the 'use warnings' warnings disappear. But now we > know that they are there, just not visible. > > Now why are these warnings happening. Unicode-Collate has a script > that it executes with a do{} in it's Makefile.PL > https://metacpan.org/source/SADAHIRO/Unicode-Collate- > 1.29/Makefile.PL#L12 > > That select's the filehandle $fh_h and further on closes it. > https://metacpan.org/source/SADAHIRO/Unicode-Collate- > 1.29/mkheader#L143 > https://metacpan.org/source/SADAHIRO/Unicode-Collate- > 1.29/mkheader#L197 > > and as it is in a do{} presumably leaves that closed filehandle as the > default filehandle so later print()s and printf()s in EUMM fail. > > I have made the prints explicitly to STDOUT now: > https://github.com/Perl-Toolchain-Gang/ExtUtils- > MakeMaker/commit/31c0252376da72051f4e6492fb525e16e0deafb0 > > The problem has been there a long time, but masked because of the lack > of warnings in EUMM.pm > > Thanks.
Thanks for looking into this. When you get a chance, could you take a look at the p.r. I filed for blead (and ultimately for Unicode-Collate) and tell me whether it's helpful? https://github.com/Perl/perl5/pull/18332 Thank you very much. Jim Keenan