Hi. There. ,---- [ previous thread about this behaviour ] | https://lists.gnu.org/archive/html/emacs-devel/2022-04/msg00922.html `---- In case You need to put the breakpoints. You would need to add three lines at the end of src/.gdbinit --8<---------------cut here---------------start------------->8--- set breakpoint pending on b xterm.c:x_delete_terminal b xterm.c:x_error_handler --8<---------------cut here---------------end--------------->8--- REQUIREMENT-for-reproducing-the-bug: having xephyr installed and xterm or wmaker launching xephyr: --8<---------------cut here---------------start------------->8--- (Xephyr -ac -br -noreset -screen 1024x768 :1.0 &);sleep 1;(GNUSTEP_USER_ROOT="${HOME}/GNUstep" DISPLAY=:1.0 wmaker &) --8<---------------cut here---------------end--------------->8--- Steps for reproducing the bug: 1. gdb -i=mi --args ./emacs -Q -f toogle-debug-on-error --fg-daemon 2. @host emacsclient -c -n --eval '(eshell)' 3. on eshell-buffer emacs-version Return 4. @remoteMachine emacsclient -c -n ~/.bashrc {requires xephyr launched see above} 5. M-x dired-jump 6. M-x close-display-connection Expected Output: emacs commits suicide So Both opened frames are closed NOTE: on gdb window You are going to get the message 'X protocol error: RenderBadGlyph (invalid Glyph parameter) on protocol request 139' NOTE-THREE: this problem is not reproducible on emacs-29 Simple-Question: How to know or capture|cleaning the X error before calling close-display-connection? IDEA: I think the step 4 {opening a new X frame on a different DISPLAY causes the error} VIDEO-of-debug-session: https://disk.yandex.com/i/vK-VEOTjP5_OGA VIDEO-DETAILS: gdb runs on DISPLAY 1.0 and the second frame is opened in DISPLAY :0 {second display not been showed on the video} 0m10s starting gdb 0m40s starting first emacs frame on DISPLAY 1:0 1m06s starting second frame on DISPLAY :0 1m16s doing M-x dired-jump on the second frame {not showed on video} 1m16s back to the video focused 1m30s M-x close-display-connection on first emacs frame 1m40s back on the gdb terminal {which shows the hitted breakpoints} 1m50s end the gdb session 1m57s ending the video JIC: I am attaching three backtraces