Subject: bug#16140: 24.3.50; GC tries to free invalid font objects

From: Johan Bockgård <[email-masked]>
Date: Fri, 25 Apr 2014 20:31:14 +0200

Dmitry Antipov <[email-masked]> writes:

> On 12/14/2013 01:51 PM, Eli Zaretskii wrote:
>
>> When I originally saw this, fnt->driver was NULL.  I added protection
>> against that, but then it crashed with non-NULL but still invalid
>> pointer.  Such pointers should never end up in font objects, so how
>> come they do?
>
> Hm...I've tried bloat-font quite a lot with my MinGW build, but didn't
> see anything similar.  Anyway, r115541 has an extra check for valid
> font driver pointer in font objects; if you hit this eassert, please
> let me know.

#0  0x00007fd1f97cba8b in raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/pt-raise.c:38
#1  0x0000000000513c76 in terminate_due_to_signal (sig=sig@entry=6, 
    backtrace_limit=backtrace_limit@entry=2147483647) at emacs.c:382
#2  0x0000000000577794 in die (
    msg=msg@entry=0x651d78 "valid_font_driver (((struct font *) vector)->driver)", file=file@entry=0x651580 "alloc.c", line=line@entry=2961) at alloc.c:6953
#3  0x000000000057bd0d in cleanup_vector (vector=0x3b7f650) at alloc.c:2961
#4  0x000000000057bdc6 in sweep_vectors () at alloc.c:3001
#5  0x000000000057d62a in gc_sweep () at alloc.c:6771
#6  Fgarbage_collect () at alloc.c:5678

I have a core file if that is of any help.

In GNU Emacs 24.4.50.1 (x86_64-unknown-linux-gnu, X toolkit, Xaw scroll bars)
 of 2014-04-13 on muon
Repository revision: 116973 [email-masked]
Windowing system distributor `The X.Org Foundation', version 11.0.11405000
System Description:	Ubuntu 13.10

Configured using:
 `configure --enable-checking --enable-asserts'

Configured features:
XPM JPEG TIFF GIF PNG RSVG SOUND GPM DBUS GCONF GSETTINGS NOTIFY ACL
LIBSELINUX GNUTLS LIBXML2 FREETYPE XFT ZLIB