Open font list causes crash (fc-list finds 4662)

Steps to reproduce:

  • Install a lot of fonts. I had a couple miscellaneous fonts, the Noto fonts, and the ofl folder of the Google free fonts. fc-list | wc -l reports 4662
  • Open Inkscape (text and font dialog should be closed at startup. If not, close and restart)
  • Switch to text tool
  • Open the font list

What happened?

Crash

(org.inkscape.Inkscape:30637): Gdk-ERROR **: 16:43:36.248: The program 'org.inkscape.Inkscape' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadAlloc (insufficient resources for operation)'.
  (Details: serial 4566 error_code 11 request_code 12 (core protocol) minor_code 0)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the GDK_SYNCHRONIZE environment
   variable to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)
Trace/breakpoint trap (core dumped)

%CPU at a bit over 100, %MEM at most 5 for inkscape

Backtrace: inkscape_backtrace_lots_of_fonts.txt
Truncated backtrace, not height at 32814:

#6  0x00007fffed67426b in _XSyncFunction (dpy=<optimised out>) at ../../src/Synchro.c:35
#7  0x00007fffed654c3c in XResizeWindow (dpy=0x5555557a9180, w=w@entry=106956313, width=width@entry=255, height=height@entry=32814) at ../../src/ChWindow.c:52
#8  0x00007fffeeb59b83 in window_x11_resize (height=32814, width=255, window=0x555555a6a340 [GdkX11Window]) at ../../../../../gdk/x11/gdkwindow-x11.c:1819
#9  0x00007fffeeb59b83 in gdk_window_x11_move_resize (window=0x555555a6a340 [GdkX11Window], with_move=<optimised out>, x=<optimised out>, y=<optimised out>, width=<optimised out>, height=<optimised out>) at ../../../../../gdk/x11/gdkwindow-x11.c:1903
#10 0x00007fffeeb35711 in gdk_window_move_resize_toplevel (height=32814, width=255, y=0, x=0, with_move=0, window=0x555555a6a340 [GdkX11Window])
    at ../../../../gdk/gdkwindow.c:5979
#11 0x00007fffeeb35711 in gdk_window_move_resize_internal (window=0x555555a6a340 [GdkX11Window], with_move=0, x=0, y=0, width=255, height=32814)
    at ../../../../gdk/gdkwindow.c:6046
#12 0x00007ffff48ce25d in gtk_window_move_resize (window=0x555558891a00 [GtkWindow]) at ../../../../gtk/gtkwindow.c:10144

@CRogers experienced a similar issue (well, same issue, different crash message, (Details: serial 22539 error_code 11 request_code 130 (MIT-SHM) minor_code 5), only 2863 fonts listed). see https://chat.inkscape.org/channel/team_devel?msg=dr2fiuHXfkQCkXfAB

Others were not able to replicate.
Including me (https://chat.inkscape.org/channel/team_devel?msg=YAsS2tuLYh57sm8ot), however I had screen tearing, and the following error message:

(inkscape:17930): Gdk-WARNING **: 10:45:05.095: Native Windows wider or taller than 32767 pixels are not supported

vlcsnap-screentearing

I can no longer replicate the screen tearing.

Workaround

Open the Text and Font Dialog first, or just

Have less fonts (4653 doesn't crash on my system)

Inkscape Version and Operating System:

  • Inkscape 1.1-dev (62bc4403ee, 2020-02-08) debug build Linux Mint 19.1, 4GB RAM,
  • Inkscape 1.1-dev (723e8342a7, 2020-02-07) debug build Linux Mint 19.3, 4GB RAM, fresh install.
  • Inkscape 1.1-dev (1:0.92.0+devel+202002071740+f637e67) ppa Linux Mint 19.3, 4GB RAM, fresh install
Assignee Loading
Time tracking Loading