Web lists-archives.com

git-send-email warnings & process dying of signal 11




Hello & Happy New Year!

I've recently switched from openSUSE 42.3 (perl 5.18.2 & git 2.13.7) to
the openSUSE Tumbleweed (perl 5.28.1 & git 2.20.1) and send-email
doesn't work for me anymore.

FWIW it doesn't seem like a git regression. I've manually installed
2.13.7 in my new OS and it also fails.

It basically fails with the:
Warning: unable to close filehandle __ANONIO__ properly: Bad file descriptor at /usr/lib/git/git-send-email line 812.
Warning: unable to close filehandle __ANONIO__ properly: Bad file descriptor at /usr/lib/git/git-send-email line 812.
error: git-send-email died of signal 11

Relevant perl source:
   802  sub ask {
   803          my ($prompt, %arg) = @_;
   804          my $valid_re = $arg{valid_re};
   805          my $default = $arg{default};
   806          my $confirm_only = $arg{confirm_only};
   807          my $resp;
   808          my $i = 0;
   809          return defined $default ? $default : undef
   810                  unless defined $term->IN and defined fileno($term->IN) and
   811                         defined $term->OUT and defined fileno($term->OUT);
   812          while ($i++ < 10) {
   813                  $resp = $term->readline($prompt);
   814                  if (!defined $resp) { # EOF
   815                          print "\n";
   816                          return defined $default ? $default : undef;
   817                  }
   818                  if ($resp eq '' and defined $default) {
   819                          return $default;
   820                  }
   821                  if (!defined $valid_re or $resp =~ /$valid_re/) {
   822                          return $resp;
   823                  }
   824                  if ($confirm_only) {
   825                          my $yesno = $term->readline(
   826                                  # TRANSLATORS: please keep [y/N] as is.
   827                                  sprintf(__("Are you sure you want to use <%s> [y/N]? "), $resp));
   828                          if (defined $yesno && $yesno =~ /y/i) {
   829                                  return $resp;
   830                          }
   831                  }
   832          }
   833          return;
   834  }

It seems that the "return defined" line causes warnings.

I don't know perl but I tried patching /usr/lib/git/git-send-email with
the attached diff and got a following output:

Warning: unable to close filehandle __ANONIO__ properly: Bad file descriptor at /usr/lib/git/git-send-email line 812.
Warning: unable to close filehandle __ANONIO__ properly: Bad file descriptor at /usr/lib/git/git-send-email line 812.
term: Term::ReadLine=HASH(0x56138dd97c50)
*** buffer overflow detected ***: /usr/bin/perl terminated
error: git-send-email died of signal 6

It makes me suspect that maybe readline() call causes a crash.

Does this report make sense? Is there anything else I can provide?

--- /usr/lib/git/git-send-email.orig    2019-01-01 23:38:35.980954492 +0100
+++ /usr/lib/git/git-send-email 2019-01-01 23:37:58.964956240 +0100
@@ -810,7 +810,9 @@
                unless defined $term->IN and defined fileno($term->IN) and
                       defined $term->OUT and defined fileno($term->OUT);
        while ($i++ < 10) {
+               print STDERR "term: $term\n";
                $resp = $term->readline($prompt);
+               print STDERR "readline done\n";
                if (!defined $resp) { # EOF
                        print "\n";
                        return defined $default ? $default : undef;