all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Phil Sainty <psainty@orcon.net.nz>
Cc: 75461@debbugs.gnu.org
Subject: bug#75461: 30.0.93; Frequent (but inconsistent) hangs when creating frames
Date: Thu, 09 Jan 2025 15:12:43 +0200	[thread overview]
Message-ID: <86zfk0167o.fsf@gnu.org> (raw)
In-Reply-To: <05bdbaa416fc63c8ee1d06ade53c2f60@webmail.orcon.net.nz> (message from Phil Sainty on Fri, 10 Jan 2025 01:09:20 +1300)

> Date: Fri, 10 Jan 2025 01:09:20 +1300
> From: Phil Sainty <psainty@orcon.net.nz>
> 
> I've recently switched my main instance of Emacs to 30.0 (firstly
> 30.0.93, and now the HEAD of the emacs-30 branch), and I've been
> experiencing frequent hangs (with the CPU core spinning at 100% usage)
> when creating new frames.
> 
> More specifically: when creating frames using a system I use with my
> window manager when I want to interactively select a thing in a pop-up
> Emacs frame.  (I've tried to replicate this with simply "C-x 5 2" but
> didn't manage to do so thus far.)
> 
> If I spam a terminal with a large number of "kill -USR2 <pid>" commands
> for the spinning Emacs process ID, then I'll get control back.
> 
> I'm experiencing this (inconsistently, but quite often) with using a
> keybinding for my window manager (XMonad), which runs a command like:
> 
>   emacsclient --eval "(my-x-paste-example $(xdotool getactivewindow))"
> 
> With that command being something like:
> 
>   (defun my-x-paste-example (wid)
>      (interactive)
>      (my-x-paste #'my-example wid "*Example*" "Testing"))
> 
>   (defun my-example ()
>     (interactive)
>     (gui-backend-set-selection
>      'CLIPBOARD (completing-read "Choose: " '(one two three))))
> 
> I've attached the definition of `my-x-paste' to this report.  It
> creates a small floating frame for the interaction, and afterwards it
> runs xdotool again to paste the clipboard contents into the X window
> obtained by "xdotool getactivewindow", but I think the xdotool aspect
> shouldn't be a factor, as it never gets that far -- Emacs creates the
> frame and then immediately hangs before I can interact with it at all.
> Perhaps the frame parameters used in that function are relevant,
> though.
> 
> I've recompiled Emacs for debugging and run it under gdb, and have
> reproduced a hang, so I have also attached some backtraces from gdb
> (more than one because they're variable).  In each case I used
> "kill -TSTP <PID>" to stop Emacs spinning and drop to the gdb prompt,
> and then the "backtrace" command.  I then had to "continue" multiple
> times before Emacs started running/spinning again, after which I
> repeated the process.
> 
> (I also tried "xbacktrace" but that just said "Undefined command:
> "xbacktrace".  Try "help".", and I'm afraid that I only just saw the
> "bt full" recommendation in the report-emacs-bug template -- the
> etc/DEBUG file doesn't actually mention that command -- and I've not
> been able to reproduce the issue in the interim to try that one, so
> I'm sending this as-is for now.)
> 
> The function I'm calling in lisp does a `completing-read', and I can
> see Fread_from_minibuffer in the backtrace, so I *guess* it's getting
> that far after creating the frame; but I'm not sure if that's a factor
> as (I think) I've also seen this with a pop-up notification frame
> I use for appt.el notifications -- and that one doesn't prompt me at
> all (but it's creating frames in a fairly similar way).
> 
> I can't replicate this at will, but it happens often enough that I
> *should* be able to recreate it again sometime soon, so let me know
> if you want me to try other things (but note that I'm not familiar
> with gdb and debugging C code, so step-by-step instructions will be
> helpful for that).

Run Emacs normally, not from GD, and when it hangs attach GDB to it
and say

  (gdb) thread apply all bt

Then post here everything GDB produces.  (It is best to run GDB from
the src directory of the Emacs source tree, where it will read the
.gdbinit file which helps displaying Lisp objects.)

If we don't see from the first backtrace you produce what is the
problem, then do the above several times, so we could see some pattern
of where it hangs.

Btw, by "hangs" you mean it is stuck doing nothing, right?  It doesn't
use 100% of some CPU execution unit (that would be "infloops", not
"hangs"), right?





  reply	other threads:[~2025-01-09 13:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-09 12:09 bug#75461: 30.0.93; Frequent (but inconsistent) hangs when creating frames Phil Sainty
2025-01-09 13:12 ` Eli Zaretskii [this message]
2025-01-09 13:25   ` Phil Sainty
2025-01-09 14:18     ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86zfk0167o.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=75461@debbugs.gnu.org \
    --cc=psainty@orcon.net.nz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.