Subject: bug#12397: 24.2; gtk3 (from Macports); visible-bell trips cairo assertion

From: Chong Yidong <[email-masked]>
Date: Thu, 20 Sep 2012 10:59:20 +0800

Simon Leinen <[email-masked]> writes:

> My .emacs sets visible-bell to t.  When I compile Emacs on MacOS X with
> Gtk3 (from Macports) as the X toolkit and run it, it crashes almost
> instantly with a failed assertion in cairo_pattern_destroy().
>
> I can reproduce this using emacs -Q by saying:
>
>   M-: (setq visible-bell t)
>   M-x ding

FWIW, I cannot reproduce this with either 24.2 or latest trunk,
x86_64-unknown-linux-gnu, GTK+ Version 3.4.2.

> #0  0x00007fff986dbce2 in __pthread_kill ()
...
> #4  0x0000000100ecd44c in cairo_pattern_destroy ()
> #5  0x0000000100eb600d in _cairo_gstate_set_source ()
> #6  0x0000000100eade35 in cairo_set_source ()
> #7  0x0000000100eadfc6 in cairo_set_source_rgb ()
> #8  0x00000001000ae32a in XTflash [inlined] () at /private/var/tmp/emacs/emacs-24.2/src/xterm.c:3050
> 	wakeup = {tv_sec = 4299859674, tv_usec = 537281269}
> 	window = (GdkWindow *) 0x0
> 	cr = (cairo_t *) 0x10293fa00
> 	flash_left = 4
> 	flash_height = 0
> 	height = 5203816
> 	flash_right = 556795399
> 	width = 556795399

A crash so deep in Cairo seems to indicate that this is a Cairo-on-Mac
bug.  There doesn't seem to be anything suspicious in the Emacs part of
the backtrace.