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 > 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