Subject: Re: bug#70544: 30.0.50; The primitive-function "call-process-region" returns "internal error" and causes high cpu usage on win10

From: Eli Zaretskii <[email-masked]>
Date: Wed, 24 Apr 2024 09:07:53 +0300

> From: leuven65 <[email-masked]>
> 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.