Bug 1203080

Summary: git-send-email: perl-TermReadLine-Gnu: Bad file descriptor during global destruction
Product: [openSUSE] openSUSE Distribution Reporter: David Disseldorp <ddiss>
Component: DevelopmentAssignee: Nathan Cutler <ncutler>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Minor    
Priority: P5 - None CC: coolo, hh_fiddelke, msvec, ncutler, thehejik, tina.mueller
Version: Leap 15.4   
Target Milestone: ---   
Hardware: Other   
OS: Other   
See Also: https://bugzilla.opensuse.org/show_bug.cgi?id=966042
Whiteboard:
Found By: Development Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description David Disseldorp 2022-09-02 19:57:04 UTC
git-send-email 2.35.3 on Leap 15.4 spits out a page full of warnings after a patch is successfully sent. E.g.

> git send-email -1
...
Send this email? ([y]es|[n]o|[e]dit|[q]uit|[a]ll): y
...
Result: 250
Warning: unable to close filehandle properly: Bad file descriptor during global destruction.
Warning: unable to close filehandle properly: Bad file descriptor during global destruction.
Warning: unable to close filehandle properly: Bad file descriptor during global destruction.
Warning: unable to close filehandle properly: Bad file descriptor during global destruction.
Warning: unable to close filehandle properly: Bad file descriptor during global destruction.
Warning: unable to close filehandle properly: Bad file descriptor during global destruction.
Warning: unable to close filehandle properly: Bad file descriptor during global destruction.
Warning: unable to close filehandle properly: Bad file descriptor during global destruction.
Warning: unable to close filehandle properly: Bad file descriptor during global destruction.
Warning: unable to close filehandle properly: Bad file descriptor during global destruction.
Warning: unable to close filehandle properly: Bad file descriptor during global destruction.
Warning: unable to close filehandle properly: Bad file descriptor during global destruction.
Warning: unable to close filehandle properly: Bad file descriptor during global destruction.
Warning: unable to close filehandle properly: Bad file descriptor during global destruction.
Warning: unable to close filehandle properly: Bad file descriptor during global destruction.
Warning: unable to close filehandle properly: Bad file descriptor during global destruction.

As mentioned, the patch is sent successfully, hence the minor severity.
Searching around lead me to https://github.com/netdisco/netdisco/wiki/Troubleshooting#perl-termreadline-gnu-operating-system-packages which states:

> certain versions of this package can make netdisco-deploy error out with:
> Warning: unable to close filehandle properly: Bad file descriptor during global destruction.
> upgrading to a newer version (1.35) should fix the problem.

I upgraded the Leap 15.4 perl-TermReadLine-Gnu-1.20 package to perl-Term-ReadLine-Gnu-1.42-lp154 from obs devel:languages:perl and sure enough the warning disappeared (the patch is also still successfully sent).

@Tina, Coolo and Nathan: would you be open to updating the Leap 15.4 / SLE15-SP4 perl-TermReadLine-Gnu-1.20 package to perl-Term-ReadLine-Gnu-1.42?
Comment 4 Nathan Cutler 2022-09-09 15:14:47 UTC
*** Bug 1091069 has been marked as a duplicate of this bug. ***
Comment 5 Nathan Cutler 2022-09-09 15:16:11 UTC
*** Bug 1201046 has been marked as a duplicate of this bug. ***
Comment 6 Stefan Hundhammer 2023-01-18 13:27:25 UTC
See also bug #1207253.

Very easy to reproduce:

  yast2 users foo

-> 

Warning: unable to close filehandle properly: Bad file descriptor, 
  <STDIN> line 5 during global destruction (#1)

(S io) There were errors during the implicit close() done on a filehandle
when its reference count reached zero while it was still open, e.g.:
   
{
  open my $fh, '>', $file  or die "open: '$file': $!\n";
  print $fh $data or die "print: $!";
} # implicit close here
Comment 7 Stefan Hundhammer 2023-01-18 13:28:57 UTC
Nathan, in that other bug, the reporter suggests:

"Cause for this error seems to be the package "perl-TermReadLine-Gnu" (consider naming) V1.20, which is part of all 15.X Leap distributions.

Replacing this with the package perl-Term-ReadLine-Gnu V1.45 (also consider naming) from https://software.opensuse.org/package/perl-Term-ReadLine-Gnu
seems to fix the issue, but is missing in distributions."
Comment 9 Nathan Cutler 2023-01-19 12:35:08 UTC
*** Bug 1207253 has been marked as a duplicate of this bug. ***
Comment 11 Nathan Cutler 2023-03-09 10:25:25 UTC
perl-Term-ReadLine-Gnu 1.42 has been released as a maintenance update for openSUSE Leap 15.4/SLE-15-SP4. I have verified that it correctly replaces the old perl-TermReadLine-Gnu 1.20.