From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Paul Pogonyshev Newsgroups: gmane.emacs.bugs Subject: bug#56865: M-x find-dired fails with "Wrong type: processp, nil" Date: Wed, 10 Aug 2022 15:26:03 +0200 Message-ID: References: <87pmhjylv1.fsf@gnus.org> <875yjax4te.fsf@gnus.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000518e1905e5e2fe3f" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22765"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 56865@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Aug 10 15:55:56 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oLmBg-0005fW-0n for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 10 Aug 2022 15:55:56 +0200 Original-Received: from localhost ([::1]:42770 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oLmBe-0004VV-VT for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 10 Aug 2022 09:55:54 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56068) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oLlji-0000Mk-TS for bug-gnu-emacs@gnu.org; Wed, 10 Aug 2022 09:27:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57159) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oLlji-0005ky-Jv for bug-gnu-emacs@gnu.org; Wed, 10 Aug 2022 09:27:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oLlji-0003HE-DY for bug-gnu-emacs@gnu.org; Wed, 10 Aug 2022 09:27:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Paul Pogonyshev Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 10 Aug 2022 13:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56865 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 56865-submit@debbugs.gnu.org id=B56865.166013798512553 (code B ref 56865); Wed, 10 Aug 2022 13:27:02 +0000 Original-Received: (at 56865) by debbugs.gnu.org; 10 Aug 2022 13:26:25 +0000 Original-Received: from localhost ([127.0.0.1]:46907 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oLlj7-0003GO-13 for submit@debbugs.gnu.org; Wed, 10 Aug 2022 09:26:25 -0400 Original-Received: from mail-ej1-f47.google.com ([209.85.218.47]:36666) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oLlj5-0003G7-HJ for 56865@debbugs.gnu.org; Wed, 10 Aug 2022 09:26:23 -0400 Original-Received: by mail-ej1-f47.google.com with SMTP id m4so27722588ejr.3 for <56865@debbugs.gnu.org>; Wed, 10 Aug 2022 06:26:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=I7sxRvzTzRCAHgpXne6GWwAdUJl3bO4o/gCElLJphzE=; b=CsQd3/meJZcP7CEWIi7nwCSA4NuWhDJNqviyFeEu63ZNOQ/xyWQoCVz8NxwnN6a405 2VBxHZ6AZ92DP3RBolRdNh8wqRpcd4ZKkY1mKPDbTlBEmv32TAo+eh4unvPR2Wt/3UvD XnsSwktpXh9Uu7625D5sVZy5WBBy764Wlkd7xFmWkjPrncDk9YIftFcDx7+HadKnxcy5 3CKWK6gukoQ6G/h6o+zeuznp4wWAhxLuqzZ64LixBG7kq6wCTFXmALGq4L570bXDC3mB SaT9gDYlqjmd3jgxxoEy8FNg4GQKJ7PtupLanSzEMhYBxOemiVwdlErqNoBAnMPJ4e4U e6OQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=I7sxRvzTzRCAHgpXne6GWwAdUJl3bO4o/gCElLJphzE=; b=411aBQ+4fctt+DamnXETJPhlVPgS+isiecmf1YVIZE6GB3Mpr48Y6n/T8B3Ll1bV3u RsF4xAFxjSVJlB7y0ZeUea5PFeJOIWSuBwtS3SPbKCJmuTkyPO2+4eA+BI6O7fcG2+G0 S3pahihKqjk3ik5db76w37LLh0AoesEZi9k5OLYOg7rQIVy6FVJzay1m2nvc9fgBoTK4 paJzHf2jTLtbvJVT7Jw/VrCdI65zYsyY2JBYSbzUf2djnHiONZo7a5pYUq3ew14PxNIl 7hi14jfCN1yPSW0leq8V3J+V9MCFPA0AGcbcLBBBTMdZZhZlqpbLwRR3IB9EH5fehGA8 19mg== X-Gm-Message-State: ACgBeo2ozYgQ3WdK4gXRs3Gyb5ipFenBVEevGcO69R6nB8uPwI5xsHu9 M7fQTA8rb3Ui+t8azp8We56VZxFjTYaE1WTTlA== X-Google-Smtp-Source: AA6agR4XDFA5Gz3a+6OBOSaZB6bIlmxFY0QdnjGhPnNXeXFxmSAbVog5dgyLFE9N2UCnreclSgrjZTXdSRCnhbYw6B4= X-Received: by 2002:a17:906:93e8:b0:730:9e5c:b45a with SMTP id yl8-20020a17090693e800b007309e5cb45amr19433581ejb.530.1660137975679; Wed, 10 Aug 2022 06:26:15 -0700 (PDT) In-Reply-To: <875yjax4te.fsf@gnus.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:239297 Archived-At: --000000000000518e1905e5e2fe3f Content-Type: text/plain; charset="UTF-8" Actually no, it doesn't help in all cases. It got better, but sometimes still dies with the same error: Debugger entered--Lisp error: (wrong-type-argument processp nil) process-mark(nil) (move-marker (process-mark proc) (point) (current-buffer)) (let ((proc (get-buffer-process (current-buffer)))) (message "@ %S %S" (current-buffer) proc) (move-marker (process-mark proc) (point) (current-buffer)) (set-process-filter proc #'find-dired-filter) (set-process-sentinel proc #'find-dired-sentinel)) ... For debugging I also added this line: (shell-command (concat command "&") (current-buffer)) (let ((proc (get-buffer-process (current-buffer)))) + (message "@ %S %S" (current-buffer) proc) ;; Initialize the process marker; it is used by the filter. (move-marker (process-mark proc) (point) (current-buffer)) ;; <-- dies here Here is the resut in buffer *Messages*: @ # nil So, the process can be nil immediately after `shell-command' returns too. Paul On Tue, 2 Aug 2022 at 13:28, Lars Ingebrigtsen wrote: > Paul Pogonyshev writes: > > > Seems so. I guess with the way Elisp works it is even correct, because > > (as I understand) Elisp has no way to notice that process has died if > > there are no IO calls between `shell-process' and `set-process-*'. > > Yes, but I'm not quite sure that's actually the case in all > circumstances (especially when Tramp is involved)... > > > But it does feel dirty. (Also that `(sit-for 1)' a few lines above > > feels dirty.) > > Yeah, much of the code in find-dired.el looks pretty fragile. > > But I guess this works now, so I'm closing this bug report. > > --000000000000518e1905e5e2fe3f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Actually no, it doesn't help in all cases. It got bett= er, but sometimes still dies with the same error:

Debugg= er entered--Lisp error: (wrong-type-argument processp nil)
=C2=A0 proces= s-mark(nil)
=C2=A0 (move-marker (process-mark proc) (point) (current-buf= fer))
=C2=A0 (let ((proc (get-buffer-process (current-buffer)))) (messag= e "@ %S %S" (current-buffer) proc) (move-marker (process-mark pro= c) (point) (current-buffer)) (set-process-filter proc #'find-dired-filt= er) (set-process-sentinel proc #'find-dired-sentinel))
= =C2=A0 ...

For debugging I also added this line:

=C2=A0 =C2=A0 =C2=A0(shell-command (concat command = "&") (current-buffer))
=C2=A0 =C2=A0 =C2=A0(let ((proc (ge= t-buffer-process (current-buffer))))
=C2=A0+=C2=A0 =C2=A0 =C2=A0(message= "@ %S %S" (current-buffer) proc)
=C2=A0 =C2=A0 =C2= =A0 =C2=A0;; Initialize the process marker; it is used by the filter.
=C2=A0 =C2=A0 =C2=A0 =C2=A0(move-marker (process-mark proc) (point= ) (current-buffer))=C2=A0 ;; <-- dies here

= Here is the resut in buffer *Messages*:

@ #<buf= fer *Find*> nil

So, the process can be nil = immediately after `shell-command' returns too.

Paul


--000000000000518e1905e5e2fe3f--