From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Allen Li Newsgroups: gmane.emacs.bugs Subject: bug#34192: 26.1; Bash 5.0 breaks TRAMP sudo Date: Tue, 29 Jan 2019 05:48:49 +0000 Message-ID: References: <87y375gpnk.fsf@gmx.de> <87pnshgn7v.fsf@gmx.de> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="82198"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 34192@debbugs.gnu.org To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jan 29 06:50:14 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1goMHi-000L7s-S9 for geb-bug-gnu-emacs@m.gmane.org; Tue, 29 Jan 2019 06:50:11 +0100 Original-Received: from localhost ([127.0.0.1]:43660 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1goMHh-0007vZ-Hb for geb-bug-gnu-emacs@m.gmane.org; Tue, 29 Jan 2019 00:50:09 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:59448) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1goMHb-0007vK-Nl for bug-gnu-emacs@gnu.org; Tue, 29 Jan 2019 00:50:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1goMHa-0005T5-9U for bug-gnu-emacs@gnu.org; Tue, 29 Jan 2019 00:50:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50394) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1goMHZ-0005Sr-SN for bug-gnu-emacs@gnu.org; Tue, 29 Jan 2019 00:50:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1goMHZ-00026l-Jm for bug-gnu-emacs@gnu.org; Tue, 29 Jan 2019 00:50:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Allen Li Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 29 Jan 2019 05:50:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34192 X-GNU-PR-Package: emacs Original-Received: via spool by 34192-submit@debbugs.gnu.org id=B34192.15487409508033 (code B ref 34192); Tue, 29 Jan 2019 05:50:01 +0000 Original-Received: (at 34192) by debbugs.gnu.org; 29 Jan 2019 05:49:10 +0000 Original-Received: from localhost ([127.0.0.1]:49675 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1goMGj-00025V-Sa for submit@debbugs.gnu.org; Tue, 29 Jan 2019 00:49:10 -0500 Original-Received: from mail-it1-f173.google.com ([209.85.166.173]:35767) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1goMGg-000257-Sz for 34192@debbugs.gnu.org; Tue, 29 Jan 2019 00:49:08 -0500 Original-Received: by mail-it1-f173.google.com with SMTP id p197so2316727itp.0 for <34192@debbugs.gnu.org>; Mon, 28 Jan 2019 21:49:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=felesatra-moe.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=uLoYBPkgaId6vakpA+84Lr78lBf3OpaP5aCCMbHCXWs=; b=R4P4Mg1z8TFyiWkAlC149kbdIkQghgESyIKwtxKmZEL4giynQXejgg8t7H2B24tvzp zbL1wW6Dl2sfIueYxNI/kcwy+Y8FP27siCJgfm1bGZXha6gJGa/X9DuHB8YpM3FZKu7r XQ33d/P6Fx0BeivEXiQjGDEcIkbFJFXsWyHgZk4DxLT0ohac49HgTJepwJ6ES6wPc6su Wg9RMppJMTfnVQxZDcF25VvTu6lvnbWcwTyxejIzyxxVkF/iBu6xf4d8Pt1a4aA8RK6R 4Q8m90qvbXBSFIaPEmkF0tq1KWpKa6LLeIk9dAAhtYMZq5D8NkJA8mUDeYWUnOGAsSZR qYGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=uLoYBPkgaId6vakpA+84Lr78lBf3OpaP5aCCMbHCXWs=; b=fyrmm+GzMTmEXdL1qvS8AuEDDazjZAOlbCyVZTlWnJU5bSaElnKL/sPvChqepYhH6e WdStIiC1zRadYWozEUxkNumjFd06I8gZCnB7nH5rNCd8JFa5IYOU79OYA5i5p1I0lwIg Wx+ccKw5A6Jl+UYIq5xDRltBK1xx6ACUL2TcmbLBgAr3/HWG8Wwc81ZBRcNhuJLnxIkU azu6zRYnQlr9eGAzJuJWDtPqlDleY0HJkcB22/3ErJSVVt2wrl93jDqcxMGeeaMjX5Bx 6rSg+yNimjAhN9Z1vToUTW8AgZ8vCMWsdfyaqNWYXcqTnd20TOXnS0JL0/zl/sN2DtnV MMkw== X-Gm-Message-State: AJcUukeMyY0Papux48ZzYuK/TR3FVluwLGLe33spKBSB3UEqI+0DBTZY ONVgPdRT46c3as8bvv/0+K66We5StG5i2z5WO4UYjQ== X-Google-Smtp-Source: ALg8bN6QujgUvr5OSCBv8I399sar3i5nNPPi2taA4jjc1L9gXasiPP9+35oJoCA1zpVf5f6Ho7kYWEdYfy6pHyOBvOE= X-Received: by 2002:a24:53c9:: with SMTP id n192mr11519661itb.8.1548740940660; Mon, 28 Jan 2019 21:49:00 -0800 (PST) In-Reply-To: <87pnshgn7v.fsf@gmx.de> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:154856 Archived-At: On Mon, Jan 28, 2019 at 9:12 AM Michael Albinus wrote: > > Allen Li writes: > > Hi Allen, > > > I get tramp_exit_status 0 as expected, but I think > > tramp_perl_file_name_all_completions may be a red herring, since when > > I tried using Edebug on tramp-sh-handle-file-name-all-completions, I > > get the "Process has died" error after some time irrespective of my > > code stepping. > > So could you pls call this shell function, once it has been declared: > > # tramp_perl_file_name_all_completions `pwd` Running that didn't yield any insights. in both normal bash and bash --posix. I also tried sending it via stdin instead of an interactive shell, all with no luck. I tried monkey patching tramp-wait-for-regexp to see what the exit status is. (defun tramp-wait-for-regexp (proc timeout regexp) "Wait for a REGEXP to appear from process PROC within TIMEOUT seconds. Expects the output of PROC to be sent to the current buffer. Returns the string that matched, or nil. Waits indefinitely if TIMEOUT is nil." (with-current-buffer (process-buffer proc) (let ((found (tramp-check-for-regexp proc regexp))) (cond (timeout (with-timeout (timeout) (while (not found) (tramp-accept-process-output proc 1) (unless (process-live-p proc) (message "@@@@@@@@@@@ DEAD %d" (process-exit-status proc)) (debug) (tramp-error-with-buffer nil proc 'file-error "Process has died")) (setq found (tramp-check-for-regexp proc regexp))))) (t (while (not found) (tramp-accept-process-output proc 1) (unless (process-live-p proc) (message "@@@@@@@@@@@ DEAD %d" (process-exit-status proc)) (debug) (tramp-error-with-buffer nil proc 'file-error "Process has died")) (setq found (tramp-check-for-regexp proc regexp))))) (tramp-message proc 6 "\n%s" (buffer-string)) (when (not found) (if timeout (tramp-error proc 'file-error "[[Regexp `%s' not found in %d secs]]" regexp timeout) (tramp-error proc 'file-error "[[Regexp `%s' not found]]" regexp))) found))) In my Messages buffer, I found @@@@@@@@@@@ DEAD 139 A search tells me that this is SIGSEGV. The corresponding backtrace: (if (process-live-p proc) nil (message "@@@@@@@@@@@ DEAD %d" (process-exit-status proc)) (debug) (tramp-error-with-buffer nil proc 'file-error "Process has died")) (while (not found) (tramp-accept-process-output proc 1) (if (process-live-p proc) nil (message "@@@@@@@@@@@ DEAD %d" (process-exit-status proc)) (debug) (tramp-error-with-buffer nil proc 'file-error "Process has died")) (setq found (tramp-check-for-regexp proc regexp))) (cond (timeout (let ((-with-timeout-value- (catch 'timeout (let* ((-with-timeout-timer- (run-with-timer timeout nil (function (lambda nil (throw 'timeout 'timeout))))) (with-timeout-timers (cons -with-timeout-timer- with-timeout-timers))) (unwind-protect (progn (while (not found) (tramp-accept-process-output proc 1) (if (process-live-p proc) nil (message "@@@@@@@@@@@ DEAD %d" (process-exit-status proc)) (debug) (tramp-error-with-buffer nil proc 'file-error "Process has died")) (setq found (tramp-check-for-regexp proc regexp)))) (cancel-timer -with-timeout-timer-)))))) (if (eq -with-timeout-value- 'timeout) (progn) -with-timeout-value-))) (t (while (not found) (tramp-accept-process-output proc 1) (if (process-live-p proc) nil (message "@@@@@@@@@@@ DEAD %d" (process-exit-status proc)) (debug) (tramp-error-with-buffer nil proc 'file-error "Process has died")) (setq found (tramp-check-for-regexp proc regexp))))) (let ((found (tramp-check-for-regexp proc regexp))) (cond (timeout (let ((-with-timeout-value- (catch 'timeout (let* ((-with-timeout-timer- (run-with-timer timeout nil (function (lambda nil (throw 'timeout 'timeout))))) (with-timeout-timers (cons -with-timeout-timer- with-timeout-timers))) (unwind-protect (progn (while (not found) (tramp-accept-process-output proc 1) (if (process-live-p proc) nil (message "@@@@@@@@@@@ DEAD %d" (process-exit-status proc)) (debug) (tramp-error-with-buffer nil proc 'file-error "Process has died")) (setq found (tramp-check-for-regexp proc regexp)))) (cancel-timer -with-timeout-timer-)))))) (if (eq -with-timeout-value- 'timeout) (progn) -with-timeout-value-))) (t (while (not found) (tramp-accept-process-output proc 1) (if (process-live-p proc) nil (message "@@@@@@@@@@@ DEAD %d" (process-exit-status proc)) (debug) (tramp-error-with-buffer nil proc 'file-error "Process has died")) (setq found (tramp-check-for-regexp proc regexp))))) (tramp-message proc 6 "\n%s" (buffer-string)) (if (not found) (progn (if timeout (tramp-error proc 'file-error "[[Regexp `%s' not found in %d secs]]" regexp timeout) (tramp-error proc 'file-error "[[Regexp `%s' not found]]" regexp)))) found) (save-current-buffer (set-buffer (process-buffer proc)) (let ((found (tramp-check-for-regexp proc regexp))) (cond (timeout (let ((-with-timeout-value- (catch 'timeout (let* ((-with-timeout-timer- (run-with-timer timeout nil (function (lambda nil (throw 'timeout 'timeout))))) (with-timeout-timers (cons -with-timeout-timer- with-timeout-timers))) (unwind-protect (progn (while (not found) (tramp-accept-process-output proc 1) (if (process-live-p proc) nil (message "@@@@@@@@@@@ DEAD %d" (process-exit-status proc)) (debug) (tramp-error-with-buffer nil proc 'file-error "Process has died")) (setq found (tramp-check-for-regexp proc regexp)))) (cancel-timer -with-timeout-timer-)))))) (if (eq -with-timeout-value- 'timeout) (progn) -with-timeout-value-))) (t (while (not found) (tramp-accept-process-output proc 1) (if (process-live-p proc) nil (message "@@@@@@@@@@@ DEAD %d" (process-exit-status proc)) (debug) (tramp-error-with-buffer nil proc 'file-error "Process has died")) (setq found (tramp-check-for-regexp proc regexp))))) (tramp-message proc 6 "\n%s" (buffer-string)) (if (not found) (progn (if timeout (tramp-error proc 'file-error "[[Regexp `%s' not found in %d secs]]" regexp timeout) (tramp-error proc 'file-error "[[Regexp `%s' not found]]" regexp)))) found)) tramp-wait-for-regexp(# nil "\\(^\\|\0\\)[^#$\n]*///e7c116e27b816fdfc1b43f2c9e5a951b#\\$\\(\033[[0-9]+n\\)?\015?$") tramp-wait-for-output(#) tramp-send-command((tramp-file-name "sudo" #("root" 0 4 (tramp-default t)) nil "cielnosurge" nil "/" nil) "tramp_perl_file_name_all_completions () {\n\\perl -e '\nopendir(d, $ARGV[0]) || die(\"$ARGV[0]: $!\\nfail\\n\");\n@files = readdir(d); closedir(d);\nforeach $f (@files) {\n if (-d \"$ARGV[0]/$f\") {\n print \"$f/\\n\";\n }\n else {\n print \"$f\\n\";\n }\n}\nprint \"ok\\n\"\n' \"$1\" 2>/dev/null\n} 2>/dev/null; echo tramp_exit_status $?") tramp-send-command-and-check((tramp-file-name "sudo" #("root" 0 4 (tramp-default t)) nil "cielnosurge" nil "/" nil) "tramp_perl_file_name_all_completions () {\n\\perl -e '\nopendir(d, $ARGV[0]) || die(\"$ARGV[0]: $!\\nfail\\n\");\n@files = readdir(d); closedir(d);\nforeach $f (@files) {\n if (-d \"$ARGV[0]/$f\") {\n print \"$f/\\n\";\n }\n else {\n print \"$f\\n\";\n }\n}\nprint \"ok\\n\"\n' \"$1\" 2>/dev/null\n}") tramp-barf-unless-okay((tramp-file-name "sudo" #("root" 0 4 (tramp-default t)) nil "cielnosurge" nil "/" nil) "tramp_perl_file_name_all_completions () {\n\\perl -e '\nopendir(d, $ARGV[0]) || die(\"$ARGV[0]: $!\\nfail\\n\");\n@files = readdir(d); closedir(d);\nforeach $f (@files) {\n if (-d \"$ARGV[0]/$f\") {\n print \"$f/\\n\";\n }\n else {\n print \"$f\\n\";\n }\n}\nprint \"ok\\n\"\n' \"$1\" 2>/dev/null\n}" "Script %s sending failed" "tramp_perl_file_name_all_completions") tramp-maybe-send-script((tramp-file-name "sudo" #("root" 0 4 (tramp-default t)) nil "cielnosurge" nil "/" nil) "%s -e '\nopendir(d, $ARGV[0]) || die(\"$ARGV[0]: $!\\nfail\\n\");\n@files = readdir(d); closedir(d);\nforeach $f (@files) {\n if (-d \"$ARGV[0]/$f\") {\n print \"$f/\\n\";\n }\n else {\n print \"$f\\n\";\n }\n}\nprint \"ok\\n\"\n' \"$1\" 2>/dev/null" "tramp_perl_file_name_all_completions") tramp-sh-handle-file-name-all-completions("" #("/sudo:root@cielnosurge:/" 6 10 (tramp-default t))) apply(tramp-sh-handle-file-name-all-completions ("" #("/sudo:root@cielnosurge:/" 6 10 (tramp-default t)))) tramp-sh-file-name-handler(file-name-all-completions "" #("/sudo:root@cielnosurge:/" 6 10 (tramp-default t))) apply(tramp-sh-file-name-handler file-name-all-completions ("" #("/sudo:root@cielnosurge:/" 6 10 (tramp-default t)))) tramp-file-name-handler(file-name-all-completions "" #("/sudo:root@cielnosurge:/" 6 10 (tramp-default t))) file-name-all-completions("" #("/sudo:root@cielnosurge:/" 6 10 (tramp-default t))) tramp-handle-file-name-completion("" #("/sudo:root@cielnosurge:/" 6 10 (tramp-default t)) file-exists-p) apply(tramp-handle-file-name-completion ("" #("/sudo:root@cielnosurge:/" 6 10 (tramp-default t)) file-exists-p)) tramp-sh-file-name-handler(file-name-completion "" #("/sudo:root@cielnosurge:/" 6 10 (tramp-default t)) file-exists-p) apply(tramp-sh-file-name-handler file-name-completion ("" #("/sudo:root@cielnosurge:/" 6 10 (tramp-default t)) file-exists-p)) tramp-file-name-handler(file-name-completion "" #("/sudo:root@cielnosurge:/" 6 10 (tramp-default t)) file-exists-p) > > Instead of `pwd` you could use any directory path. > > Best regards, Michael.