Subject: Re: bug#76944: 31.0.50; X protocol error: BadGC (invalid GC parameter) on protocol request 60

From: Po Lu <[email-masked]>
Date: Wed, 12 Mar 2025 11:45:39 +0800

Visuwesh <[email-masked]> writes:

> (gdb) bt
> #0  futex_wait (futex_word=0x7ffff701f8c0, expected=2, private=0) at ../sysdeps/nptl/futex-internal.h:146
> #1  __GI___lll_lock_wait (futex=futex@entry=0x7ffff701f8c0, private=0) at ./nptl/lowlevellock.c:49
> #2  0x00007ffff62953a2 in lll_mutex_lock_optimized (mutex=0x7ffff701f8c0) at ./nptl/pthread_mutex_lock.c:48
> #3  ___pthread_mutex_lock (mutex=0x7ffff701f8c0) at ./nptl/pthread_mutex_lock.c:93
> #4  0x00007ffff6f42a27 in ??? () at /lib/x86_64-linux-gnu/libcairo.so.2
> #5  0x00007ffff6f4589c in cairo_scaled_font_text_to_glyphs () at /lib/x86_64-linux-gnu/libcairo.so.2
> #6  0x00005555557bd73b in ftcrfont_encode_char (font=0x5555599e4c70, c=<optimized out>) at ftcrfont.c:395
> #7  0x00005555557586ab in font_has_char (f=f@entry=0x55555b224290, font=0x5555599e4c75, c=c@entry=2949) at font.c:3067
> #8  0x00005555557c0195 in fontset_find_font (fontset=0x55555b5f2605, c=c@entry=2949, face=face@entry=0x555577978dd0, charset_id=charset_id@entry=-1, fallback=fallback@entry=false) at fontset.c:684
> #9  0x00005555557c0bfd in fontset_font (fontset=fontset@entry=0x5555b6c86a5d, c=c@entry=2949, face=face@entry=0x555577978d

I don't see any frames named _XReply in this backtrace.  I expect that
the X error handler longjmp'ed from a Cairo routine called with one of
its locks held, producing this deadlock during a subsequent invocation.

You must also break on x_error_quitter.  That will reveal the true
source of the X error.