GNU bug report logs - #70544
30.0.50; The primitive-function "call-process-region" returns "internal error" and causes high cpu usage on win10

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: leuven65 <leuven65@HIDDEN>; Keywords: moreinfo; dated Wed, 24 Apr 2024 01:52:13 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Added tag(s) moreinfo. Request was from Eli Zaretskii <eliz@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 70544 <at> debbugs.gnu.org:


Received: (at 70544) by debbugs.gnu.org; 9 May 2024 07:16:50 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu May 09 03:16:50 2024
Received: from localhost ([127.0.0.1]:53535 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s4y1J-00071c-K0
	for submit <at> debbugs.gnu.org; Thu, 09 May 2024 03:16:49 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:39962)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>)
 id 1s4y1F-00071T-Op; Thu, 09 May 2024 03:16:48 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1s4y0k-0004mS-7u; Thu, 09 May 2024 03:16:14 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=QF6tP5LrzECtWKZCwKb+JqjbTsqo8fQlhzeWday9gi0=; b=jKLNa6dypHFT
 bwAo4Mo5N2pIYeEJga4RU/Tv0FxXIirl3ompmk7y+vF815zYKAH6ZwFb5uffoGbxfxxLcqD+e/MgJ
 cEfEtGS78TSVUsXj4SEloWuKPLuzadwgqD7K26JrA+SpNRAZQJfl5BtG9P5sMJd78hY190wPgC3W1
 zjZMJr9iwzPYcwuWrq/DfQqOB6fWAOhppFyfXZx0L871v7t2rrTDp825AcPrd1Lf4MTffaRVlpCZt
 B18ifiXcY0CcUrnbCgC/WOLopdMcWtueF+k9Nw/xXSOV+RG98QQ4IgAEn7IXHP3ISZcoa6jbvOb6v
 DTZbWn+5Z20zXQwZWzrtZA==;
Date: Thu, 09 May 2024 10:16:12 +0300
Message-Id: <867cg38ngj.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: leuven65@HIDDEN
In-Reply-To: <86r0ev2mms.fsf@HIDDEN> (message from Eli Zaretskii on Wed, 24
 Apr 2024 11:25:15 +0300)
Subject: Re: bug#70544: 30.0.50;
 The primitive-function "call-process-region" returns "internal error"
 and causes high cpu usage on win10
References: <CAGAaD=xd=V8TGUmQv2E4iAsPVA8zmF=gaLe4JgSAi2-nibCjwQ@HIDDEN>
 <86zftj2szq.fsf@HIDDEN>
 <CAGAaD=w=c86zbGTqzrx5-=wn3wmNERHQr_10idy955h6cVa-+A@HIDDEN>
 <86r0ev2mms.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 70544
Cc: 70544 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

tags 70544 moreinfo
thanks

Ping!  Can anyone reproduce this and/or tell more about what gitk.exe
wants and why it fails?

If no additional information emerges in a two-weeks time, I will close
this bug due to lack of sufficient information.

> Cc: 70544 <at> debbugs.gnu.org
> Date: Wed, 24 Apr 2024 11:25:15 +0300
> From: Eli Zaretskii <eliz@HIDDEN>
> 
> > From: leuven65 <leuven65@HIDDEN>
> > Date: Wed, 24 Apr 2024 10:12:10 +0200
> > Cc: 70544 <at> debbugs.gnu.org
> > 
> > I use the latest version
> > "[[https://github.com/git-for-windows/git/releases/tag/v2.44.0.windows.1]]",
> > in which "a couple of bugs that could cause Git Bash to hang in
> > certain scenarios were fixed", it might cause the exit behavior of
> > "gitk.exe" changed.
> > 
> > The program gitk is "${git-installation-folder}/cmd/gitk.exe".
> > 
> > The issue only pops up when I set "(setq-default shell-file-name "cmdproxy.exe")", if set to "bash.exe", no such
> > problem.
> 
> Maybe this gitk was supposed to be invoked only from the MSYS Bash?
> If so, this is not really a problem with Emacs.
> 
> > When the issue happens, emacs is not blocked, I can smoothly input
> > in emacs, but the cpu usage of emacs is very high forever. As I
> > built emacs without debug information, what I can see so far is that
> > most of time seems to be spent on "MsgWaitForMultipleObjects".
> > 
> > I use "shell-command" (M-!) to run "gitk.exe", the correct behavior is to run "gitk" and block emacs, or exit with
> > error, in my case, it prints out error "(Shell command killed by signal internal error)" and cpu usage goes up.
> 
> I guess these all are related to the fact that gitk is not a console
> problem, but a GUI problem, and therefore should not be invoked from
> shell-command, at least not safely.  It was probably meant to be
> invoked from a shell directly, and perhaps specifically from the MSYS
> Bash which comes with Git for Windows.
> 
> Bottom line: I'm not convinced this is an Emacs problem, and I still
> don't understand why you gitk from Emacs in this manner.
> 
> In any case, to do anything with this problem, we need either a way to
> reproduce it on the system of one of our developers, or a detailed
> information regarding the reasons why Emacs is spinning calling
> MsgWaitForMultipleObjects.
> 
> 
> 
> 




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#70544; Package emacs. Full text available.

Message received at 70544 <at> debbugs.gnu.org:


Received: (at 70544) by debbugs.gnu.org; 24 Apr 2024 08:25:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Apr 24 04:25:58 2024
Received: from localhost ([127.0.0.1]:57217 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rzXwy-0000qs-KW
	for submit <at> debbugs.gnu.org; Wed, 24 Apr 2024 04:25:58 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:53390)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1rzXws-0000oX-6e
 for 70544 <at> debbugs.gnu.org; Wed, 24 Apr 2024 04:25:54 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1rzXwV-0008FQ-3H; Wed, 24 Apr 2024 04:25:27 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=+sNFt9AT/RCbzM0ocNLtLiUHQx8an8o4yJhHUnfB5mk=; b=gMNvXMN/BdBS
 HyMGj3COSpzPGesOz3+1bdGISO7zWwXRJiwAab7y1HLwU4Cpy8J4AjKW5Z+RuNVoGn/ryuV9kj8iO
 2iwu8p/hVCv0/3tK2IRZ56cnz6KRov3ztqm6IHyewXvPRjUMrKRNTgUYO3YPBWiL5kdR14Qlw8E4g
 sGRu4IWg5asyCEdbTPl++wQpoMG4QjjhaqJmhKAwegrW2/nIZx8dYxqM/f2GOmGrAl6HCb/Ov1c5N
 dFlfWS7wMSsIh3MduZ3Eqfzyln+IIOt/JTOLTbSJaC1Z8CFXNgsHsbpaxSedd2A9wOEIGY46tVHpn
 I0Pl+Nsu8bFcF6pJ818VCA==;
Date: Wed, 24 Apr 2024 11:25:15 +0300
Message-Id: <86r0ev2mms.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: leuven65 <leuven65@HIDDEN>
In-Reply-To: <CAGAaD=w=c86zbGTqzrx5-=wn3wmNERHQr_10idy955h6cVa-+A@HIDDEN>
 (message from leuven65 on Wed, 24 Apr 2024 10:12:10 +0200)
Subject: Re: bug#70544: 30.0.50; The primitive-function "call-process-region"
 returns "internal error" and causes high cpu usage on win10
References: <CAGAaD=xd=V8TGUmQv2E4iAsPVA8zmF=gaLe4JgSAi2-nibCjwQ@HIDDEN>
 <86zftj2szq.fsf@HIDDEN>
 <CAGAaD=w=c86zbGTqzrx5-=wn3wmNERHQr_10idy955h6cVa-+A@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 70544
Cc: 70544 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: leuven65 <leuven65@HIDDEN>
> Date: Wed, 24 Apr 2024 10:12:10 +0200
> Cc: 70544 <at> debbugs.gnu.org
> 
> I use the latest version
> "[[https://github.com/git-for-windows/git/releases/tag/v2.44.0.windows.1]]",
> in which "a couple of bugs that could cause Git Bash to hang in
> certain scenarios were fixed", it might cause the exit behavior of
> "gitk.exe" changed.
> 
> The program gitk is "${git-installation-folder}/cmd/gitk.exe".
> 
> The issue only pops up when I set "(setq-default shell-file-name "cmdproxy.exe")", if set to "bash.exe", no such
> problem.

Maybe this gitk was supposed to be invoked only from the MSYS Bash?
If so, this is not really a problem with Emacs.

> When the issue happens, emacs is not blocked, I can smoothly input
> in emacs, but the cpu usage of emacs is very high forever. As I
> built emacs without debug information, what I can see so far is that
> most of time seems to be spent on "MsgWaitForMultipleObjects".
> 
> I use "shell-command" (M-!) to run "gitk.exe", the correct behavior is to run "gitk" and block emacs, or exit with
> error, in my case, it prints out error "(Shell command killed by signal internal error)" and cpu usage goes up.

I guess these all are related to the fact that gitk is not a console
problem, but a GUI problem, and therefore should not be invoked from
shell-command, at least not safely.  It was probably meant to be
invoked from a shell directly, and perhaps specifically from the MSYS
Bash which comes with Git for Windows.

Bottom line: I'm not convinced this is an Emacs problem, and I still
don't understand why you gitk from Emacs in this manner.

In any case, to do anything with this problem, we need either a way to
reproduce it on the system of one of our developers, or a detailed
information regarding the reasons why Emacs is spinning calling
MsgWaitForMultipleObjects.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#70544; Package emacs. Full text available.

Message received at 70544 <at> debbugs.gnu.org:


Received: (at 70544) by debbugs.gnu.org; 24 Apr 2024 08:12:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Apr 24 04:12:52 2024
Received: from localhost ([127.0.0.1]:57164 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rzXkI-0007Bf-Ez
	for submit <at> debbugs.gnu.org; Wed, 24 Apr 2024 04:12:52 -0400
Received: from mail-oa1-x34.google.com ([2001:4860:4864:20::34]:49263)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <leuven65@HIDDEN>) id 1rzXkC-0007A7-IX
 for 70544 <at> debbugs.gnu.org; Wed, 24 Apr 2024 04:12:48 -0400
Received: by mail-oa1-x34.google.com with SMTP id
 586e51a60fabf-2348a5d1584so2744725fac.2
 for <70544 <at> debbugs.gnu.org>; Wed, 24 Apr 2024 01:12:27 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1713946341; x=1714551141; darn=debbugs.gnu.org;
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:from:to:cc:subject:date:message-id:reply-to;
 bh=o6gK10eK5An0BlkIJaR0hwH7uakRAxHVxkNl/+iqCCM=;
 b=aZH48WDBxO5OocciEFRgxsUfoA1gmUv8YyS0j0xJB702Ru/pEfQbXK5GEDXPYPFG6f
 i17BssEDmq5BxBFgOWiEE76ZibjCdIW8+B3ITUqCmFj4HN3pPqifCYh4iqD9DlX3tqov
 T+BaBh8LP9ahsiPDJySAIDwc8Xl1rpwmtyrsezAHbz1lciHEXyNeb4+jiRFO+GiagvRn
 RCL6ecOzDGwPPQiQU8nKNf+RfGcdAcwJJ/WylrxDBcfSB5e9yLB+Zs3hMHsYsxBkFg1D
 KlKt6rgVzyyHNsbNBYCIc7GYQ+FOY1fH2ZeSEFb7NWeaYpMCa8SQ3VdUjUhkoh4RNTon
 k5sQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1713946341; x=1714551141;
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=o6gK10eK5An0BlkIJaR0hwH7uakRAxHVxkNl/+iqCCM=;
 b=eHby5G5lbh4B95oyGEfQbp0xre69mZ0YrexSrJQ4kiv3Kl4EmbAg4g8yK58Y4H5fE2
 v/I8AU4Rm30fL0kelZZF+OBtpcEB+A1Yfepn5+Wv3fiTE/ZUr/DLaI03aaiP/Er/dXjs
 m7UAWHg0pUSRqUTqsJC0ixKGx3495gZ23Psn0zdWqVJjIAyBcj5qFK9qYXNMX2fchRW3
 gCYQoLG/4ddaYWlqVidMeQf42y+GboPbsQkWjjxNelXt26tREOUmxRIeN0wyYcBm/TVk
 gy/YVzDCYSQNMXcoki114i1cwr5YsyaQuh8kiZD5Zov+PXSr2Z1JFrV0vqJqLsf2bK0L
 CtEw==
X-Gm-Message-State: AOJu0YzAu9VS8NNXsvviBogolAHvc0Ddyeys/sTQwZoCzRtKnt3QpQfD
 sZdVJDKuTBdyQyTOYyDa+rJxEDPfrzpGOAly0ZUNfV6W9d5OP52HwmwBCJrANd87tWS8PSZnKGO
 2hEd6pdFexhKprQUGlRfqeB25Fpg=
X-Google-Smtp-Source: AGHT+IHcu4DXiLeC18OoOxYdLwZIDy0EUulGo9NRIMx503WGJVLZGX0u+ROaT/DTjqwMOFesTHM820h3Hr58JnwcGDc=
X-Received: by 2002:a05:6870:b418:b0:221:1c2f:23ee with SMTP id
 x24-20020a056870b41800b002211c2f23eemr1845435oap.22.1713946341197; Wed, 24
 Apr 2024 01:12:21 -0700 (PDT)
MIME-Version: 1.0
References: <CAGAaD=xd=V8TGUmQv2E4iAsPVA8zmF=gaLe4JgSAi2-nibCjwQ@HIDDEN>
 <86zftj2szq.fsf@HIDDEN>
In-Reply-To: <86zftj2szq.fsf@HIDDEN>
From: leuven65 <leuven65@HIDDEN>
Date: Wed, 24 Apr 2024 10:12:10 +0200
Message-ID: <CAGAaD=w=c86zbGTqzrx5-=wn3wmNERHQr_10idy955h6cVa-+A@HIDDEN>
Subject: Re: bug#70544: 30.0.50; The primitive-function "call-process-region"
 returns "internal error" and causes high cpu usage on win10
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: multipart/alternative; boundary="000000000000d4d1460616d33a60"
X-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: 70544
Cc: 70544 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

--000000000000d4d1460616d33a60
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

I use the latest version "[[
https://github.com/git-for-windows/git/releases/tag/v2.44.0.windows.1]]",
in which "a couple of
bugs that could cause Git Bash to hang in certain scenarios were fixed", it
might cause the exit behavior of "gitk.exe"
changed.

The program gitk is "${git-installation-folder}/cmd/gitk.exe".

The issue only pops up when I set "(setq-default shell-file-name
"cmdproxy.exe")", if set to "bash.exe", no such
problem.

When the issue happens, emacs is not blocked, I can smoothly input in
emacs, but the cpu usage of emacs is very high
forever. As I built emacs without debug information, what I can see so far
is that most of time seems to be spent on
"MsgWaitForMultipleObjects".

I use "shell-command" (M-!) to run "gitk.exe", the correct behavior is to
run "gitk" and block emacs, or exit with
error, in my case, it prints out error "(Shell command killed by signal
internal error)" and cpu usage goes up.

From the call stack, "shell-command" calls "call-process-region":
#+begin_quote
Debugger entered--entering a function:
,* call-process-region(324 324 "cmdproxy.exe" nil #<buffer *Shell Command
Output*> nil "-c" "gitk.exe")
  apply(call-process-region 324 324 "cmdproxy.exe" (nil #<buffer *Shell
Command Output*> nil "-c" "gitk.exe"))
  call-shell-region(324 324 "gitk.exe" nil #<buffer *Shell Command Output*>=
)
  shell-command-on-region(324 324 "gitk.exe" nil nil nil)
  shell-command("gitk.exe" nil nil)
  funcall-interactively(shell-command "gitk.exe" nil nil)
  command-execute(shell-command)
#+end_quote

On Wed, Apr 24, 2024 at 8:07=E2=80=AFAM Eli Zaretskii <eliz@HIDDEN> wrote:

> > From: leuven65 <leuven65@HIDDEN>
> > Date: Tue, 23 Apr 2024 20:02:39 +0200
> >
> > On windows10, I uses git for windows, but when I execute "gitk" by
> "shell-command"
> > in emacs, it returns an error "internal error",
> > and emacs's cpu usage becomes full forever, except for restarting emacs=
,
>
> I cannot reproduce this.  But my Git for Windows is quite old, so
> maybe newer versions made some change?  What is gitk on your machine?
> Is it a gitk.exe program or some kind of script?
>
> > The issue can be easily reproduced by directly eval following sexp:
> >
> > (call-process-region (point-min) (point-max)
> >                      "cmdproxy.exe"
> >                      t
> >                      t
> >                      nil
> >                      "-c"
> >                      "gitk")
>
> gitk is a GUI program, so why are you invoking it with
> call-process-region?  gitk will never read anything from its stdin or
> write anything to its stdout.  I suggest to invoke gitk from Emacs
> like this:
>
>   M-! gitk & RET
>
> IOW, add the "&" character at the end of the command line to make the
> invocation asynchronous, instead of letting Emacs block until gitk
> exits.
>

--000000000000d4d1460616d33a60
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr">I use the latest version &quot;[[<a href=
=3D"https://github.com/git-for-windows/git/releases/tag/v2.44.0.windows.1]"=
>https://github.com/git-for-windows/git/releases/tag/v2.44.0.windows.1]</a>=
]&quot;, in which &quot;a couple of<br>bugs that could cause Git Bash to ha=
ng in certain scenarios were fixed&quot;, it might cause the exit behavior =
of &quot;gitk.exe&quot;<br>changed.<br><br>The program gitk is &quot;${git-=
installation-folder}/cmd/gitk.exe&quot;.<br><br>The issue only pops up when=
 I set &quot;(setq-default shell-file-name &quot;cmdproxy.exe&quot;)&quot;,=
 if set to &quot;bash.exe&quot;, no such<br>problem.<br><br>When the issue =
happens, emacs is not blocked, I can smoothly input in emacs, but the cpu u=
sage of emacs is very high<br>forever. As I built emacs without debug infor=
mation, what I can see so far is that most of time seems to be spent on<br>=
&quot;MsgWaitForMultipleObjects&quot;.<br><br>I use &quot;shell-command&quo=
t; (M-!) to run &quot;gitk.exe&quot;, the correct behavior is to run &quot;=
gitk&quot; and block emacs, or exit with<br>error, in my case, it prints ou=
t error &quot;(Shell command killed by signal internal error)&quot; and cpu=
 usage goes up.<br><br>From the call stack, &quot;shell-command&quot; calls=
 &quot;call-process-region&quot;:<br>#+begin_quote<br>Debugger entered--ent=
ering a function:<br>,* call-process-region(324 324 &quot;cmdproxy.exe&quot=
; nil #&lt;buffer *Shell Command Output*&gt; nil &quot;-c&quot; &quot;gitk.=
exe&quot;)<br>=C2=A0 apply(call-process-region 324 324 &quot;cmdproxy.exe&q=
uot; (nil #&lt;buffer *Shell Command Output*&gt; nil &quot;-c&quot; &quot;g=
itk.exe&quot;))<br>=C2=A0 call-shell-region(324 324 &quot;gitk.exe&quot; ni=
l #&lt;buffer *Shell Command Output*&gt;)<br>=C2=A0 shell-command-on-region=
(324 324 &quot;gitk.exe&quot; nil nil nil)<br>=C2=A0 shell-command(&quot;gi=
tk.exe&quot; nil nil)<br>=C2=A0 funcall-interactively(shell-command &quot;g=
itk.exe&quot; nil nil)<br>=C2=A0 command-execute(shell-command)<br>#+end_qu=
ote<br></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail=
_attr">On Wed, Apr 24, 2024 at 8:07=E2=80=AFAM Eli Zaretskii &lt;<a href=3D=
"mailto:eliz@HIDDEN">eliz@HIDDEN</a>&gt; wrote:<br></div><blockquote clas=
s=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid r=
gb(204,204,204);padding-left:1ex">&gt; From: leuven65 &lt;<a href=3D"mailto=
:leuven65@HIDDEN" target=3D"_blank">leuven65@HIDDEN</a>&gt;<br>
&gt; Date: Tue, 23 Apr 2024 20:02:39 +0200<br>
&gt; <br>
&gt; On windows10, I uses git for windows, but when I execute &quot;gitk&qu=
ot; by &quot;shell-command&quot; <br>
&gt; in emacs, it returns an error &quot;internal error&quot;, <br>
&gt; and emacs&#39;s cpu usage becomes full forever, except for restarting =
emacs,<br>
<br>
I cannot reproduce this.=C2=A0 But my Git for Windows is quite old, so<br>
maybe newer versions made some change?=C2=A0 What is gitk on your machine?<=
br>
Is it a gitk.exe program or some kind of script?<br>
<br>
&gt; The issue can be easily reproduced by directly eval following sexp:<br=
>
&gt; <br>
&gt; (call-process-region (point-min) (point-max)<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 &quot;cmdproxy.exe&quot;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 t<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 t<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 nil<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 &quot;-c&quot;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 &quot;gitk&quot;)<br>
<br>
gitk is a GUI program, so why are you invoking it with<br>
call-process-region?=C2=A0 gitk will never read anything from its stdin or<=
br>
write anything to its stdout.=C2=A0 I suggest to invoke gitk from Emacs<br>
like this:<br>
<br>
=C2=A0 M-! gitk &amp; RET<br>
<br>
IOW, add the &quot;&amp;&quot; character at the end of the command line to =
make the<br>
invocation asynchronous, instead of letting Emacs block until gitk<br>
exits.<br>
</blockquote></div></div>

--000000000000d4d1460616d33a60--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#70544; Package emacs. Full text available.

Message received at 70544 <at> debbugs.gnu.org:


Received: (at 70544) by debbugs.gnu.org; 24 Apr 2024 06:08:50 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Apr 24 02:08:48 2024
Received: from localhost ([127.0.0.1]:56641 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rzVo4-00052U-GA
	for submit <at> debbugs.gnu.org; Wed, 24 Apr 2024 02:08:47 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:37758)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1rzVnm-0004yq-PE
 for 70544 <at> debbugs.gnu.org; Wed, 24 Apr 2024 02:08:29 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1rzVnQ-0001E8-Bu; Wed, 24 Apr 2024 02:07:56 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=D2bEbLKUUf7SxXIFMTgQR84xbwxedML+IfhU49G4TO4=; b=roq/1OKql5p4
 bjwx3tM2NwQ2tyaGPi6wJb2+pGXhUEP/vc88IN8+otCfZgvBlXDQ7mfm0y5WNgqApNnQrXKx+L9Dw
 aJA+CJrwOMKa9xXSpJFymMZWrtoObjN1/2U3H4P3m6GISps7Bc8abx+8UI1o508z1b2G1jdWhn/po
 bmXLCwy2NzKScVnoEVUAFfEyf19vP5mP1wefeJhS2u2U2kj7X5p9ziD5TSi4bDifUJ6xUfyxGq5JF
 mBIkfN+x13bLVDJNhuw1ikmKSaJI4ba1qp5TCU4RZ2WSrhCGYuTDj8HMDb1wCeEXheqXBdDJSmZGE
 R2QvnSDpf/CZ/D1bQpdhAw==;
Date: Wed, 24 Apr 2024 09:07:53 +0300
Message-Id: <86zftj2szq.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: leuven65 <leuven65@HIDDEN>
In-Reply-To: <CAGAaD=xd=V8TGUmQv2E4iAsPVA8zmF=gaLe4JgSAi2-nibCjwQ@HIDDEN>
 (message from leuven65 on Tue, 23 Apr 2024 20:02:39 +0200)
Subject: Re: bug#70544: 30.0.50;
 The primitive-function "call-process-region" returns "internal error"
 and causes high cpu usage on win10
References: <CAGAaD=xd=V8TGUmQv2E4iAsPVA8zmF=gaLe4JgSAi2-nibCjwQ@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 70544
Cc: 70544 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: leuven65 <leuven65@HIDDEN>
> Date: Tue, 23 Apr 2024 20:02:39 +0200
> 
> On windows10, I uses git for windows, but when I execute "gitk" by "shell-command" 
> in emacs, it returns an error "internal error", 
> and emacs's cpu usage becomes full forever, except for restarting emacs,

I cannot reproduce this.  But my Git for Windows is quite old, so
maybe newer versions made some change?  What is gitk on your machine?
Is it a gitk.exe program or some kind of script?

> The issue can be easily reproduced by directly eval following sexp:
> 
> (call-process-region (point-min) (point-max)
>                      "cmdproxy.exe"
>                      t
>                      t
>                      nil
>                      "-c"
>                      "gitk")

gitk is a GUI program, so why are you invoking it with
call-process-region?  gitk will never read anything from its stdin or
write anything to its stdout.  I suggest to invoke gitk from Emacs
like this:

  M-! gitk & RET

IOW, add the "&" character at the end of the command line to make the
invocation asynchronous, instead of letting Emacs block until gitk
exits.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#70544; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 24 Apr 2024 01:51:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 23 21:51:10 2024
Received: from localhost ([127.0.0.1]:55533 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rzRms-0005Ru-3N
	for submit <at> debbugs.gnu.org; Tue, 23 Apr 2024 21:51:09 -0400
Received: from lists.gnu.org ([2001:470:142::17]:53462)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <leuven65@HIDDEN>) id 1rzKU4-0001HL-UQ
 for submit <at> debbugs.gnu.org; Tue, 23 Apr 2024 14:03:15 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <leuven65@HIDDEN>)
 id 1rzKTi-0000Aw-Mc
 for bug-gnu-emacs@HIDDEN; Tue, 23 Apr 2024 14:02:50 -0400
Received: from mail-oi1-x22a.google.com ([2607:f8b0:4864:20::22a])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <leuven65@HIDDEN>)
 id 1rzKTh-0000is-52
 for bug-gnu-emacs@HIDDEN; Tue, 23 Apr 2024 14:02:50 -0400
Received: by mail-oi1-x22a.google.com with SMTP id
 5614622812f47-3c74b643aebso2669697b6e.0
 for <bug-gnu-emacs@HIDDEN>; Tue, 23 Apr 2024 11:02:48 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1713895367; x=1714500167; darn=gnu.org;
 h=to:subject:message-id:date:from:mime-version:from:to:cc:subject
 :date:message-id:reply-to;
 bh=qUvJAd2mSY8YYa9c616rS+w15+L6GT8tXPMnSwV/dHc=;
 b=Xevy/zAIk14gldTed5OlSSvZzXZOtdcCnTZlv5FR1+XietsMx/mVOyMSX70Qi7qsDE
 9seITt/RzD/EpMaucrakC/kdSWxXGgte59ECs5Ok/wNU++S5Muir6Me7wRYIK2N1m1YX
 ki6+g0HXrFQYsPeAqwjkOsT5M9Tt5Vxdhx8ZOoiDPWdez6XNwxYY+FzecZhNgPJnEOw3
 DSalzdb5G2k70RnZIhd/BwUi7gyx80aWO1e9A6GsXRMAWwpcEzg7shODQY4wjcRhv+95
 Lxsr+6QD2E4jX8pSQQDDhhx6ulLuHZ91MWwDHUjmethzg/AcaCTh0qhUV2c6U1DGqV+X
 3LEw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1713895367; x=1714500167;
 h=to:subject:message-id:date:from:mime-version:x-gm-message-state
 :from:to:cc:subject:date:message-id:reply-to;
 bh=qUvJAd2mSY8YYa9c616rS+w15+L6GT8tXPMnSwV/dHc=;
 b=xRm0GMa6ghHojHOT2P0vjwRweeHxoXlvd9GIKg7H90AtVzXOC5RhIhfTaOBnD5anvX
 DX+0ih8Zf1omcI8OQZPxBqeNnXl23/6QpKu2K3uxq13DLucdbv+zxscahIJFo/rjrnrb
 AEsZ2mXFQDOGi6V/1RFrr9lbNzQYqGZVaHIt/MwPRNfGNnC3UuQYpp/4BQz+/HOgKKpe
 faN2gYhmkZ/U6T9EUh8r3k1QBT0dXfXua+oBrw6q0mVbF8aoq+8FJv+s/tihN8XFAQxb
 iLcQIlBDoAiHA/La0hK+ugHgRLTv/gvAfINJdj9spnz9eD4Uw+5jhaS/cdreZIk3Yt1n
 XVsg==
X-Gm-Message-State: AOJu0YwOGsG/dnWOAI0dHTNiFltAx2pjacn0sp94hj58DzDtXIXJWQy4
 ajxtBxvkwmsDh6aCAMJ62W5uJJ9RyZFVHQcY7AjL0fEdBGKCtpFZGjOIU4pGbqZYN5HO3jmKC6e
 sAF70U19c9NzUFZix7XPAQgMnXPAQ0EZb
X-Google-Smtp-Source: AGHT+IEWg71fvcd7Z9kLzKUYk3ArfrSy4O4wiHWHcR7X6EFZ+EnvIw+WRRJ2TJGGzyLI9a1VXCv+f340fDdUqmpVQvM=
X-Received: by 2002:aca:2114:0:b0:3c6:401:51b8 with SMTP id
 20-20020aca2114000000b003c6040151b8mr67583oiz.20.1713895367291; Tue, 23 Apr
 2024 11:02:47 -0700 (PDT)
MIME-Version: 1.0
From: leuven65 <leuven65@HIDDEN>
Date: Tue, 23 Apr 2024 20:02:39 +0200
Message-ID: <CAGAaD=xd=V8TGUmQv2E4iAsPVA8zmF=gaLe4JgSAi2-nibCjwQ@HIDDEN>
Subject: 30.0.50; The primitive-function "call-process-region" returns
 "internal error" and causes high cpu usage on win10
To: bug-gnu-emacs@HIDDEN
Content-Type: multipart/alternative; boundary="0000000000008cc3de0616c75cb6"
Received-SPF: pass client-ip=2607:f8b0:4864:20::22a;
 envelope-from=leuven65@HIDDEN; helo=mail-oi1-x22a.google.com
X-Spam_score_int: -17
X-Spam_score: -1.8
X-Spam_bar: -
X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 1.2 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview:  On windows10, I uses git for windows,
 but when I execute "gitk"
 by "shell-command" in emacs, it returns an error "internal error", and emacs's
 cpu usage becomes full forever, except for restarting ema [...] 
 Content analysis details:   (1.2 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
 provider (leuven65[at]gmail.com)
 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends
 in digit (leuven65[at]gmail.com)
 1.0 SPF_SOFTFAIL           SPF: sender does not match SPF record (softfail)
 -0.0 SPF_HELO_PASS          SPF: HELO matches SPF record
 0.0 HTML_MESSAGE           BODY: HTML included in message
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Tue, 23 Apr 2024 21:51:04 -0400
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.2 (/)

--0000000000008cc3de0616c75cb6
Content-Type: text/plain; charset="UTF-8"

On windows10, I uses git for windows, but when I execute "gitk" by
"shell-command"
in emacs, it returns an error "internal error",
and emacs's cpu usage becomes full forever, except for restarting emacs,
It seems emacs might process something wrong in this case.

The issue can be easily reproduced by directly eval following sexp:

(call-process-region (point-min) (point-max)
                     "cmdproxy.exe"
                     t
                     t
                     nil
                     "-c"
                     "gitk")

--0000000000008cc3de0616c75cb6
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: base64

PGRpdiBkaXI9Imx0ciI+T24gd2luZG93czEwLCBJIHVzZXMgZ2l0IGZvciB3aW5kb3dzLCBidXQg
d2hlbiBJIGV4ZWN1dGUgJnF1b3Q7Z2l0ayZxdW90OyBieSAmcXVvdDtzaGVsbC1jb21tYW5kJnF1
b3Q7wqA8ZGl2PmluIGVtYWNzLCBpdCByZXR1cm5zIGFuIGVycm9yICZxdW90O2ludGVybmFsIGVy
cm9yJnF1b3Q7LMKgPC9kaXY+PGRpdj5hbmQgZW1hY3MmIzM5O3MgY3B1IHVzYWdlIGJlY29tZXMg
ZnVsbCBmb3JldmVyLMKgZXhjZXB0IGZvciByZXN0YXJ0aW5nwqBlbWFjcyw8L2Rpdj48ZGl2Pkl0
IHNlZW1zIGVtYWNzwqBtaWdodCBwcm9jZXNzIHNvbWV0aGluZyB3cm9uZyBpbsKgdGhpcyBjYXNl
Ljxicj48YnI+VGhlIGlzc3VlIGNhbiBiZSBlYXNpbHkgcmVwcm9kdWNlZCBieSBkaXJlY3RseSBl
dmFsIGZvbGxvd2luZyBzZXhwOjxicj48YnI+KGNhbGwtcHJvY2Vzcy1yZWdpb24gKHBvaW50LW1p
bikgKHBvaW50LW1heCk8YnI+wqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAmcXVvdDtj
bWRwcm94eS5leGUmcXVvdDs8YnI+wqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqB0PGJy
PsKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgdDxicj7CoCDCoCDCoCDCoCDCoCDCoCDC
oCDCoCDCoCDCoCDCoG5pbDxicj7CoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCZxdW90
Oy1jJnF1b3Q7PGJyPsKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgJnF1b3Q7Z2l0ayZx
dW90Oyk8L2Rpdj48L2Rpdj4NCg==
--0000000000008cc3de0616c75cb6--




Acknowledgement sent to leuven65 <leuven65@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#70544; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Thu, 9 May 2024 07:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.