From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Maxim Nikulin Newsgroups: gmane.emacs.bugs Subject: bug#12972: [PATCH] Avoid regression in mailcap-view-file similar to Bug#44824 Date: Sun, 4 Jul 2021 20:37:24 +0700 Message-ID: References: <87r1hmdqek.fsf__16088.3597027109$1622530682$gmane$org@gnus.org> <835yxtlw14.fsf__2546.8955327355$1625164803$gmane$org@gnu.org> <1ddf1c46-0a28-4a2d-cc40-094ff74ee0ac@gmail.com> <837di8ki24.fsf__46278.4886871063$1625229533$gmane$org@gnu.org> <831r8gk4m0.fsf__14172.0669272885$1625246977$gmane$org@gnu.org> <1825a6f3-0175-2d67-5608-41c9fb93889b@gmail.com> <83im1ripaz.fsf__31901.4239286602$1625313464$gmane$org@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34529"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 To: 12972@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jul 04 15:38:12 2021 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 1m02K2-0008rR-VQ for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 04 Jul 2021 15:38:11 +0200 Original-Received: from localhost ([::1]:57492 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m02K1-0003ff-Uv for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 04 Jul 2021 09:38:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60856) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m02Ju-0003fQ-LY; Sun, 04 Jul 2021 09:38:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57267) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m02Ju-0007Ch-EI; Sun, 04 Jul 2021 09:38:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m02Ju-0003jT-81; Sun, 04 Jul 2021 09:38:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Maxim Nikulin Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, emacs-orgmode@gnu.org Resent-Date: Sun, 04 Jul 2021 13:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12972 X-GNU-PR-Package: emacs,org-mode X-GNU-PR-Keywords: patch Original-Received: via spool by 12972-submit@debbugs.gnu.org id=B12972.162540585514296 (code B ref 12972); Sun, 04 Jul 2021 13:38:02 +0000 Original-Received: (at 12972) by debbugs.gnu.org; 4 Jul 2021 13:37:35 +0000 Original-Received: from localhost ([127.0.0.1]:40579 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m02JT-0003iV-GG for submit@debbugs.gnu.org; Sun, 04 Jul 2021 09:37:35 -0400 Original-Received: from mail-lf1-f44.google.com ([209.85.167.44]:46706) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m02JR-0003iE-FI for 12972@debbugs.gnu.org; Sun, 04 Jul 2021 09:37:34 -0400 Original-Received: by mail-lf1-f44.google.com with SMTP id p21so5734244lfj.13 for <12972@debbugs.gnu.org>; Sun, 04 Jul 2021 06:37:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=4lhJWbT2hQqQ57kA8/RtQ7VgtHvbAxSlFzLMnifBD7A=; b=MObBeEecxhzwp29ie5Scd9j22kpK046wetw07bd8b6NUrhjdpcoG1KcRkbI92vqTew AJfJep1026m1BPUHrUymchFaFbuV5OeWIw++M+1E29U96Zj+LwWWsB2W8WUu1PHGvWWe Xv0glLOgQZzMurlqpxQw7Tsy/hAHoQONnsOIDACjRMh7lFTpeHuQGUHPb+0sTOfg47wG 6fVX9wp1Bs38O9EPB+EWeoaTWqgh01TeJN7BOVAde73p3mhdessp1vyj7M37vEN1Bty3 Nl98SK/MbO+FGV/s4lTm24QYPQPBBipHS+GwV/JdUjlY5Io+Kb0wv/ppKUOmIJdz06DL swOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=4lhJWbT2hQqQ57kA8/RtQ7VgtHvbAxSlFzLMnifBD7A=; b=Js+ohihqTAw4amIpsTruMV4QB0L8NDTIrokREQ97x39DeHxR4tbshwcift4fcV6pKU GYOx1dyIpn0J2rn80bb6NQNdtPKnKXT4W3qcnTzpWnPOUJQahOhtceIWahmqPmL2HsnJ V0mCowRxYTtXKVW+/7kOLkFcAkxQJQAFGD8dbLzjIjOGownsb/bcWC1Hl2CqLVximvVo OzOsU8m2RIP+HIpNfvMKvyE1vFcxS1Cm6SE7IB3xICZPVkR0mrxF0/xlTn1ViMDYogff QTGF4LzLdZpSPtL1D7lGLbyYcCdsbJcuzEdYmyqVp2D9b7Kkgns3DFbfGtIOn2PGu3bt fGCw== X-Gm-Message-State: AOAM533aqQnphnG6VUdJio8RHSIxvXYcxSIp49wFuoYeAFcxhBV1ukmj 5roNbG0SjjawsanFmOboOpMbiZgA+Ys= X-Google-Smtp-Source: ABdhPJyw9sW1FTtvU3YGaeVIpgpKoAThJQJt8xs1FFCjQQbvN9KNNeY/FHD2pp2AuOfB0BMFyeDghQ== X-Received: by 2002:ac2:58d9:: with SMTP id u25mr2570817lfo.49.1625405847071; Sun, 04 Jul 2021 06:37:27 -0700 (PDT) Original-Received: from [192.168.0.101] (nat-0-0.nsk.sibset.net. [5.44.169.188]) by smtp.googlemail.com with ESMTPSA id a2sm1097780ljp.117.2021.07.04.06.37.25 for <12972@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 04 Jul 2021 06:37:26 -0700 (PDT) In-Reply-To: <83im1ripaz.fsf__31901.4239286602$1625313464$gmane$org@gnu.org> Content-Language: en-US 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:209390 Archived-At: On 03/07/2021 18:56, Eli Zaretskii wrote: >> From: Maxim Nikulin Date: Sat, 3 Jul 2021 18:29:30 +0700 >> >> I am giving up with this issue. > > That's too bad. I see no reason to give up, and I urge you to > reconsider, please. Sorry, but the space of your assumptions and maybe confusions has too high number of dimension to realize what you actually mean and what you consider as a problem that should be fixed. So any further steps are impossible. > Your patch unconditionally assumes that every handler will immediately > exit, and that it doesn't care about the connection type with the > parent Emacs process, but that is not guaranteed to be true. There is no intention of such assumption and it *works* even for handlers that does not exit immediately. I admit that I wrongly added ":noquery t", for some reason I believed that it allows to choose whether processes are allowed to exist longer than emacs or it is preferred to kill them with emacs. Actually asynchronous processes are killed always and the option manages the query only. This option should be dropped to restore compatibility with previous variant. I have not found a way to detach asynchronous process from emacs. Surprisingly it is possible for synchronous processes but it is impossible to detect failure (thus to allow a user to figure out what has happened) (process-file-shell-command command nil 0 nil) So process API in emacs is a kind of a short blanket. Accidentally I have created an example of program that is incompatible with 'pipe asynchronous processes in emacs #!/bin/sh exec 1>&- exec 2>&- sleep 30 (let ((command "cpu-stress-test") (process-connection-type nil)) (start-process-shell-command command nil command)) And emacs (at least 26.3) consumes 100% CPU for the specified amount of time. I do not see any reason to do so since the program does not do anything ugly. I have not found a way to explicitly force emacs to close pipes. That is why I consider it as an outstanding bug. Emacs must properly handle closed pipes. So `process-file-shell-command' ... 0 is better than current `start-process-shell-command' but it does not allow to add error handling. So besides that I still have no guess what problem you suspect, now I know that emacs may become mad in response to purely innocent action of a child process.