Subject: Re: bug#34192: 26.1; Bash 5.0 breaks TRAMP sudo

From: Allen Li <[email-masked]>
Date: Sun, 3 Feb 2019 00:21:56 +0000

On Tue, Jan 29, 2019 at 10:04 AM Michael Albinus <[email-masked]> wrote:
>
> Allen Li <[email-masked]> writes:
>
> Hi Allen,
>
> > I tried monkey patching tramp-wait-for-regexp to see what the exit status is.
>
> > In my Messages buffer, I found
> >
> > @@@@@@@@@@@ DEAD 139
> >
> > A search tells me that this is SIGSEGV.
> >
> > The corresponding backtrace:
>
> Thanks for the test. Unfortunately, it doesn't show why this happens.
>
> Maybe we could get some more messages from the shell. Could you, pls,
> apply the following patch:
>
> diff --git a/lisp/tramp-sh.el b/lisp/tramp-sh.el
> index c304fcb..46f467d 100644
> --- a/lisp/tramp-sh.el
> +++ b/lisp/tramp-sh.el
> @@ -658,7 +658,7 @@ foreach $f (@files) {
>   }
>  }
>  print \"ok\\n\"
> -' \"$1\" 2>/dev/null"
> +' \"$1\""
>    "Perl script to produce output suitable for use with
>  `file-name-all-completions' on the remote file system.  Escape
>  sequence %s is replaced with name of Perl binary.  This string is
>
> Recompile tramp-sh.el, and rerun the test with tramp-verbose 10. Your
> patch isn't needed in this scenario.

I took the liberty of removing the 2>/dev/null in
tramp-send-command-and-check as well, but
I don't think there's a lot of info.

16:13:19.685224 tramp-send-string (10) # \perl -e 'print "Hello
";' ; echo tramp_exit_status $?
16:13:19.685305 tramp-get-connection-property (7) # process-buffer nil
16:13:19.685403 tramp-get-connection-property (7) # check-remote-echo nil
16:13:19.685479 tramp-get-connection-property (7) # check-remote-echo nil
16:13:19.686923 tramp-accept-process-output (10) # *tramp/sudo
root@cielnosurge* run t
Hello
16:13:19.687030 tramp-get-connection-property (7) # check-remote-echo nil
16:13:19.687115 tramp-get-connection-property (7) # check-remote-echo nil
16:13:19.687232 tramp-accept-process-output (10) # *tramp/sudo
root@cielnosurge* run t
Hello
tramp_exit_status 0
///33fa052e8933ed0d43e05e92dd2ca7f3#$
16:13:19.687323 tramp-get-connection-property (7) # check-remote-echo nil
16:13:19.687399 tramp-get-connection-property (7) # check-remote-echo nil
16:13:19.687486 tramp-wait-for-regexp (6) #
Hello
tramp_exit_status 0
///33fa052e8933ed0d43e05e92dd2ca7f3#$
16:13:19.687604 tramp-get-connection-property (7) # process-buffer nil
16:13:19.687708 tramp-get-connection-property (7) # perl-file-spec undef
16:13:19.687793 tramp-get-connection-property (7) # process-name nil
16:13:19.687877 tramp-get-connection-property (7) # process-name nil
16:13:19.687959 tramp-get-connection-property (7) # process-buffer nil
16:13:19.688044 tramp-get-connection-property (7) # last-cmd-time
(23638 12831 685113 887000)
16:13:19.688133 tramp-get-connection-property (7) # process-name nil
16:13:19.688215 tramp-get-connection-property (7) # remote-echo nil
16:13:19.688305 tramp-send-command (6) # \perl -e 'use File::Spec;' ;
echo tramp_exit_status $?
16:13:19.688429 tramp-get-connection-property (7) # process-name nil
16:13:19.688533 tramp-get-connection-property (7) # chunksize 0
16:13:19.688638 tramp-set-connection-property (7) # last-cmd-time
(23638 12831 688608 245000)
16:13:19.688755 tramp-send-string (10) # \perl -e 'use File::Spec;' ;
echo tramp_exit_status $?
16:13:19.688844 tramp-get-connection-property (7) # process-buffer nil
16:13:19.688948 tramp-get-connection-property (7) # check-remote-echo nil
16:13:19.689027 tramp-get-connection-property (7) # check-remote-echo nil
16:13:19.696952 tramp-accept-process-output (10) # *tramp/sudo
root@cielnosurge* run t
tramp_exit_status 0
///33fa052e8933ed0d43e05e92dd2ca7f3#$
16:13:19.697071 tramp-get-connection-property (7) # check-remote-echo nil
16:13:19.697154 tramp-get-connection-property (7) # check-remote-echo nil
16:13:19.697241 tramp-wait-for-regexp (6) #
tramp_exit_status 0
///33fa052e8933ed0d43e05e92dd2ca7f3#$
16:13:19.697361 tramp-get-connection-property (7) # process-buffer nil
16:13:19.697462 tramp-set-connection-property (7) # perl-file-spec t
16:13:19.697544 tramp-get-connection-property (7) # perl-cwd-realpath undef
16:13:19.697629 tramp-get-connection-property (7) # process-name nil
16:13:19.697713 tramp-get-connection-property (7) # process-name nil
16:13:19.697793 tramp-get-connection-property (7) # process-buffer nil
16:13:19.697879 tramp-get-connection-property (7) # last-cmd-time
(23638 12831 688608 245000)
16:13:19.697965 tramp-get-connection-property (7) # process-name nil
16:13:19.698047 tramp-get-connection-property (7) # remote-echo nil
16:13:19.698126 tramp-send-command (6) # \perl -e 'use Cwd
"realpath";' ; echo tramp_exit_status $?
16:13:19.698207 tramp-get-connection-property (7) # process-name nil
16:13:19.698287 tramp-get-connection-property (7) # chunksize 0
16:13:19.698372 tramp-set-connection-property (7) # last-cmd-time
(23638 12831 698346 135000)
16:13:19.698453 tramp-send-string (10) # \perl -e 'use Cwd
"realpath";' ; echo tramp_exit_status $?
16:13:19.698532 tramp-get-connection-property (7) # process-buffer nil
16:13:19.698627 tramp-get-connection-property (7) # check-remote-echo nil
16:13:19.698703 tramp-get-connection-property (7) # check-remote-echo nil
16:13:19.703296 tramp-accept-process-output (10) # *tramp/sudo
root@cielnosurge* run t
tramp_exit_status 0
///33fa052e8933ed0d43e05e92dd2ca7f3#$
16:13:19.703413 tramp-get-connection-property (7) # check-remote-echo nil
16:13:19.703494 tramp-get-connection-property (7) # check-remote-echo nil
16:13:19.703578 tramp-wait-for-regexp (6) #
tramp_exit_status 0
///33fa052e8933ed0d43e05e92dd2ca7f3#$
16:13:19.703698 tramp-get-connection-property (7) # process-buffer nil
16:13:19.703799 tramp-set-connection-property (7) # perl-cwd-realpath t
16:13:19.703880 tramp-set-connection-property (7) # perl \perl
16:13:19.703962 tramp-get-connection-property (7) # process-name nil
16:13:19.704044 tramp-get-connection-property (7) # scripts nil
16:13:19.704123 tramp-maybe-send-script (5) # Sending script
‘tramp_perl_file_name_all_completions’...
16:13:19.704213 tramp-get-connection-property (7) # perl \perl
16:13:19.704290 tramp-get-connection-property (7) # perl \perl
16:13:19.704378 tramp-get-connection-property (7) # process-name nil
16:13:19.704457 tramp-get-connection-property (7) # process-name nil
16:13:19.704536 tramp-get-connection-property (7) # process-buffer nil
16:13:19.704619 tramp-get-connection-property (7) # last-cmd-time
(23638 12831 698346 135000)
16:13:19.704707 tramp-get-connection-property (7) # process-name nil
16:13:19.704790 tramp-get-connection-property (7) # remote-echo nil
16:13:19.704866 tramp-send-command (6) #
tramp_perl_file_name_all_completions () {
\perl -e '
opendir(d, $ARGV[0]) || die("$ARGV[0]: $!\nfail\n");
@files = readdir(d); closedir(d);
foreach $f (@files) {
 if (-d "$ARGV[0]/$f") {
  print "$f/\n";
 }
 else {
  print "$f\n";
 }
}
print "ok\n"
' "$1"
} ; echo tramp_exit_status $?
16:13:19.704957 tramp-get-connection-property (7) # process-name nil
16:13:19.705087 tramp-get-connection-property (7) # chunksize 0
16:13:19.705193 tramp-set-connection-property (7) # last-cmd-time
(23638 12831 705148 363000)
16:13:19.705294 tramp-send-string (10) #
tramp_perl_file_name_all_completions () {
\perl -e '
opendir(d, $ARGV[0]) || die("$ARGV[0]: $!\nfail\n");
@files = readdir(d); closedir(d);
foreach $f (@files) {
 if (-d "$ARGV[0]/$f") {
  print "$f/\n";
 }
 else {
  print "$f\n";
 }
}
print "ok\n"
' "$1"
} ; echo tramp_exit_status $?
16:13:19.705404 tramp-get-connection-property (7) # process-buffer nil
16:13:19.705518 tramp-get-connection-property (7) # check-remote-echo nil
16:13:19.705597 tramp-get-connection-property (7) # check-remote-echo nil
16:13:21.402934 tramp-maybe-send-script (5) # Sending script
‘tramp_perl_file_name_all_completions’...failed

> Best regards, Michael.