bug#43177: Bug: Emacs 27.1 hangs forever in `FcCharSetSubtractCount' from '/usr/lib/libfontconfig.so.1'

classic Classic list List threaded Threaded
36 messages Options
12
Reply | Threaded
Open this post in threaded view
|

bug#43177: Bug: Emacs 27.1 hangs forever in `FcCharSetSubtractCount' from '/usr/lib/libfontconfig.so.1'

Alexander Shukaev-2
Hi,

With latest Emacs, I have a sporadic hang issue when either opening a
file or scrolling a buffer.  The best part is that it's impossible to
get break back to evaluation loop of Emacs even with 'USR2' signal.
That is when 'USR2' is sent, it does show "Entering debugger...", though
it remains frozen afterwards.  Resending 'USR2' leads to the same
outcome.  One thing is for certain, every time 'USR2' is sent into such
a hang, the stack traceback leads to `FcCharSetSubtractCount' from
'/usr/lib/libfontconfig.so.1':

Thread 1 "emacs" received signal SIGUSR2, User defined signal 2.
0x00007ffff60f8211 in FcCharSetSubtractCount ()
    from /usr/lib/libfontconfig.so.1
(gdb) bt
#0  0x00007ffff60f8211 in FcCharSetSubtractCount
     () at /usr/lib/libfontconfig.so.1
#1  0x00007ffff61057df in  ()
     at /usr/lib/libfontconfig.so.1
#2  0x00007ffff6105c05 in  ()
     at /usr/lib/libfontconfig.so.1
#3  0x00007ffff6105fa7 in  ()
     at /usr/lib/libfontconfig.so.1
#4  0x00007ffff61060b4 in  ()
     at /usr/lib/libfontconfig.so.1
#5  0x00007ffff6106ef8 in FcFontMatch ()
     at /usr/lib/libfontconfig.so.1
#6  0x00005555558e523c in ftcrfont_open
     (f=0x5555563d5f50, entity=..., pixel_size=15)
     at ftcrfont.c:137
#7  0x00005555558466c8 in font_open_entity
     (f=0x5555563d5f50, entity=..., pixel_size=13)
     at font.c:2913
#8  0x0000555555848372 in font_open_for_lface
     (f=0x5555563d5f50, entity=..., attrs=0x55555cd757d0, spec=...) at
font.c:3350
#9  0x00005555558eaf63 in fontset_find_font
     (fontset=..., c=25253, face=0x55555cd757d0, charset_id=-1,
fallback=true) at fontset.c:713
#10 0x00005555558eb632 in fontset_font
     (fontset=..., c=25253, face=0x55555cd757d0, id=-1) at fontset.c:806
#11 0x00005555558ec00b in face_for_char
     (f=0x5555563d5f50, face=0x55555cd757d0, c=25253, pos=257429,
object=...) at fontset.c:996
#12 0x00005555555bd121 in FACE_FOR_CHAR
     (f=0x5555563d5f50, face=0x55555cd757d0, character=25253,
pos=257429, object=...)
     at dispextern.h:1882
#13 0x00005555555db943 in get_next_display_element (it=0x7ffffffe5290)
at xdisp.c:7753
#14 0x00005555555df551 in move_it_in_display_line_to
     (it=0x7ffffffe5290, to_charpos=-1, to_x=-1, op=(unknown: 0)) at
xdisp.c:9244
#15 0x00005555555e291d in move_it_to
     (it=0x7ffffffe5290, to_charpos=-1, to_x=-1, to_y=-1, to_vpos=1,
op=4) at xdisp.c:9853
#16 0x00005555555e4157 in move_it_by_lines
     (it=0x7ffffffe5290, dvpos=1) at xdisp.c:10386
#17 0x00005555555c1484 in line_bottom_y
     (it=0x7ffffffe5290) at xdisp.c:1451
#18 0x00005555555c257e in pos_visible_p
     (w=0x5555563d6190, charpos=257337, x=0x7ffffffe9f3c,
y=0x7ffffffe9f38, rtop=0x7ffffffe9f4c, rbot=0x7ffffffe9f48,
rowh=0x7ffffffe9f44, vpos=0x7ffffffe9f40) at xdisp.c:1753
#19 0x000055555564e225 in Fpos_visible_in_window_p (pos=..., window=...,
partially=...)
     at window.c:1910
#20 0x0000555555756d97 in Fposn_at_point
     (pos=..., window=...) at keyboard.c:11249
#21 0x000055555582158d in funcall_subr
     (subr=0x555555de5c20 <Sposn_at_point>, numargs=2,
args=0x7ffffffea1a8) at eval.c:2870
--Type <RET> for more, q to quit, c to continue without paging--
#22 0x0000555555820fc9 in Ffuncall
     (nargs=3, args=0x7ffffffea1a0) at eval.c:2795
#23 0x000055555587d61a in exec_byte_code
     (bytestr=..., vector=..., maxdepth=..., args_template=..., nargs=1,
args=0x7ffffffea858)
     at bytecode.c:632
#24 0x0000555555821815 in fetch_and_exec_byte_code (fun=...,
syms_left=..., nargs=1, args=0x7ffffffea850) at eval.c:2917
#25 0x0000555555821cce in funcall_lambda
     (fun=..., nargs=1, arg_vector=0x7ffffffea850)
     at eval.c:2998
#26 0x000055555582100d in Ffuncall
     (nargs=2, args=0x7ffffffea848) at eval.c:2797
#27 0x000055555587d61a in exec_byte_code
     (bytestr=..., vector=..., maxdepth=..., args_template=..., nargs=2,
args=0x7ffffffeae08)
     at bytecode.c:632
#28 0x0000555555821815 in fetch_and_exec_byte_code (fun=...,
syms_left=..., nargs=2, args=0x7ffffffeadf8) at eval.c:2917
#29 0x0000555555821cce in funcall_lambda
     (fun=..., nargs=2, arg_vector=0x7ffffffeadf8)
     at eval.c:2998
#30 0x000055555582100d in Ffuncall
     (nargs=3, args=0x7ffffffeadf0) at eval.c:2797
#31 0x000055555587d61a in exec_byte_code
     (bytestr=..., vector=..., maxdepth=..., args_template=..., nargs=2,
args=0x7ffffffeb348)
     at bytecode.c:632
#32 0x0000555555821815 in fetch_and_exec_byte_code (fun=...,
syms_left=..., nargs=2, args=0x7ffffffeb338) at eval.c:2917
#33 0x0000555555821cce in funcall_lambda
     (fun=..., nargs=2, arg_vector=0x7ffffffeb338)
     at eval.c:2998
#34 0x000055555582100d in Ffuncall
     (nargs=3, args=0x7ffffffeb330) at eval.c:2797
#35 0x000055555587d61a in exec_byte_code
     (bytestr=..., vector=..., maxdepth=..., args_template=..., nargs=2,
args=0x7ffffffeb908)
     at bytecode.c:632
#36 0x0000555555821815 in fetch_and_exec_byte_code (fun=...,
syms_left=..., nargs=2, args=0x7ffffffeb8f8) at eval.c:2917
#37 0x0000555555821cce in funcall_lambda
     (fun=..., nargs=2, arg_vector=0x7ffffffeb8f8)
     at eval.c:2998
#38 0x000055555582100d in Ffuncall
     (nargs=3, args=0x7ffffffeb8f0) at eval.c:2797
#39 0x000055555587d61a in exec_byte_code
     (bytestr=..., vector=..., maxdepth=..., args_template=..., nargs=2,
args=0x7ffffffebf78)
     at bytecode.c:632
#40 0x0000555555821815 in fetch_and_exec_byte_code (fun=...,
syms_left=..., nargs=2, args=0x7ffffffebf78) at eval.c:2917
#41 0x0000555555821cce in funcall_lambda
     (fun=..., nargs=2, arg_vector=0x7ffffffebf78)
     at eval.c:2998
--Type <RET> for more, q to quit, c to continue without paging--
#42 0x000055555582100d in Ffuncall
     (nargs=3, args=0x7ffffffebf70) at eval.c:2797
#43 0x0000555555820069 in Fapply
     (nargs=2, args=0x7ffffffec020) at eval.c:2425
#44 0x000055555582075e in apply1
     (fn=..., arg=...) at eval.c:2641
#45 0x00005555558194bf in call_debugger (arg=...)
     at eval.c:339
#46 0x000055555581dde8 in maybe_call_debugger
     (conditions=..., sig=..., data=...)
     at eval.c:1831
#47 0x000055555581d689 in signal_or_quit
     (error_symbol=..., data=..., keyboard_quit=true) at eval.c:1667
#48 0x000055555581d350 in quit () at eval.c:1577
#49 0x000055555581d23b in process_quit_flag ()
     at eval.c:1524
#50 0x000055555581d281 in maybe_quit ()
     at eval.c:1544
#51 0x000055555582df32 in Fassq
     (key=..., alist=...) at fns.c:1609
#52 0x00005555556ae6ad in uniprop_table
     (prop=...) at chartab.c:1284
#53 0x00005555557af2aa in prepare_casing_context
     (ctx=0x7ffffffec320, flag=CASE_UP, inbuffer=false) at casefiddle.c:72
#54 0x00005555557afac6 in casify_object
     (flag=CASE_UP, obj=...) at casefiddle.c:326
#55 0x00005555557afb9d in Fupcase (obj=...)
     at casefiddle.c:349
#56 0x000055555582a190 in Fcompare_strings
     (str1=..., start1=..., end1=..., str2=..., start2=..., end2=...,
ignore_case=...) at fns.c:320
#57 0x00005555557966f2 in Fassoc_string
     (key=..., list=..., case_fold=...)
     at minibuf.c:1855
#58 0x0000555555847bbb in font_find_for_lface
     (f=0x5555563d5f50, attrs=0x55555cd757d0, spec=..., c=-1) at font.c:3250
#59 0x00005555558ead1e in fontset_find_font
     (fontset=..., c=25253, face=0x55555cd757d0, charset_id=-1,
fallback=true) at fontset.c:660
#60 0x00005555558eb632 in fontset_font
     (fontset=..., c=25253, face=0x55555cd757d0, id=-1) at fontset.c:806
#61 0x00005555558ec00b in face_for_char
     (f=0x5555563d5f50, face=0x55555cd757d0, c=25253, pos=257429,
object=...) at fontset.c:996
#62 0x00005555555bd121 in FACE_FOR_CHAR
     (f=0x5555563d5f50, face=0x55555cd757d0, character=25253,
pos=257429, object=...)
     at dispextern.h:1882
#63 0x00005555555db943 in get_next_display_element (it=0x7fffffff5160)
at xdisp.c:7753
#64 0x00005555555df551 in move_it_in_display_line_to
     (it=0x7fffffff5160, to_charpos=-1, to_x=-1, op=(unknown: 0)) at
xdisp.c:9244
#65 0x00005555555e291d in move_it_to
     (it=0x7fffffff5160, to_charpos=-1, to_x=-1, to--Type <RET> for
more, q to quit, c to continue without paging--
_y=-1, to_vpos=1, op=4) at xdisp.c:9853
#66 0x00005555555e4157 in move_it_by_lines
     (it=0x7fffffff5160, dvpos=1) at xdisp.c:10386
#67 0x00005555555c1484 in line_bottom_y
     (it=0x7fffffff5160) at xdisp.c:1451
#68 0x00005555555c257e in pos_visible_p
     (w=0x5555563d6190, charpos=257337, x=0x7fffffff9e20,
y=0x7fffffff9e1c, rtop=0x7fffffff9e18, rbot=0x7fffffff9e14,
rowh=0x7fffffff9e10, vpos=0x7fffffff9e0c) at xdisp.c:1753
#69 0x0000555555658633 in window_scroll_pixel_based (window=..., n=1,
whole=true, noerror=false)
     at window.c:5549
#70 0x00005555556582ec in window_scroll
     (window=..., n=1, whole=true, noerror=false)
     at window.c:5471
#71 0x000055555565b461 in scroll_command
     (window=..., n=..., direction=1)
     at window.c:6177
#72 0x000055555565b5c8 in Fscroll_up (arg=...)
     at window.c:6204
#73 0x0000555555821569 in funcall_subr
     (subr=0x555555de1960 <Sscroll_up>, numargs=1, args=0x7fffffffc718)
at eval.c:2868
#74 0x0000555555820fc9 in Ffuncall
     (nargs=2, args=0x7fffffffc710) at eval.c:2795
#75 0x000055555587d61a in exec_byte_code
     (bytestr=..., vector=..., maxdepth=..., args_template=..., nargs=1,
args=0x7fffffffcd28)
     at bytecode.c:632
#76 0x0000555555821815 in fetch_and_exec_byte_code (fun=...,
syms_left=..., nargs=1, args=0x7fffffffcd20) at eval.c:2917
#77 0x0000555555821cce in funcall_lambda
     (fun=..., nargs=1, arg_vector=0x7fffffffcd20)
     at eval.c:2998
#78 0x000055555582100d in Ffuncall
     (nargs=2, args=0x7fffffffcd18) at eval.c:2797
#79 0x0000555555814e31 in Ffuncall_interactively
     (nargs=2, args=0x7fffffffcd18)
     at callint.c:253
#80 0x000055555582143b in funcall_subr
     (subr=0x555555dec8e0 <Sfuncall_interactively>, numargs=2,
args=0x7fffffffcd18) at eval.c:2848
#81 0x0000555555820fc9 in Ffuncall
     (nargs=3, args=0x7fffffffcd10) at eval.c:2795
#82 0x000055555581760c in Fcall_interactively
     (function=..., record_flag=..., keys=...)
     at callint.c:779
#83 0x00005555558215bc in funcall_subr
     (subr=0x555555dec920 <Scall_interactively>, numargs=3,
args=0x7fffffffd0b0) at eval.c:2873
#84 0x0000555555820fc9 in Ffuncall
     (nargs=4, args=0x7fffffffd0a8) at eval.c:2795
#85 0x000055555587d61a in exec_byte_code
     (bytestr=..., vector=..., maxdepth=..., args_template=..., nargs=1,
args=0x7fffffffd600)
     at bytecode.c:632
#86 0x0000555555821815 in fetch_and_exec_byte_code (fun=...,
syms_left=..., nargs=1, args=0x7fffffff--Type <RET> for more, q to quit,
c to continue without paging--
d5f8) at eval.c:2917
#87 0x0000555555821cce in funcall_lambda
     (fun=..., nargs=1, arg_vector=0x7fffffffd5f8)
     at eval.c:2998
#88 0x000055555582100d in Ffuncall
     (nargs=2, args=0x7fffffffd5f0) at eval.c:2797
#89 0x00005555558207d8 in call1
     (fn=..., arg1=...) at eval.c:2655
#90 0x000055555573b7f3 in command_loop_1 ()
     at keyboard.c:1463
#91 0x000055555581cc20 in internal_condition_case
     (bfun=0x55555573af39 <command_loop_1>, handlers=...,
hfun=0x55555573a516 <cmd_error>)
     at eval.c:1356
#92 0x000055555573ab17 in command_loop_2
     (ignore=...) at keyboard.c:1091
#93 0x000055555581c045 in internal_catch
     (tag=..., func=0x55555573aaea <command_loop_2>, arg=...) at eval.c:1117
#94 0x000055555573aab6 in command_loop ()
     at keyboard.c:1070
#95 0x0000555555739ff9 in recursive_edit_1 ()
     at keyboard.c:714
#96 0x000055555573a1f5 in Frecursive_edit ()
     at keyboard.c:786
#97 0x0000555555735f3a in main
     (argc=1, argv=0x7fffffffdae8) at emacs.c:2047

The package for 'fontconfig' is

local/fontconfig 2:2.13.91+48+gfcb0420-2
     Library for configuring and customizing font access

For me, it's definitely a blocker for an upgrade to this new Emacs.
Maybe the issue is with 'fontconfig', in any case, would be nice to
understand what's happening here.  Please, advise.

Kind regards,
Alexander



Reply | Threaded
Open this post in threaded view
|

bug#43177: Bug: Emacs 27.1 hangs forever in `FcCharSetSubtractCount' from '/usr/lib/libfontconfig.so.1'

Robert Pluim
>>>>> On Thu, 3 Sep 2020 09:18:53 +0200, Alexander Shukaev <[hidden email]> said:

    Alexander> Hi,
    Alexander> With latest Emacs, I have a sporadic hang issue when either opening a
    Alexander> file or scrolling a buffer.  The best part is that it's impossible to
    Alexander> get break back to evaluation loop of Emacs even with 'USR2'
    Alexander> signal. That is when 'USR2' is sent, it does show "Entering
    Alexander> debugger...", though it remains frozen afterwards.  Resending 'USR2'
    Alexander> leads to the same outcome.  One thing is for certain, every time
    Alexander> 'USR2' is sent into such a hang, the stack traceback leads to
    Alexander> `FcCharSetSubtractCount' from '/usr/lib/libfontconfig.so.1':

If you've still got this in gdb, can you go to frame #6 and do

pp entity

(this is assuming you've sourced the .gdbinit in src/)

That will tell us which font weʼre trying to open. Perhaps itʼs a bad
font or fontconfig configuration.

Robert



Reply | Threaded
Open this post in threaded view
|

bug#43177: Acknowledgement (Bug: Emacs 27.1 hangs forever in `FcCharSetSubtractCount' from '/usr/lib/libfontconfig.so.1')

Alexander Shukaev-2
In reply to this post by Alexander Shukaev-2
Here is also a cleaner stack traceback, where I didn't issue 'USR2'
multiple times, but only one time:

Thread 1 "emacs" received signal SIGUSR2, User defined signal 2.
0x00007ffff6107823 in ?? () from /usr/lib/libfontconfig.so.1
(gdb) bt
#0  0x00007ffff6107823 in  () at /usr/lib/libfontconfig.so.1
#1  0x00007ffff61079b5 in  () at /usr/lib/libfontconfig.so.1
#2  0x00007ffff6107cc2 in  () at /usr/lib/libfontconfig.so.1
#3  0x00007ffff6107dee in  () at /usr/lib/libfontconfig.so.1
#4  0x00007ffff6108b82 in FcFontMatch () at /usr/lib/libfontconfig.so.1
#5  0x00005555558e523c in ftcrfont_open (f=0x5555564cfb40, entity=...,
pixel_size=18) at ftcrfont.c:137
#6  0x00005555558466c8 in font_open_entity (f=0x5555564cfb40,
entity=..., pixel_size=13) at font.c:2913
#7  0x0000555555848372 in font_open_for_lface (f=0x5555564cfb40,
entity=..., attrs=0x555556114b80, spec=...) at font.c:3350
#8  0x00005555558ead90 in fontset_find_font (fontset=..., c=30693,
face=0x555556114b80, charset_id=-1, fallback=false) at fontset.c:668
#9  0x00005555558eb440 in fontset_font (fontset=..., c=30693,
face=0x555556114b80, id=-1) at fontset.c:782
#10 0x00005555558ec00b in face_for_char (f=0x5555564cfb40,
face=0x555556114b80, c=30693, pos=257426, object=...) at fontset.c:996
#11 0x00005555555bd121 in FACE_FOR_CHAR (f=0x5555564cfb40,
face=0x555556114b80, character=30693, pos=257426, object=...) at
dispextern.h:1882
#12 0x00005555555db943 in get_next_display_element (it=0x7fffffff80c0)
at xdisp.c:7753
#13 0x0000555555610bda in display_line (it=0x7fffffff80c0,
cursor_vpos=1) at xdisp.c:23350
#14 0x0000555555601099 in try_window (window=..., pos=..., flags=0) at
xdisp.c:19297
#15 0x00005555555fcc94 in redisplay_window (window=...,
just_this_one_p=false) at xdisp.c:18448
#16 0x00005555555f4f38 in redisplay_window_0 (window=...) at xdisp.c:16429
#17 0x000055555581ccff in internal_condition_case_1 (bfun=0x5555555f4ef6
<redisplay_window_0>, arg=..., handlers=..., hfun=0x5555555f4ebe
<redisplay_window_error>) at eval.c:1380
#18 0x00005555555f4e92 in redisplay_windows (window=...) at xdisp.c:16409
#19 0x00005555555f4e44 in redisplay_windows (window=...) at xdisp.c:16403
#20 0x00005555555f37c4 in redisplay_internal () at xdisp.c:15877
#21 0x00005555555f1158 in redisplay () at xdisp.c:15099
#22 0x000055555573f13d in read_char (commandflag=1, map=...,
prev_event=..., used_mouse_menu=0x7fffffffd47d, end_time=0x0) at
keyboard.c:2493
#23 0x0000555555752a81 in read_key_sequence (keybuf=0x7fffffffd660,
prompt=..., dont_downcase_last=false, can_return_switch_frame=true,
fix_current_buffer=true, prevent_redisplay=false) at keyboard.c:9547
#24 0x000055555573b3d6 in command_loop_1 () at keyboard.c:1350
#25 0x000055555581cc20 in internal_condition_case (bfun=0x55555573af39
<command_loop_1>, handlers=..., hfun=0x55555573a516 <cmd_error>) at
eval.c:1356
#26 0x000055555573ab17 in command_loop_2 (ignore=...) at keyboard.c:1091
#27 0x000055555581c045 in internal_catch (tag=..., func=0x55555573aaea
<command_loop_2>, arg=...) at eval.c:1117
#28 0x000055555573aab6 in command_loop () at keyboard.c:1070
#29 0x0000555555739ff9 in recursive_edit_1 () at keyboard.c:714
#30 0x000055555573a1f5 in Frecursive_edit () at keyboard.c:786
#31 0x0000555555735f3a in main (argc=1, argv=0x7fffffffdae8) at emacs.c:2047




Reply | Threaded
Open this post in threaded view
|

bug#43177: Bug: Emacs 27.1 hangs forever in `FcCharSetSubtractCount' from '/usr/lib/libfontconfig.so.1'

Pip Cet
In reply to this post by Robert Pluim
On Thu, Sep 3, 2020 at 7:33 AM Robert Pluim <[hidden email]> wrote:

>
> >>>>> On Thu, 3 Sep 2020 09:18:53 +0200, Alexander Shukaev <[hidden email]> said:
>
>     Alexander> Hi,
>     Alexander> With latest Emacs, I have a sporadic hang issue when either opening a
>     Alexander> file or scrolling a buffer.  The best part is that it's impossible to
>     Alexander> get break back to evaluation loop of Emacs even with 'USR2'
>     Alexander> signal. That is when 'USR2' is sent, it does show "Entering
>     Alexander> debugger...", though it remains frozen afterwards.  Resending 'USR2'
>     Alexander> leads to the same outcome.  One thing is for certain, every time
>     Alexander> 'USR2' is sent into such a hang, the stack traceback leads to
>     Alexander> `FcCharSetSubtractCount' from '/usr/lib/libfontconfig.so.1':
>
> If you've still got this in gdb, can you go to frame #6 and do
>
> pp entity
>
> (this is assuming you've sourced the .gdbinit in src/)
>
> That will tell us which font weʼre trying to open. Perhaps itʼs a bad
> font or fontconfig configuration.

Is this bug #40733, maybe?

https://debbugs.gnu.org/cgi/bugreport.cgi?bug=40733



Reply | Threaded
Open this post in threaded view
|

bug#43177: Acknowledgement (Bug: Emacs 27.1 hangs forever in `FcCharSetSubtractCount' from '/usr/lib/libfontconfig.so.1')

Alexander Shukaev-2
In reply to this post by Alexander Shukaev-2
This is another stack when I open a file and it hangs, then I send 'ABRT':

Thread 1 "emacs" received signal SIGABRT, Aborted.
0x00007ffff5c0646f in poll () from /usr/lib/libc.so.6
(gdb) bt
#0  0x00007ffff5c0646f in poll () at /usr/lib/libc.so.6
#1  0x00007ffff6e2c7b4 in  () at /usr/lib/libxcb.so.1
#2  0x00007ffff6e2cb31 in  () at /usr/lib/libxcb.so.1
#3  0x00007ffff6e2a8c7 in  () at /usr/lib/libxcb.so.1
#4  0x00007ffff6e2c08f in  () at /usr/lib/libxcb.so.1
#5  0x00007ffff6e2c203 in xcb_wait_for_reply64 () at /usr/lib/libxcb.so.1
#6  0x00007ffff6e904b9 in _XReply () at /usr/lib/libX11.so.6
#7  0x00007ffff6e71e71 in  () at /usr/lib/libX11.so.6
#8  0x00007ffff6e7254e in XLoadQueryFont () at /usr/lib/libX11.so.6
#9  0x0000555555a8d875 in xfont_supported_scripts
     (display=0x555556594940, fontname=0x555564f03ae2 "-misc-cormorant
garamond-medium-i-normal--0-0-0-0-p-0-iso10646-1",
props=XIL(0x7ffff27926e5), encoding=0x7ffff23ab8d0) at xfont.c:266
#10 0x0000555555a8e5eb in xfont_list_pattern (display=0x555556594940,
pattern=0x7fffffff6450 "-*-*-*-*-*-*-*-*-*-*-*-*-iso10646-1",
registry=XIL(0x84c0), script=XIL(0x2aaa9c470db0)) at xfont.c:441
#11 0x0000555555a8e94d in xfont_list (f=0x5555564db330,
spec=XIL(0x7ffff2794475)) at xfont.c:486
#12 0x0000555555983724 in font_list_entities (f=0x5555564db330,
spec=XIL(0x555564e94e75)) at font.c:2794
#13 0x000055555598588c in font_find_for_lface (f=0x5555564db330,
attrs=0x555564a240b0, spec=XIL(0x55555688e725), c=-1) at font.c:3285
#14 0x0000555555ab4a23 in fontset_find_font
(fontset=XIL(0x555564e945c5), c=43695, face=0x555564a240b0,
charset_id=-1, fallback=false) at fontset.c:661
#15 0x0000555555ab514f in fontset_font (fontset=XIL(0x555564e93b45),
c=43695, face=0x555564a240b0, id=-1) at fontset.c:783
#16 0x0000555555ab5cff in face_for_char (f=0x5555564db330,
face=0x555564a240b0, c=43695, pos=38, object=XIL(0)) at fontset.c:997
#17 0x00005555555d0b96 in FACE_FOR_CHAR (f=0x5555564db330,
face=0x555564a240b0, character=43695, pos=38, object=XIL(0)) at
dispextern.h:1891
#18 0x00005555555f091a in get_next_display_element (it=0x7fffffff8040)
at xdisp.c:7651
#19 0x0000555555626aae in display_line (it=0x7fffffff8040,
cursor_vpos=9) at xdisp.c:23222
#20 0x0000555555617030 in try_window (window=XIL(0x5555564db575),
pos=..., flags=1) at xdisp.c:19182
#21 0x0000555555613c67 in redisplay_window (window=XIL(0x5555564db575),
just_this_one_p=false) at xdisp.c:18600
#22 0x000055555560aefd in redisplay_window_0
(window=XIL(0x5555564db575)) at xdisp.c:16314
#23 0x000055555594c082 in internal_condition_case_1 (bfun=0x55555560aebb
<redisplay_window_0>, arg=XIL(0x5555564db575),
handlers=XIL(0x7ffff279a6f3), hfun=0x55555560ae83 <redisplay_window_error>)
     at eval.c:1380
#24 0x000055555560ae55 in redisplay_windows (window=XIL(0x5555564db575))
at xdisp.c:16294
#25 0x000055555560ae06 in redisplay_windows (window=XIL(0x5555624922f5))
at xdisp.c:16288
#26 0x000055555560978e in redisplay_internal () at xdisp.c:15762
#27 0x000055555560712f in redisplay () at xdisp.c:14989
#28 0x00005555557e20ca in read_char (commandflag=1,
map=XIL(0x555564e79803), prev_event=XIL(0),
used_mouse_menu=0x7fffffffd3f5, end_time=0x0) at keyboard.c:2493
#29 0x00005555557f5a94 in read_key_sequence (keybuf=0x7fffffffd5e0,
prompt=XIL(0), dont_downcase_last=false, can_return_switch_frame=true,
fix_current_buffer=true, prevent_redisplay=false) at keyboard.c:9553
#30 0x00005555557de249 in command_loop_1 () at keyboard.c:1350
#31 0x000055555594bfa5 in internal_condition_case (bfun=0x5555557ddda4
<command_loop_1>, handlers=XIL(0x90), hfun=0x5555557dd370 <cmd_error>)
at eval.c:1356
#32 0x00005555557dd97c in command_loop_2 (ignore=XIL(0)) at keyboard.c:1091
#33 0x000055555594b3ea in internal_catch (tag=XIL(0xd530),
func=0x5555557dd94e <command_loop_2>, arg=XIL(0)) at eval.c:1117
#34 0x00005555557dd919 in command_loop () at keyboard.c:1070
#35 0x00005555557dce47 in recursive_edit_1 () at keyboard.c:714
#36 0x00005555557dd046 in Frecursive_edit () at keyboard.c:786
#37 0x00005555557d313e in main (argc=1, argv=0x7fffffffda68) at emacs.c:2062

Lisp Backtrace:
"redisplay_internal (C function)" (0x0)



Reply | Threaded
Open this post in threaded view
|

bug#43177: Bug: Emacs 27.1 hangs forever in `FcCharSetSubtractCount' from '/usr/lib/libfontconfig.so.1'

Alexander Shukaev-2
In reply to this post by Robert Pluim
Ah, just noticed your suggestion:

(gdb) pp entity
#<font-entity ftcrhb ADBO Adobe\ Blank nil iso10646-1 normal normal
normal 0 nil 100 0 ((:font-entity
"/usr/share/fonts/TTF/AdobeBlank-Regular.ttf" . 0))>




Reply | Threaded
Open this post in threaded view
|

bug#43177: Bug: Emacs 27.1 hangs forever in `FcCharSetSubtractCount' from '/usr/lib/libfontconfig.so.1'

Alexander Shukaev-2
/usr/share/fonts/TTF/AdobeBlank-Regular.ttf is owned by
ttf-google-fonts-git 20171026-1

I will try updating it now and see if it fixes the issue.  However, even
if it does, I have a bunch of follow-up questions:

1.  How to protect Emacs from having that issue again regardless of
broken/out-dated fonts?  Can I somehow, for example, exclude such fonts
from consideration by Emacs?
2.  Why was this font queried at all in the first place?  I don't use
this font.



Reply | Threaded
Open this post in threaded view
|

bug#43177: Bug: Emacs 27.1 hangs forever in `FcCharSetSubtractCount' from '/usr/lib/libfontconfig.so.1'

Robert Pluim
>>>>> On Thu, 3 Sep 2020 11:02:16 +0200, Alexander Shukaev <[hidden email]> said:

    Alexander> /usr/share/fonts/TTF/AdobeBlank-Regular.ttf is owned by
    Alexander> ttf-google-fonts-git 20171026-1

Looks like Pip's crystal ball was right, thatʼs the same font
impicated in Bug#40733

    Alexander> I will try updating it now and see if it fixes the issue.  However,
    Alexander> even if it does, I have a bunch of follow-up questions:

    Alexander> 1.  How to protect Emacs from having that issue again regardless of
    Alexander> broken/out-dated fonts?  Can I somehow, for example, exclude such
    Alexander> fonts from consideration by Emacs?

    face-ignored-fonts is a variable defined in `C source code'.
    Its value is nil

      Probably introduced at or before Emacs version 21.1.

    Documentation:
    List of ignored fonts.
    Each element is a regular expression that matches names of fonts to
    ignore.

    Alexander> 2.  Why was this font queried at all in the first place?  I don't use
    Alexander> this font.

You donʼt use it, but fontconfig know about it, so it queries it when
Emacs queries fontconfig for available fonts covering a certain
codepoint.

Robert



Reply | Threaded
Open this post in threaded view
|

bug#43177: Bug: Emacs 27.1 hangs forever in `FcCharSetSubtractCount' from '/usr/lib/libfontconfig.so.1'

Alexander Shukaev-2
On 03/09/2020 11:40, Alexander Shukaev wrote:

> (gdb) f 7
> #7  0x0000555555a8d875 in xfont_supported_scripts
> (display=0x555556594940, fontname=0x55556a79e428 "-misc-trirong
> medium-medium-i-normal--0-0-0-0-p-0-iso10646-1", props=XIL(0x7ffff27926e5),
>      encoding=0x7ffff23ab8d0) at xfont.c:266
> 266          xfont = XLoadQueryFont (display, fontname);
> (gdb) pp fontname
> #<INVALID_LISP_OBJECT 0x55556a79e428>
> (gdb) pp fontname
> #<INVALID_LISP_OBJECT 0x55556a79e428>
> (gdb) p fontname
> $3 = 0x55556a79e428 "-misc-trirong
> medium-medium-i-normal--0-0-0-0-p-0-iso10646-1"
> (gdb)

It appears to always be different `fontname' here as I try multiple
times to reproduce.  Maybe it's not really hanging but is merely
ultra-slow somehow in looping over the fonts here.  Any ideas?



Reply | Threaded
Open this post in threaded view
|

bug#43177: Bug: Emacs 27.1 hangs forever in `FcCharSetSubtractCount' from '/usr/lib/libfontconfig.so.1'

Alexander Shukaev-2
On 03/09/2020 11:50, Alexander Shukaev wrote:

> On 03/09/2020 11:40, Alexander Shukaev wrote:
>> (gdb) f 7
>> #7  0x0000555555a8d875 in xfont_supported_scripts
>> (display=0x555556594940, fontname=0x55556a79e428 "-misc-trirong
>> medium-medium-i-normal--0-0-0-0-p-0-iso10646-1",
>> props=XIL(0x7ffff27926e5),
>>      encoding=0x7ffff23ab8d0) at xfont.c:266
>> 266          xfont = XLoadQueryFont (display, fontname);
>> (gdb) pp fontname
>> #<INVALID_LISP_OBJECT 0x55556a79e428>
>> (gdb) pp fontname
>> #<INVALID_LISP_OBJECT 0x55556a79e428>
>> (gdb) p fontname
>> $3 = 0x55556a79e428 "-misc-trirong
>> medium-medium-i-normal--0-0-0-0-p-0-iso10646-1"
>> (gdb)
>
> It appears to always be different `fontname' here as I try multiple
> times to reproduce.  Maybe it's not really hanging but is merely
> ultra-slow somehow in looping over the fonts here.  Any ideas?

Hmm, right, waited for about a minute or so, and the file got opened
finally.  Reopening it was instant as well as if something got
cached/loaded already.  So any ideas how to speed things up here?  I
don't think I've encountered that with 26.3...



Reply | Threaded
Open this post in threaded view
|

bug#43177: Bug: Emacs 27.1 hangs forever in `FcCharSetSubtractCount' from '/usr/lib/libfontconfig.so.1'

Robert Pluim
In reply to this post by Robert Pluim
>>>>> On Thu, 3 Sep 2020 11:40:07 +0200, Alexander Shukaev <[hidden email]> said:
    Alexander> Right, so briefly testing, I think the scrolling hang is gone thanks to

    Alexander> (add-to-list 'face-ignored-fonts "Adobe.*Blank")

    Alexander> However, hang from opening certain files is still there and is also
    Alexander> font-related, though with a different symptom:

    Alexander> Thread 1 "emacs" received signal SIGABRT, Aborted.
    Alexander> 0x00007ffff5c0646f in poll () from /usr/lib/libc.so.6
    Alexander> (gdb) bt
    Alexander> #0  0x00007ffff5c0646f in poll () at /usr/lib/libc.so.6
    Alexander> #1  0x00007ffff6e2a63b in  () at /usr/lib/libxcb.so.1
    Alexander> #2  0x00007ffff6e2c08f in  () at /usr/lib/libxcb.so.1
    Alexander> #3  0x00007ffff6e2c203 in xcb_wait_for_reply64 () at /usr/lib/libxcb.so.1
    Alexander> #4  0x00007ffff6e904b9 in _XReply () at /usr/lib/libX11.so.6
    Alexander> #5  0x00007ffff6e71e71 in  () at /usr/lib/libX11.so.6
    Alexander> #6  0x00007ffff6e7254e in XLoadQueryFont () at /usr/lib/libX11.so.6
    Alexander> #7  0x0000555555a8d875 in xfont_supported_scripts
    Alexander>     (display=0x555556594940, fontname=0x55556a79e428 "-misc-trirong
    Alexander>     medium-medium-i-normal--0-0-0-0-p-0-iso10646-1",
    Alexander>     props=XIL(0x7ffff27926e5), encoding=0x7ffff23ab8d0)
    Alexander> at xfont.c:266

So this is the 'x' font backend, rather than the 'ftcr' font
backend, which I would not expect emacs to be falling back to. Do you
have any face/fontset customisations? Could you show them to us? (Iʼm
hoping youʼre not messing with the font-backend frame parameter anywhere)

Robert



Reply | Threaded
Open this post in threaded view
|

bug#43177: Bug: Emacs 27.1 hangs forever in `FcCharSetSubtractCount' from '/usr/lib/libfontconfig.so.1'

Alexander Shukaev-2
In reply to this post by Alexander Shukaev-2
On 03/09/2020 12:06, Robert Pluim wrote:

>>>>>> On Thu, 3 Sep 2020 11:53:05 +0200, Alexander Shukaev <[hidden email]> said:
>
>      Alexander> On 03/09/2020 11:50, Alexander Shukaev wrote:
>      >> On 03/09/2020 11:40, Alexander Shukaev wrote:
>      >>> (gdb) f 7
>      >>> #7  0x0000555555a8d875 in xfont_supported_scripts
>      >>> (display=0x555556594940, fontname=0x55556a79e428 "-misc-trirong
>      >>> medium-medium-i-normal--0-0-0-0-p-0-iso10646-1",
>      >>> props=XIL(0x7ffff27926e5),
>      >>>      encoding=0x7ffff23ab8d0) at xfont.c:266
>      >>> 266          xfont = XLoadQueryFont (display, fontname);
>      >>> (gdb) pp fontname
>      >>> #<INVALID_LISP_OBJECT 0x55556a79e428>
>      >>> (gdb) pp fontname
>      >>> #<INVALID_LISP_OBJECT 0x55556a79e428>
>      >>> (gdb) p fontname
>      >>> $3 = 0x55556a79e428 "-misc-trirong
>      >>> medium-medium-i-normal--0-0-0-0-p-0-iso10646-1"
>      >>> (gdb)
>      >> It appears to always be different `fontname' here as I try multiple
>      >> times to reproduce.  Maybe it's not really hanging but is merely
>      >> ultra-slow somehow in looping over the fonts here.  Any ideas?
>
>      Alexander> Hmm, right, waited for about a minute or so, and the file got opened
>      Alexander> finally.  Reopening it was instant as well as if something got
>      Alexander> cached/loaded already.  So any ideas how to speed things up here?  I
>      Alexander> don't think I've encountered that with 26.3...
>
> You can check easily enough by building emacs-27 --without-cairo, that
> should get you back to emacs-26's font handling.
>
> The issue is: why is Emacs falling back to the 'x' backend?
>
> Robert
>

The only related font configurations that I can think of are the following:

(defcustom init-font-families
   '("Powerline Consolas"
     "Consolas for Powerline"
     "Consolas"
     ;;
     "Powerline Inconsolata-g"
     "Inconsolata-g for Powerline"
     "Inconsolata-g"
     ;;
     "Powerline Source Code Pro"
     "Source Code Pro for Powerline"
     "Source Code Pro"
     ;;
     "Powerline DejaVu Sans Mono"
     "DejaVu Sans Mono for Powerline"
     "DejaVu Sans Mono"
     ;;
     "Monospace")
   "List of font families."
   :group 'init
   :type 'list)

(defcustom init-font-size
   12
   "Size of font."
   :group 'init
   :type 'integer)

   (defun init-frame-font-setup
       (&optional frame)
     (unless frame (setq frame (selected-frame)))
     (with-selected-frame frame
       (when (and (not noninteractive) (init-display-graphic-p))
         (let ((font (assoc 'font default-frame-alist)))
           (if font
               (when (eq frame frame-initial-frame)
                 (set-frame-font font t t)
                 (unless noninteractive
                   (message "Font: `%s'" font)))
             (let ((font-family (catch 'break
                                  (dolist (font-family init-font-families)
                                    (when (member font-family
                                                  (font-family-list))
                                      (throw 'break font-family))))))
               (setq font (when font-family
                            (format "%s-%d" font-family init-font-size))))
             (when font
               (add-to-list 'default-frame-alist `(font . ,font))
               (set-frame-font font t t)
               (unless noninteractive
                 (message "Font: `%s'" font))))))))

   (unless (or noninteractive (daemonp))
     (when (init-display-graphic-p)
       (init-frame-font-setup)))

   (dolist (hook '(after-make-frame-functions
                   focus-in-hook))
     (add-hook hook #'init-frame-font-setup))

With what I consistently get output

Font: ‘Consolas-12’

for several years already on various Linux systems that I'm using so far.



Reply | Threaded
Open this post in threaded view
|

bug#43177: Bug: Emacs 27.1 hangs forever in `FcCharSetSubtractCount' from '/usr/lib/libfontconfig.so.1'

Robert Pluim
>>>>> On Thu, 3 Sep 2020 12:24:30 +0200, Alexander Shukaev <[hidden email]> said:

    Alexander> The only related font configurations that I can think of are the following:

    Alexander> With what I consistently get output

    Alexander> Font: ‘Consolas-12’

    Alexander> for several years already on various Linux systems that I'm using so far.

OK. Is this happening on particular files? Is it possible they have
esoteric Unicode characters in them?

One other thing: do you have Symbola installed? Thatʼs the default
fallback font Emacs uses for symbols, if itʼs not found it needs to
search harder.

Robert



Reply | Threaded
Open this post in threaded view
|

bug#43177: Bug: Emacs 27.1 hangs forever in `FcCharSetSubtractCount' from '/usr/lib/libfontconfig.so.1'

Alexander Shukaev-2
On 03/09/2020 14:13, Robert Pluim wrote:

>>>>>> On Thu, 3 Sep 2020 12:24:30 +0200, Alexander Shukaev <[hidden email]> said:
>
>      Alexander> The only related font configurations that I can think of are the following:
>
>      Alexander> With what I consistently get output
>
>      Alexander> Font: ‘Consolas-12’
>
>      Alexander> for several years already on various Linux systems that I'm using so far.
>
> OK. Is this happening on particular files? Is it possible they have
> esoteric Unicode characters in them?
>
> One other thing: do you have Symbola installed? Thatʼs the default
> fallback font Emacs uses for symbols, if itʼs not found it needs to
> search harder.
>
> Robert
>

That file is indeed special because it has some Unicode:

ꪯ鵞

Symbola was there, though outdated, I just updated it.  Not sure if it's
related, but now that file loads somewhat faster, under 10 seconds roughly.



Reply | Threaded
Open this post in threaded view
|

bug#43177: Bug: Emacs 27.1 hangs forever in `FcCharSetSubtractCount' from '/usr/lib/libfontconfig.so.1'

Robert Pluim
>>>>> On Thu, 3 Sep 2020 14:28:58 +0200, Alexander Shukaev <[hidden email]> said:

    Alexander> On 03/09/2020 14:13, Robert Pluim wrote:
    >>>>>>> On Thu, 3 Sep 2020 12:24:30 +0200, Alexander Shukaev <[hidden email]> said:
    Alexander> The only related font configurations that I can
    >> think of are the following:
    Alexander> With what I consistently get output
    Alexander> Font: ‘Consolas-12’
    Alexander> for several years already on various Linux systems
    >> that I'm using so far.
    >> OK. Is this happening on particular files? Is it possible they have
    >> esoteric Unicode characters in them?
    >> One other thing: do you have Symbola installed? Thatʼs the default
    >> fallback font Emacs uses for symbols, if itʼs not found it needs to
    >> search harder.
    >> Robert
    >>

    Alexander> That file is indeed special because it has some Unicode:

    Alexander> ꪯ鵞

tai-viet and han scripts. My GNU/Linux build uses 'Noto Sans Tai Viet'
for the one, and 'Noto Sans CJK KR' for the other (both via the ftcr
backend), and thereʼs no slowdown. (you can use C-u C-x = to check).

    Alexander> Symbola was there, though outdated, I just updated it.  Not sure if
    Alexander> it's related, but now that file loads somewhat faster, under 10
    Alexander> seconds roughly.

I guess that depends if you have characters in there that are covered
by Symbola.

Robert



Reply | Threaded
Open this post in threaded view
|

bug#43177: Bug: Emacs 27.1 hangs forever in `FcCharSetSubtractCount' from '/usr/lib/libfontconfig.so.1'

Andreas Schwab-2
On Sep 03 2020, Robert Pluim wrote:

> tai-viet and han scripts. My GNU/Linux build uses 'Noto Sans Tai Viet'
> for the one, and 'Noto Sans CJK KR' for the other (both via the ftcr
> backend), and thereʼs no slowdown. (you can use C-u C-x = to check).

Do you have many fonts installed?

Andreas.

--
Andreas Schwab, [hidden email]
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."



Reply | Threaded
Open this post in threaded view
|

bug#43177: Bug: Emacs 27.1 hangs forever in `FcCharSetSubtractCount' from '/usr/lib/libfontconfig.so.1'

Robert Pluim
>>>>> On Thu, 03 Sep 2020 14:52:22 +0200, Andreas Schwab <[hidden email]> said:

    Andreas> On Sep 03 2020, Robert Pluim wrote:
    >> tai-viet and han scripts. My GNU/Linux build uses 'Noto Sans Tai Viet'
    >> for the one, and 'Noto Sans CJK KR' for the other (both via the ftcr
    >> backend), and thereʼs no slowdown. (you can use C-u C-x = to check).

    Andreas> Do you have many fonts installed?

fc-list | wc -l
2897

Is that a lot? I donʼt know; at some point I went through and made
sure I had all the fonts required to display etc/HELLO, which included
finding ones for Tai Viet.

Robert



Reply | Threaded
Open this post in threaded view
|

bug#43177: Bug: Emacs 27.1 hangs forever in `FcCharSetSubtractCount' from '/usr/lib/libfontconfig.so.1'

Eli Zaretskii
In reply to this post by Robert Pluim
> From: Robert Pluim <[hidden email]>
> Date: Thu, 03 Sep 2020 11:58:50 +0200
> Cc: [hidden email]
>
> So this is the 'x' font backend, rather than the 'ftcr' font
> backend, which I would not expect emacs to be falling back to.

Why do you think this is evidence of using the fallback backend?
AFAIR, when Emacs needs to find a font for a character, it loops over
all the fonts with all the available backends, and only later decides
which of the fonts to use.  Don't you see that if you type some
character unlikely to have been seen in an "emacs -Q" session?



Reply | Threaded
Open this post in threaded view
|

bug#43177: Bug: Emacs 27.1 hangs forever in `FcCharSetSubtractCount' from '/usr/lib/libfontconfig.so.1'

Andreas Schwab-2
In reply to this post by Robert Pluim
On Sep 03 2020, Robert Pluim wrote:

>>>>>> On Thu, 03 Sep 2020 14:52:22 +0200, Andreas Schwab <[hidden email]> said:
>
>     Andreas> On Sep 03 2020, Robert Pluim wrote:
>     >> tai-viet and han scripts. My GNU/Linux build uses 'Noto Sans Tai Viet'
>     >> for the one, and 'Noto Sans CJK KR' for the other (both via the ftcr
>     >> backend), and thereʼs no slowdown. (you can use C-u C-x = to check).
>
>     Andreas> Do you have many fonts installed?
>
> fc-list | wc -l
> 2897

$ fc-list | wc -l
11168

And there is a huge slowdown here.

Andreas.

--
Andreas Schwab, [hidden email]
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."



Reply | Threaded
Open this post in threaded view
|

bug#43177: Bug: Emacs 27.1 hangs forever in `FcCharSetSubtractCount' from '/usr/lib/libfontconfig.so.1'

Robert Pluim
>>>>> On Thu, 03 Sep 2020 15:28:45 +0200, Andreas Schwab <[hidden email]> said:

    Andreas> On Sep 03 2020, Robert Pluim wrote:
    >>>>>>> On Thu, 03 Sep 2020 14:52:22 +0200, Andreas Schwab <[hidden email]> said:
    >>
    Andreas> On Sep 03 2020, Robert Pluim wrote:
    >> >> tai-viet and han scripts. My GNU/Linux build uses 'Noto Sans Tai Viet'
    >> >> for the one, and 'Noto Sans CJK KR' for the other (both via the ftcr
    >> >> backend), and thereʼs no slowdown. (you can use C-u C-x = to check).
    >>
    Andreas> Do you have many fonts installed?
    >>
    >> fc-list | wc -l
    >> 2897

    Andreas> $ fc-list | wc -l
    Andreas> 11168

    Andreas> And there is a huge slowdown here.

Does it go away if you set font-backend . ftcrhb in your frame
parameters (assuming youʼre using Cairo)?

Robert



12