GNU bug report logs - #53871
29.0.50; Emacs freezes with new child-frame option

Previous Next

Package: emacs;

Reported by: Arash Esbati <arash <at> gnu.org>

Date: Tue, 8 Feb 2022 08:43:02 UTC

Severity: normal

Found in version 29.0.50

To reply to this bug, email your comments to 53871 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#53871; Package emacs. (Tue, 08 Feb 2022 08:43:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Arash Esbati <arash <at> gnu.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 08 Feb 2022 08:43:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Arash Esbati <arash <at> gnu.org>
To: emacs-bugs <bug-gnu-emacs <at> gnu.org>
Subject: 29.0.50; Emacs freezes with new child-frame option
Date: Tue, 08 Feb 2022 09:42:22 +0100
Hi all,

I'm trying the new option child-frame available for
`show-paren-context-when-offscreen' (introduced in 6e5d79c048) and I'm
running into an issue where Emacs freezes.  Steps to trigger:

1) emacs -Q
2) eval (setq show-paren-context-when-offscreen t) in scratch
3) M-x find-library RET paren RET
4) M-g c 13902 RET
5) With the mouse cursor, grab the scroll bar and move down so far to
   get the context
   'Matches (defun show-paren--show-context-in-child-frame (text)'
   in the echo area.
6) eval (setq show-paren-context-when-offscreen 'child-frame) in scratch
7) Repeat 5) and Emacs freezes

This is with repo-version 90eb6a7fe4 on Win10.

Best, Arash




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#53871; Package emacs. (Tue, 08 Feb 2022 10:36:01 GMT) Full text and rfc822 format available.

Message #8 received at 53871 <at> debbugs.gnu.org (full text, mbox):

From: Tassilo Horn <tsdh <at> gnu.org>
To: Arash Esbati <arash <at> gnu.org>
Cc: 53871 <at> debbugs.gnu.org
Subject: Re: bug#53871: 29.0.50; Emacs freezes with new child-frame option
Date: Tue, 08 Feb 2022 11:35:17 +0100
Arash Esbati <arash <at> gnu.org> writes:

Hi Arash,

> I'm trying the new option child-frame available for
> `show-paren-context-when-offscreen' (introduced in 6e5d79c048) and I'm
> running into an issue where Emacs freezes.  Steps to trigger:
>
> 1) emacs -Q
> 2) eval (setq show-paren-context-when-offscreen t) in scratch
> 3) M-x find-library RET paren RET
> 4) M-g c 13902 RET
> 5) With the mouse cursor, grab the scroll bar and move down so far to
>    get the context
>    'Matches (defun show-paren--show-context-in-child-frame (text)'
>    in the echo area.
> 6) eval (setq show-paren-context-when-offscreen 'child-frame) in scratch
> 7) Repeat 5) and Emacs freezes
>
> This is with repo-version 90eb6a7fe4 on Win10.

I can't reproduce with the slightly later version 9d1ae05442 on
GNU/Linux with a pgtk build.  When scroll up and down (only so far as to
keep point at the closing paren of the defun), I'll see the child frame
displaying the "(defun ...)" line whenever I stop scrolling for a
second.

After doing that for I while, I checked that `(frame-list)` still
contains just a single frame.  How is that for you?  Do you have many
frames in there?  And do you recover from the freeze?

Does doing the recipe with debug-on-quit set and then doing C-g when the
freeze occurs shed some light?

Bye,
Tassilo




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#53871; Package emacs. (Tue, 08 Feb 2022 12:08:02 GMT) Full text and rfc822 format available.

Message #11 received at 53871 <at> debbugs.gnu.org (full text, mbox):

From: Arash Esbati <arash <at> gnu.org>
To: Tassilo Horn <tsdh <at> gnu.org>
Cc: 53871 <at> debbugs.gnu.org
Subject: Re: bug#53871: 29.0.50; Emacs freezes with new child-frame option
Date: Tue, 08 Feb 2022 13:06:31 +0100
Hi Tassilo,

Tassilo Horn <tsdh <at> gnu.org> writes:

> I can't reproduce with the slightly later version 9d1ae05442 on
> GNU/Linux with a pgtk build.  When scroll up and down (only so far as to
> keep point at the closing paren of the defun), I'll see the child frame
> displaying the "(defun ...)" line whenever I stop scrolling for a
> second.
>
> After doing that for I while, I checked that `(frame-list)` still
> contains just a single frame.  How is that for you?

Thanks for your response.  It is the same, only one frame.

> And do you recover from the freeze?

No recovery, Emacs freezes hard and I have to kill it from the shell.

> Does doing the recipe with debug-on-quit set and then doing C-g when the
> freeze occurs shed some light?

See above.  Interesting point is that scrolling with mouse wheel isn't a
problem, things play havoc if I touch the scroll bar with the mouse
pointer.

Best, Arash




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#53871; Package emacs. (Tue, 08 Feb 2022 12:24:01 GMT) Full text and rfc822 format available.

Message #14 received at 53871 <at> debbugs.gnu.org (full text, mbox):

From: Tassilo Horn <tsdh <at> gnu.org>
To: Arash Esbati <arash <at> gnu.org>
Cc: 53871 <at> debbugs.gnu.org
Subject: Re: bug#53871: 29.0.50; Emacs freezes with new child-frame option
Date: Tue, 08 Feb 2022 13:09:38 +0100
Arash Esbati <arash <at> gnu.org> writes:

>> After doing that for I while, I checked that `(frame-list)` still
>> contains just a single frame.  How is that for you?
>
> Thanks for your response.  It is the same, only one frame.

Hm, `frame-list' says it doesn't return "tooltip frames".  I think
that's something else than child frames but you might try
`(frames-on-display-list)', too.  It should also return a single frame
unless a show-paren child-frame is still visible.

>> And do you recover from the freeze?
>
> No recovery, Emacs freezes hard and I have to kill it from the shell.

Could you get a backtrace with GDB?  Basically just

  $ gdb src/emacs -x src/.gdbinit
  > run
  # do your scroll stuff until it freezes and then hit C-z in gdb and do
  > xbacktrace # get a lisp backtrace
  > bt full    # get a C backtrace

The C backtrace is probably large so please compress is before attaching
it here.

>> Does doing the recipe with debug-on-quit set and then doing C-g when
>> the freeze occurs shed some light?
>
> See above.  Interesting point is that scrolling with mouse wheel isn't
> a problem, things play havoc if I touch the scroll bar with the mouse
> pointer.

Could you put a message in show-paren--show-context-in-child-frame just
to get a feeling of how often a child frame is created?

Bye,
Tassilo




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#53871; Package emacs. (Tue, 08 Feb 2022 15:10:01 GMT) Full text and rfc822 format available.

Message #17 received at 53871 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Tassilo Horn <tsdh <at> gnu.org>, martin rudalics <rudalics <at> gmx.at>
Cc: arash <at> gnu.org, 53871 <at> debbugs.gnu.org
Subject: Re: bug#53871: 29.0.50; Emacs freezes with new child-frame option
Date: Tue, 08 Feb 2022 17:09:23 +0200
> From: Tassilo Horn <tsdh <at> gnu.org>
> Date: Tue, 08 Feb 2022 11:35:17 +0100
> Cc: 53871 <at> debbugs.gnu.org
> 
> > 1) emacs -Q
> > 2) eval (setq show-paren-context-when-offscreen t) in scratch
> > 3) M-x find-library RET paren RET
> > 4) M-g c 13902 RET
> > 5) With the mouse cursor, grab the scroll bar and move down so far to
> >    get the context
> >    'Matches (defun show-paren--show-context-in-child-frame (text)'
> >    in the echo area.
> > 6) eval (setq show-paren-context-when-offscreen 'child-frame) in scratch
> > 7) Repeat 5) and Emacs freezes
> >
> > This is with repo-version 90eb6a7fe4 on Win10.
> 
> I can't reproduce with the slightly later version 9d1ae05442 on
> GNU/Linux with a pgtk build.  When scroll up and down (only so far as to
> keep point at the closing paren of the defun), I'll see the child frame
> displaying the "(defun ...)" line whenever I stop scrolling for a
> second.
> 
> After doing that for I while, I checked that `(frame-list)` still
> contains just a single frame.  How is that for you?  Do you have many
> frames in there?  And do you recover from the freeze?

The number of the frames is not the problem.  Yes, there's just one
frame on Windows as well.  And no, there's no way to recover, because
the implementation of this feature seems to cause on MS-Windows a
deadlock between two threads, one of which is the main thread.

On Windows, creating a frame involves sending a message to a separate
UI thread and waiting for that thread to respond, but in this
scenario, doing that seems to lead to some kind of deadlock, whereby
both threads wait for messages.

Martin, any ideas?  I can show the backtrace from the freeze, if that
helps.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#53871; Package emacs. (Tue, 08 Feb 2022 18:24:02 GMT) Full text and rfc822 format available.

Message #20 received at 53871 <at> debbugs.gnu.org (full text, mbox):

From: martin rudalics <rudalics <at> gmx.at>
To: Eli Zaretskii <eliz <at> gnu.org>, Tassilo Horn <tsdh <at> gnu.org>
Cc: arash <at> gnu.org, 53871 <at> debbugs.gnu.org
Subject: Re: bug#53871: 29.0.50; Emacs freezes with new child-frame option
Date: Tue, 8 Feb 2022 19:23:21 +0100
> Martin, any ideas?  I can show the backtrace from the freeze, if that
> helps.

No ideas.  I also observed that the scroll bar in the main frame must be
involved.  Mouse-wheel scrolling doesn't freeze it here either.  So we
seem to have two competing windows - the scroll bar window and the child
frame window - which we would have to disentangle somehow.

martin




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#53871; Package emacs. (Tue, 08 Feb 2022 18:58:02 GMT) Full text and rfc822 format available.

Message #23 received at 53871 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: martin rudalics <rudalics <at> gmx.at>
Cc: arash <at> gnu.org, 53871 <at> debbugs.gnu.org, tsdh <at> gnu.org
Subject: Re: bug#53871: 29.0.50; Emacs freezes with new child-frame option
Date: Tue, 08 Feb 2022 20:55:55 +0200
> Date: Tue, 8 Feb 2022 19:23:21 +0100
> Cc: arash <at> gnu.org, 53871 <at> debbugs.gnu.org
> From: martin rudalics <rudalics <at> gmx.at>
> 
>  > Martin, any ideas?  I can show the backtrace from the freeze, if that
>  > helps.
> 
> No ideas.  I also observed that the scroll bar in the main frame must be
> involved.  Mouse-wheel scrolling doesn't freeze it here either.  So we
> seem to have two competing windows - the scroll bar window and the child
> frame window - which we would have to disentangle somehow.

How come we don't see something similar in any other code that creates
child frames?  Scrolling via the scroll bars is possible while some
Lisp creates child frames not necessarily in this context.  Are our
frame creation so fragile that it doesn't tolerate scroll bars in
parallel with frame creation?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#53871; Package emacs. (Wed, 09 Feb 2022 00:43:02 GMT) Full text and rfc822 format available.

Message #26 received at 53871 <at> debbugs.gnu.org (full text, mbox):

From: Po Lu <luangruo <at> yahoo.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: martin rudalics <rudalics <at> gmx.at>, arash <at> gnu.org, tsdh <at> gnu.org,
 53871 <at> debbugs.gnu.org
Subject: Re: bug#53871: 29.0.50; Emacs freezes with new child-frame option
Date: Wed, 09 Feb 2022 08:41:49 +0800
Eli Zaretskii <eliz <at> gnu.org> writes:

> How come we don't see something similar in any other code that creates
> child frames?  Scrolling via the scroll bars is possible while some
> Lisp creates child frames not necessarily in this context.  Are our
> frame creation so fragile that it doesn't tolerate scroll bars in
> parallel with frame creation?

FWIW, I don't think it's a bug in our generic frame creation code since
I can't reproduce the bug on Haiku, where there is a thread for each
window, and we do a similar dance with sending messages to them from the
main thread and waiting for replies.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#53871; Package emacs. (Wed, 09 Feb 2022 03:35:02 GMT) Full text and rfc822 format available.

Message #29 received at 53871 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Po Lu <luangruo <at> yahoo.com>
Cc: rudalics <at> gmx.at, arash <at> gnu.org, tsdh <at> gnu.org, 53871 <at> debbugs.gnu.org
Subject: Re: bug#53871: 29.0.50; Emacs freezes with new child-frame option
Date: Wed, 09 Feb 2022 05:33:45 +0200
> From: Po Lu <luangruo <at> yahoo.com>
> Cc: martin rudalics <rudalics <at> gmx.at>,  arash <at> gnu.org,
>   53871 <at> debbugs.gnu.org,  tsdh <at> gnu.org
> Date: Wed, 09 Feb 2022 08:41:49 +0800
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> > How come we don't see something similar in any other code that creates
> > child frames?  Scrolling via the scroll bars is possible while some
> > Lisp creates child frames not necessarily in this context.  Are our
> > frame creation so fragile that it doesn't tolerate scroll bars in
> > parallel with frame creation?
> 
> FWIW, I don't think it's a bug in our generic frame creation code

I didn't say it was.  The problem is definitely specific to
MS-Windows, as I tried to explain up-thread.




This bug report was last modified 3 years and 131 days ago.

Previous Next


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