unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: Allen Li <darkfeline@felesatra.moe>
Cc: 34192@debbugs.gnu.org
Subject: bug#34192: 26.1; Bash 5.0 breaks TRAMP sudo
Date: Thu, 21 Feb 2019 11:39:43 +0100	[thread overview]
Message-ID: <87imxd5ssw.fsf@gmx.de> (raw)
In-Reply-To: <CADbSrJy3V5isZSHmUfYgF3Bv5UkCgBRAtTOHgAqB331+-4-2oQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 191 bytes --]


-------------------- Start of forwarded message --------------------
Subject: Re: bash 5.0 dies with HISTSIZE=0
From: Chet Ramey <chet.ramey@case.edu>
Date: Wed, 20 Feb 2019 16:23:23 -0500


[-- Attachment #2.1: Type: text/plain, Size: 1052 bytes --]

On 2/20/19 8:10 AM, Michael Albinus wrote:

> Bash Version: 5.0
> Patch Level: 0
> Release Status: release
> 
> Description:
> This is an error report from an Emacs/Tramp user. With bash 5.0, bash
> 5.0 dies when HISTSIZE is set to 0. Setting it to 1 seems to work. Using
> bash 4.4 works as well. <See https://debbugs.gnu.org/34192> for details.
> 
> Repeat-By:
> The following is an extract from what Tramp does inside Emacs. I could
> reproduce it in a a shell:
> 
> 
> # env TERM='dumb' INSIDE_EMACS='27.0.50,tramp:2.4.2-pre' ENV='' HISTFILE='' HISTFILESIZE=0 HISTSIZE=0 PROMPT_COMMAND='' PS1=\#\$\  PS2='' PS3='' /home/albinus/src/bash-5.0/bash -norc -noprofile
> #$ tramp_perl_file_name_all_completions () {
> \perl -e '
> opendir(d, $ARGV[0]) || die("$ARGV[0]: $!\nfail\n");

Thanks for the report. Try the attached patch and see if that fixes the
crash.

Chet


-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
		 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/

[-- Attachment #2.2: history-zero-length.patch --]
[-- Type: text/plain, Size: 1704 bytes --]

*** ../bash-5.0-patched/bashhist.c	2018-07-05 22:41:14.000000000 -0400
--- bashhist.c	2019-02-20 16:20:04.000000000 -0500
***************
*** 561,573 ****
    if (!history_expansion_inhibited && history_expansion && history_expansion_p (line))
      {
        /* If we are expanding the second or later line of a multi-line
  	 command, decrease history_length so references to history expansions
  	 in these lines refer to the previous history entry and not the
  	 current command. */
        if (history_length > 0 && command_oriented_history && current_command_first_line_saved && current_command_line_count > 1)
          history_length--;
        expanded = history_expand (line, &history_value);
        if (history_length >= 0 && command_oriented_history && current_command_first_line_saved && current_command_line_count > 1)
!         history_length++;
  
        if (expanded)
--- 561,576 ----
    if (!history_expansion_inhibited && history_expansion && history_expansion_p (line))
      {
+       int old_len;
+ 
        /* If we are expanding the second or later line of a multi-line
  	 command, decrease history_length so references to history expansions
  	 in these lines refer to the previous history entry and not the
  	 current command. */
+       old_len = history_length;
        if (history_length > 0 && command_oriented_history && current_command_first_line_saved && current_command_line_count > 1)
          history_length--;
        expanded = history_expand (line, &history_value);
        if (history_length >= 0 && command_oriented_history && current_command_first_line_saved && current_command_line_count > 1)
!         history_length = old_len;
  
        if (expanded)

[-- Attachment #3: Type: text/plain, Size: 67 bytes --]

-------------------- End of forwarded message --------------------

      parent reply	other threads:[~2019-02-21 10:39 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-24 22:14 bug#34192: 26.1; Bash 5.0 breaks TRAMP sudo Allen Li
2019-01-28  8:19 ` Michael Albinus
2019-01-28  8:58   ` Allen Li
2019-01-28  9:12     ` Michael Albinus
2019-01-29  5:48       ` Allen Li
2019-01-29 10:04         ` Michael Albinus
2019-02-03  0:21           ` Allen Li
2019-02-04 11:53             ` Michael Albinus
2019-02-07  7:04               ` Allen Li
2019-02-07  9:22                 ` Michael Albinus
2019-02-08  8:45                   ` Allen Li
2019-02-08 10:44                     ` Michael Albinus
2019-02-17  3:11                       ` Allen Li
2019-02-20 14:43                         ` Michael Albinus
2019-02-21 10:38                           ` Michael Albinus
2019-02-21 11:20                             ` Michael Albinus
2019-02-21 10:39 ` Michael Albinus [this message]

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: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=87imxd5ssw.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=34192@debbugs.gnu.org \
    --cc=darkfeline@felesatra.moe \
    /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://git.savannah.gnu.org/cgit/emacs.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).