bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#65817: 30.0.50; Abort with NSInvalidArgumentException on macOS Big S


From: Alan Third
Subject: bug#65817: 30.0.50; Abort with NSInvalidArgumentException on macOS Big Sur
Date: Fri, 8 Sep 2023 19:53:50 +0100

On Fri, Sep 08, 2023 at 09:01:06AM +0200, Gerd Möllmann wrote:
> System Description:  macOS 11.7.9
> 
> This is a 10 year old Mac.  I can't reproduce it at will.  Below is what
> was printed to the terminal, then Emacs aborted.

This is odd. The system is trying to draw the frame to the screen
*long* before we've finished creating it.

I don't know why this would be happening, it's possible that we've hit
an edge case where we accidentally mark the view for display early,
but I don't know how we would be doing that.

>       5   emacs                               0x000000010033d481 -[EmacsView 
> lockFocus] + 49
>       6   emacs                               0x000000010032ee27 ns_focus + 87
>       7   emacs                               0x000000010033df80 
> ns_clear_frame_area + 400
>       8   emacs                               0x000000010033dda1 -[EmacsView 
> drawRect:] + 321
<snip>
>       21  AppKit                              0x00007fff2314c06f -[NSWindow 
> addChildWindow:ordered:] + 640
>       22  emacs                               0x000000010033fe08 
> -[EmacsWindow setParentChildRelationships] + 696
>       23  emacs                               0x000000010033f2ad 
> -[EmacsWindow initWithEmacsFrame:fullscreen:screen:] + 1485
>       24  emacs                               0x000000010033ecd0 
> -[EmacsWindow initWithEmacsFrame:] + 48
>       25  emacs                               0x000000010033ace5 -[EmacsView 
> initFrameFromEmacs:] + 1045
>       26  emacs                               0x00000001003579a1 
> Fx_create_frame + 7937

At the point lockFocus is called here, we haven't yet set up the layer
we want to draw into. I can't find any indication that addChildWindow
may trigger a display, but this is Apple's documentation I'm talking
about...

I've attached a patch that reorders some of the initialisation,
hopefully avoiding this problem.

I've also attached another patch that you may need to apply first to
make the second one apply cleanly.
-- 
Alan Third

Attachment: v2-0001-Simplify-the-EmacsLayer-double-buffering-code-bug.patch
Description: Text Data

Attachment: 0001-Fix-crash-on-child-frame-creation-bug-65817.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]