From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 8DAOF++54WB/IwEAgWs5BA (envelope-from ) for ; Sun, 04 Jul 2021 15:38:55 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id MNHSEu+54WBfLAAA1q6Kng (envelope-from ) for ; Sun, 04 Jul 2021 13:38:55 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id B12192085E for ; Sun, 4 Jul 2021 15:38:54 +0200 (CEST) Received: from localhost ([::1]:57530 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m02Ki-0003h5-RZ for larch@yhetil.org; Sun, 04 Jul 2021 09:38:52 -0400 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 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 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 Subject: bug#12972: [PATCH] Avoid regression in mailcap-view-file similar to Bug#44824 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 To: 12972@debbugs.gnu.org Received: via spool by 12972-submit@debbugs.gnu.org id=B12972.162540585514296 (code B ref 12972); Sun, 04 Jul 2021 13:38:02 +0000 Received: (at 12972) by debbugs.gnu.org; 4 Jul 2021 13:37:35 +0000 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 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 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) 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) 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> From: Maxim Nikulin Message-ID: Date: Sun, 4 Jul 2021 20:37:24 +0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <83im1ripaz.fsf__31901.4239286602$1625313464$gmane$org@gnu.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: emacs-orgmode@gnu.org List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1625405935; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=4lhJWbT2hQqQ57kA8/RtQ7VgtHvbAxSlFzLMnifBD7A=; b=ZwW2Q+Y82k+0L54S4fE2qFEGz7VJHsFzF4syPHtVfKTzwFMKpFWcatBNL6jNAQZQ3E2Uo9 bgrxWk297uayrpYRvGbYQI7EHKC0Ltqr4vjd37Zof4Nvs/qGWDHZMTermNdf8c/gmObu/r Oxt6OtXSReSvk5f/EjHOzOFCGvkmo7tjb0+A9ju6ottOzBWhkHSc7TWkI4aUDcQcFni1d7 7RV75OMIlgT3/Q6LzF1P7P/UNTvbOubLUF/EW/T1rLBuZr1rePKmimXL0K0uQx2/J/MtvA pPalMyfqfMOy2BIG5cnZboMzw4kDuIp9gnXlP+hw00JjSaUolacH8XqZNMK4lw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1625405935; a=rsa-sha256; cv=none; b=HavcE69w3ieGrDZmeCTxgH2rsE4fYmpGPB3I7JkCb89HTwn68O+gXJFsmLiFNaLKirLCWm +T7F6DpP97FquSi3xvqMhS+5Do2aQiK0hvgWKhHG9F7jW324eLweKOS6iARqEknW/erIYV KcD6jDChe12WFTOUDLU/IMT/vDiS1LYSIad9PblNYEWOWrGWB+S3tOWC51pyFOQgUlr5nO pZquOVgqvoABxrdDnFfBsPAtLFh4RsfFQY1rFo2iFmOtEqEIEtadYIB/7bTXV2KmQl+c5F dP45r51kItx6rdKUrtT3xvq9IMQqmXTUZ8TW1ConQ0GQ8uNY4eC4gFLa2XEZAg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20161025 header.b=MObBeEec; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: 0.19 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20161025 header.b=MObBeEec; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: B12192085E X-Spam-Score: 0.19 X-Migadu-Scanner: scn1.migadu.com X-TUID: yeD7Ke63IWVO 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.