Subject: Re: bug#42538: 28.0.50; tramp-test35-remote-path test timing out on macOS

From: Michael Albinus <[email-masked]>
Date: Fri, 31 Jul 2020 20:04:06 +0200

Philipp Stephani <[email-masked]> writes:

Hi Philipp,

>> Thanks for the analysis. However, I fail to see where Tramp fires the
>> command 'kill -17 $$'. There's only 'kill -2 $$'. Could you, please, show me?
>
> `tramp-get-signal-strings' invokes "bash -c 'kill -NUM $$'" for all
> signal numbers, including 17. It excluded 19, assuming that's SIGSTOP,
> but that assumption doesn't hold on macOS (or FreeBSD, or any non-x86
> system, FWIW).

I see. `tramp-get-signal-strings' is problematic anyway, because it runs
locally, but shall serve the signal strings for the remote host. Maybe,
we shall assume standardized signal strings up to 15 only.

What happens, if you replace the function by (untested)

--8<---------------cut here---------------start------------->8---
(defun tramp-get-signal-strings ()
  "Strings to return by `process-file' in case of signals."
  ;; We use key nil for local connection properties.
  (with-tramp-connection-property nil "signal-strings"
    (let (result)
      (dotimes (i 128)
	(push
	 (if (and (< i 16)
		  (stringp shell-file-name) (executable-find shell-file-name))
	     (call-process
	      shell-file-name nil nil nil "-c" (format "kill -%d $$" i))
	   (format "Signal %d" i))
	 result))
      ;; Due to Bug#41287, we cannot add this to the `dotimes' clause.
      (reverse result))))
--8<---------------cut here---------------end--------------->8---

Best regards, Michael.