Subject: bug#17691: 24.3.91; crash closing remote frame

From: Dmitry Antipov <[email-masked]>
Date: Thu, 05 Jun 2014 09:56:34 +0400

On 06/05/2014 08:53 AM, Dmitry Antipov wrote:

> Please try this against emacs-24 branch or 24.3.91 (this is a backported
> hybrid of trunk commits 116927 and 117126). If that works for you, this
> should be incorporated into emacs-24 and included into the next pretest.

BTW, could you please check one more thing for any of emacs-24, 24.3.91
or trunk and --with-x-toolkit=lucid:

gdb emacs
b XUnloadFont
r -Q --eval '(let ((f (make-frame-on-display ":0" '"'"'((font . "7x14"))))) (delete-frame f))'

When you hit the breakpoint, try to print data pointed by 'font'.
I'm seeing an invalid pointers, e.g.:

Breakpoint 1, XUnloadFont (dpy=0xb71180, font=25165832) at UnldFont.c:36
36	{
(gdb) bt 10
#0  XUnloadFont (dpy=0xb71180, font=25165832) at UnldFont.c:36
#1  0x0000003e79015689 in FreeCacheRec (app=app@entry=0x1276370, p=0x12f6ca8, prev=prev@entry=0x3e79265770 <cacheHashTable+272>)
     at Convert.c:449
#2  0x0000003e790168fb in _XtCacheFlushTag (app=0x1276370, tag=tag@entry=0x11ba4b0) at Convert.c:491
#3  0x0000003e7901e3ae in CloseDisplay (dpy=dpy@entry=0xb71180) at Display.c:638
#4  0x0000003e7901f09c in XtCloseDisplay (dpy=0xb71180) at Display.c:680
#5  0x000000000052fc25 in x_delete_terminal (terminal=0x1133030) at ../../emacs-24.3.91/src/xterm.c:10414
#6  0x000000000050b73f in Fdelete_terminal (terminal=18034741, force=11533218) at ../../emacs-24.3.91/src/terminal.c:348
#7  0x000000000041f036 in delete_frame (frame=18107005, force=11533170) at ../../emacs-24.3.91/src/frame.c:1399
#8  0x000000000041f564 in Fdelete_frame (frame=18107005, force=11533170) at ../../emacs-24.3.91/src/frame.c:1509
#9  0x00000000005f1789 in eval_sub (form=18902422) at ../../emacs-24.3.91/src/eval.c:2188
(More stack frames follow...)
(gdb) p *font
Cannot access memory at address 0x1800008
(gdb) c
Continuing.

Breakpoint 1, XUnloadFont (dpy=dpy@entry=0xb71180, font=25165825) at UnldFont.c:36
36	{
(gdb) bt 10
#0  XUnloadFont (dpy=dpy@entry=0xb71180, font=25165825) at UnldFont.c:36
#1  0x000000379461fd78 in XCloseDisplay (dpy=dpy@entry=0xb71180) at ClDisplay.c:59
#2  0x0000003e7901e4b5 in CloseDisplay (dpy=dpy@entry=0xb71180) at Display.c:664
#3  0x0000003e7901f09c in XtCloseDisplay (dpy=0xb71180) at Display.c:680
#4  0x000000000052fc25 in x_delete_terminal (terminal=0x1133030) at ../../emacs-24.3.91/src/xterm.c:10414
#5  0x000000000050b73f in Fdelete_terminal (terminal=18034741, force=11533218) at ../../emacs-24.3.91/src/terminal.c:348
#6  0x000000000041f036 in delete_frame (frame=18107005, force=11533170) at ../../emacs-24.3.91/src/frame.c:1399
#7  0x000000000041f564 in Fdelete_frame (frame=18107005, force=11533170) at ../../emacs-24.3.91/src/frame.c:1509
#8  0x00000000005f1789 in eval_sub (form=18902422) at ../../emacs-24.3.91/src/eval.c:2188
#9  0x00000000005ecb68 in Fprogn (body=18902454) at ../../emacs-24.3.91/src/eval.c:468
(More stack frames follow...)
(gdb) p *font
Cannot access memory at address 0x1800001

etc.

Dmitry