git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Rafał Miłecki" <rafal@milecki.pl>
To: git@vger.kernel.org
Subject: git-send-email warnings & process dying of signal 11
Date: Tue, 1 Jan 2019 23:45:49 +0100	[thread overview]
Message-ID: <1e4ac3d5-f6f5-bcce-2f09-0519934289b9@milecki.pl> (raw)

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;

             reply	other threads:[~2019-01-02  0:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-01 22:45 Rafał Miłecki [this message]
2019-01-03  7:22 ` git-send-email warnings & process dying of signal 11 Rafał Miłecki
2019-01-04  6:25   ` Carlo Arenas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1e4ac3d5-f6f5-bcce-2f09-0519934289b9@milecki.pl \
    --to=rafal@milecki.pl \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).