1.17.6 on msys2 MINGW64, libcairo-2.dll call to DWrite.dll causing Segmentation fault
I have a crash when printing ( https://github.com/msys2/MINGW-packages/issues/15316 ) which as the backtrace below shows is pointing the finger to libcairo-2.dll calling DWrite.dll:
# gdb ./build/cherrytree.exe
GNU gdb (GDB) 12.1
...
Reading symbols from ./build/cherrytree.exe...
(gdb) r
Starting program: C:\msys64\home\PenoneG\git\cherrytree\build\cherrytree.exe
...
warning: Invalid parameter passed to C runtime function.
Thread 1 received signal SIGSEGV, Segmentation fault.
0x00007ffae80b5714 in ?? () from C:\Windows\SYSTEM32\DWrite.dll
(gdb) bt
#0 0x00007ffae80b5714 in ?? () from C:\Windows\SYSTEM32\DWrite.dll
#1 0x00007ffab1f4cbdd in _cairo_dwrite_scaled_font_create_win32_scaled_font (scaled_font=scaled_font@entry=0x195c50310a0, new_font=new_font@entry=0x343cbfd870)
at ../cairo-1.17.6/src/win32/cairo-dwrite-font.cpp:1721
#2 0x00007ffab1f4696c in _cairo_win32_printing_surface_show_glyphs (abstract_surface=0x195c30b14b0, op=CAIRO_OPERATOR_OVER, source=0x195c4e8c4a0, glyphs=0x343cbfdf50, num_glyphs=3,
scaled_font=0x195c50310a0, clip=0x0) at ../cairo-1.17.6/src/win32/cairo-win32-printing-surface.c:1919
#3 0x00007ffab1f16cbf in _cairo_surface_show_text_glyphs (surface=0x195c30b14b0, op=op@entry=CAIRO_OPERATOR_OVER, source=source@entry=0x195c50e4748, utf8=utf8@entry=0x0,
utf8_len=<optimized out>, utf8_len@entry=0, glyphs=glyphs@entry=0x343cbfdf50, num_glyphs=<optimized out>, num_glyphs@entry=3, clusters=clusters@entry=0x0, num_clusters=<optimized out>,
num_clusters@entry=0, cluster_flags=cluster_flags@entry=0, scaled_font=scaled_font@entry=0x195c50310a0, clip=clip@entry=0x0) at ../cairo-1.17.6/src/cairo-surface.c:2920
#4 0x00007ffab1f13d59 in _cairo_surface_wrapper_show_text_glyphs (wrapper=wrapper@entry=0x343cbfe850, op=CAIRO_OPERATOR_OVER, source=source@entry=0x195c50e4748, utf8=0x0, utf8_len=0,
glyphs=0x195c311efb0, num_glyphs=3, clusters=0x0, num_clusters=0, cluster_flags=0, scaled_font=0x195c50310a0, clip=0x0) at ../cairo-1.17.6/src/cairo-surface-wrapper.c:509
#5 0x00007ffab1f032f6 in _cairo_recording_surface_replay_internal (surface=0x195bd5df500, params=params@entry=0x343cbfe930) at ../cairo-1.17.6/src/cairo-recording-surface.c:1975
#6 0x00007ffab1f038d2 in _cairo_recording_surface_replay_region (surface=<optimized out>, surface_extents=surface_extents@entry=0x0, target=<optimized out>,
region=region@entry=CAIRO_RECORDING_REGION_NATIVE) at ../cairo-1.17.6/src/cairo-recording-surface.c:2235
#7 0x00007ffab1eea261 in _paint_page (surface=surface@entry=0x195c31498d0) at ../cairo-1.17.6/src/cairo-paginated-surface.c:469
#8 0x00007ffab1eea557 in _cairo_paginated_surface_show_page (abstract_surface=0x195c31498d0) at ../cairo-1.17.6/src/cairo-paginated-surface.c:583
#9 0x00007ffab1f16861 in cairo_surface_show_page (surface=0x195c31498d0) at ../cairo-1.17.6/src/cairo-surface.c:2506
#10 0x00007ffaaef094f9 in ?? () from C:\msys64\mingw64\bin\libgtk-3-0.dll
#11 0x00007ffaaedd8c27 in ?? () from C:\msys64\mingw64\bin\libgtk-3-0.dll
#12 0x00007ffaaedd94d3 in ?? () from C:\msys64\mingw64\bin\libgtk-3-0.dll
#13 0x00007ffab8133080 in ?? () from C:\msys64\mingw64\bin\libgdk-3-0.dll
#14 0x00007ffab43e9f31 in ?? () from C:\msys64\mingw64\bin\libglib-2.0-0.dll
#15 0x00007ffab43ed328 in ?? () from C:\msys64\mingw64\bin\libglib-2.0-0.dll
#16 0x00007ffab43ed7f0 in ?? () from C:\msys64\mingw64\bin\libglib-2.0-0.dll
#17 0x00007ffaaedd9de9 in ?? () from C:\msys64\mingw64\bin\libgtk-3-0.dll
#18 0x00007ffaafd03fbe in ?? () from C:\msys64\mingw64\bin\libgtkmm-3.0-1.dll
#19 0x00007ff6d8d9e142 in CtPrint::print_text(fs::path const&, std::vector<std::shared_ptr<CtPangoObject>, std::allocator<std::shared_ptr<CtPangoObject> > > const&) ()
#20 0x00007ff6d8d9e889 in CtExport2Pdf::node_export_print(fs::path const&, CtTreeIter, CtExportOptions const&, int, int) ()
#21 0x00007ff6d8cab73e in CtActions::_export_print(bool, fs::path const&, bool) ()
#22 0x00007ff6d8cac1bd in CtActions::export_print() ()
#23 0x00007ffad3207a9d in ?? () from C:\msys64\mingw64\bin\libglibmm-2.4-1.dll
#24 0x00007ffab43e9f31 in ?? () from C:\msys64\mingw64\bin\libglib-2.0-0.dll
#25 0x00007ffab43ed328 in ?? () from C:\msys64\mingw64\bin\libglib-2.0-0.dll
#26 0x00007ffab43ed62d in ?? () from C:\msys64\mingw64\bin\libglib-2.0-0.dll
#27 0x00007ffab7e74f2d in ?? () from C:\msys64\mingw64\bin\libgio-2.0-0.dll
#28 0x00007ff6d8fc18b3 in main ()
(gdb) q