Subject: 23.0.92.3; hang involving XftGlyphExtents after moving cursor

From: Daniel Clemente <[email-masked]>
Date: Thu, 23 Apr 2009 05:28:55 -0700 (PDT)

This is a hang I had with the code from 20.m4.2009, which I could not reproduce anymore. Please ignore it if this was already fixed or the code seems correct.

I could get this log of system calls:

  XftCharIndex(0x8709800, 0x9eb3528, 32, 786432, 8)   = 411
  XftGlyphExtents(0x8709800, 0x9eb3528, 0xbfb2e05c, 1, 0xbfb2deb8) = 0
  XftCharIndex(0x8709800, 0x9eb3528, 32, 786432, 8)   = 411
  XftGlyphExtents(0x8709800, 0x9eb3528, 0xbfb2e05c, 1, 0xbfb2deb8) = 0
  XftCharIndex(0x8709800, 0x9eb3528, 32, 786432, 8)   = 411
  XftGlyphExtents(0x8709800, 0x9eb3528, 0xbfb2e05c, 1, 0xbfb2deb8) = 0
  XftCharIndex(0x8709800, 0x9eb3528, 32, 786432, 8)   = 411
  XftGlyphExtents(0x8709800, 0x9eb3528, 0xbfb2e05c, 1, 0xbfb2deb8) = 0
  XftCharIndex(0x8709800, 0x9eb3528, 32, 786432, 8)   = 411
  XftGlyphExtents(0x8709800, 0x9eb3528, 0xbfb2e05c, 1, 0xbfb2deb8) = 0
  XftCharIndex(0x8709800, 0x9eb3528, 32, 786432, 8)   = 411
  XftGlyphExtents(0x8709800, 0x9eb3528, 0xbfb2e05c, 1, 0xbfb2deb8) = 0
  XftCharIndex(0x8709800, 0x9eb3528, 32, 786432, 8)   = 411
  XftGlyphExtents(0x8709800, 0x9eb3528, 0xbfb2e05c, 1, 0xbfb2deb8) = 0
  XftCharIndex(0x8709800, 0x9eb3528, 32, 786432, 8)   = 411
  XftGlyphExtents(0x8709800, 0x9eb3528, 0xbfb2e05c, 1, 0xbfb2deb8) = 0
  XftCharIndex(0x8709800, 0x9eb3528, 32, 786432, 8)   = 411
  XftGlyphExtents(0x8709800, 0x9eb3528, 0xbfb2e05c, 1, 0xbfb2deb8) = 0
  XftCharIndex(0x8709800, 0x9eb3528, 32, 786432, 8)   = 411
  XftGlyphExtents(0x8709800, 0x9eb3528, 0xbfb2e05c, 1, 0xbfb2deb8) = 0
  XftCharIndex(0x8709800, 0x9eb3528, 32, 786432, 8)   = 411
  XftGlyphExtents(0x8709800, 0x9eb3528, 0xbfb2e05c, 1, 0xbfb2deb8) = 0
  XftCharIndex(0x8709800, 0x9eb3528, 32, 786432, 8)   = 411
  XftGlyphExtents(0x8709800, 0x9eb3528, 0xbfb2e05c, 1, 0xbfb2deb8) = 0
  XftCharIndex(0x8709800, 0x9eb3528, 32, 786432, 8)   = 411
  XftGlyphExtents(0x8709800, 0x9eb3528, 0xbfb2e05c, 1, 0xbfb2deb8) = 0
  XftCharIndex(0x8709800, 0x9eb3528, 32, 786432, 8)   = 411
  XftGlyphExtents(0x8709800, 0x9eb3528, 0xbfb2e05c, 1, 0xbfb2deb8) = 0
  memmove(0xbfb2deb8, 0xee001a0, 72, 0xbfb2df0c, 0xbfb2df10) = 0xbfb2deb8
  memmove(0xbfb2dd18, 0x100af008, 72, 12, 0xbfb2dd18) = 0xbfb2dd18
  mallopt(-4, 0, -1, 0x9e7e498, 0x9e7e498)            = 1
  malloc(60)                                          = 0x110cf650
  malloc(28)                                          = 0x110cf690
  mallopt(-4, 0x5f5e100, -1, 0x9e7e498, 0x9e7e498)    = 1
  __ctype_tolower_loc()                               = 0xb70f6b14
  __ctype_tolower_loc()                               = 0xb70f6b14
  __ctype_tolower_loc()                               = 0xb70f6b14
  __ctype_tolower_loc()                               = 0xb70f6b14
  XftCharIndex(0x8709800, 0xa18e968, 115, 0xe7a0a50, 62514) = 330
  XftGlyphExtents(0x8709800, 0xa18e968, 0xbfb2e05c, 1, 0xbfb2deb8) = 0
  XftCharIndex(0x8709800, 0xa18e968, 101, 786432, 8)  = 313
  XftGlyphExtents(0x8709800, 0xa18e968, 0xbfb2e05c, 1, 0xbfb2deb8) = 0
  XftCharIndex(0x8709800, 0xa18e968, 109, 786432, 8)  = 335
  XftGlyphExtents(0x8709800, 0xa18e968, 0xbfb2e05c, 1, 0xbfb2deb8) = 0

  A backtrace:

(gdb) bt
#0  0xb755c9f0 in XftGlyphExtents (dpy=0x8709800, pub=0x9eb3528, glyphs=0xbfb2c45c, nglyphs=1, extents=0xbfb2c2b8) at ../../src/xftextent.c:68
#1  0x082330c7 in xftfont_text_extents ()
#2  0x080924fd in x_produce_glyphs ()
#3  0x0807e49e in move_it_in_display_line_to ()
#4  0x0807fb3a in move_it_to ()
#5  0x0808739e in move_it_vertically_backward ()
#6  0x080adecb in Frecenter ()
#7  0x081cdc1b in Feval ()
#8  0x081cdebf in Fprogn ()
#9  0x081c737e in Fsave_excursion ()
#10 0x081cdccb in Feval ()
#11 0x081cdebf in Fprogn ()
#12 0x081cdccb in Feval ()
#13 0x081cdccb in Feval ()
#14 0x081cda80 in Feval ()
#15 0x081cdebf in Fprogn ()
#16 0x081c719b in Fsave_restriction ()
#17 0x081cdccb in Feval ()
#18 0x081cdebf in Fprogn ()
#19 0x081cdccb in Feval ()
#20 0x081ce0a5 in Funwind_protect ()
#21 0x081cdccb in Feval ()
#22 0x081cdebf in Fprogn ()
#23 0x081c00e6 in Fsave_current_buffer ()
#24 0x081cdccb in Feval ()
#25 0x081cee1f in Flet ()
#26 0x081cdccb in Feval ()
#27 0x081cda80 in Feval ()
#28 0x081cee1f in Flet ()
#29 0x081cdccb in Feval ()
#30 0x081cdccb in Feval ()
#31 0x081cdebf in Fprogn ()
#32 0x081cc0e5 in funcall_lambda ()
#33 0x081cc294 in Ffuncall ()
#34 0x081ccbb1 in run_hook_with_args ()
#35 0x081cce07 in run_hook_with_args_2 ()
#36 0x08088842 in try_scrolling ()
#37 0x0809676e in redisplay_window ()
#38 0x080976d3 in redisplay_window_0 ()
#39 0x081caca6 in internal_condition_case_1 ()
#40 0x080751f8 in redisplay_windows ()
#41 0x0808da75 in redisplay_internal ()
#42 0x0808e6f2 in redisplay_preserve_echo_area ()
#43 0x08057759 in sit_for ()
#44 0x0815b8e8 in command_loop_1 ()
#45 0x081caee0 in internal_condition_case ()
#46 0x0814fd95 in command_loop_2 ()
#47 0x081cafba in internal_catch ()
#48 0x081524b1 in recursive_edit_1 ()
#49 0x081820c5 in read_minibuf ()

Another time I noticed the hang, the backtrace was:

(gdb) bt
#0  0xb755c7c1 in XftGlyphExtents (dpy=0x8709800, pub=0xa18e968, glyphs=0xbfb2e05c, nglyphs=1, extents=0xbfb2deb8) at ../../src/xftextent.c:32
#1  0x082330c7 in xftfont_text_extents ()
#2  0x080924fd in x_produce_glyphs ()
#3  0x0807e49e in move_it_in_display_line_to ()
#4  0x0807fd30 in move_it_to ()
#5  0x08088ab0 in try_scrolling ()
#6  0x0809676e in redisplay_window ()
#7  0x080976d3 in redisplay_window_0 ()
#8  0x081caca6 in internal_condition_case_1 ()
#9  0x080751f8 in redisplay_windows ()
#10 0x0808da75 in redisplay_internal ()
#11 0x0808e6f2 in redisplay_preserve_echo_area ()
#12 0x08057759 in sit_for ()
#13 0x0815b8e8 in command_loop_1 ()
#14 0x081caee0 in internal_condition_case ()
#15 0x0814fd95 in command_loop_2 ()
#16 0x081cafba in internal_catch ()
#17 0x081524b1 in recursive_edit_1 ()
#18 0x081820c5 in read_minibuf ()
#19 0x081cdb52 in Feval ()

GNU Emacs 23.0.92.3 (i686-pc-linux-gnu, GTK+ Version 2.16.0) of 2009-04-20 on CPU107

ii  libxft-dev                                 2.1.13-3ubuntu1                    FreeType-based font drawing library for X (d
ii  libxft2                                    2.1.13-3ubuntu1                    FreeType-based font drawing library for X
ii  libxft2-dbg                                2.1.13-3ubuntu1                    FreeType-based font drawing library for X (u