Control: clone -1 -2 Control: reassign -1 gnuplot-qt,gnuplot-x11 Control: affects -1 - gnuplot-qt gnuplot-x11 Control: retitle -1 gnuplot: with GNUTERM=wxt, "gnuplot -persist" sometimes hangs with Pango 1.52+ (race condition) Control: tags -1 patch Control: retitle -2 libpango-1.0-0: Pango 1.52+ API+ABI breakage (affecting gnuplot in particular)
I've reassigned the initial bug instead of the cloned bug as I had reported the initial bug against gnuplot. On 2024-10-30 13:14:05 +0100, Vincent Lefevre wrote: > On 2024-09-17 14:55:47 +0200, Vincent Lefevre wrote: > > Control: found -1 1.54.0+ds-2 > > > > And this still occurs with the latest libpango-1.0-0 version > > when testing with > > > > echo 'set terminal wxt; plot x' | gnuplot -persist > > I think I've found the cause of the issue: strace shows that gnuplot > does an "exit_group(0)", which causes a Pango thread to terminate > unexpectedly. This is due to the fork in src/wxterminal/wxt_gui.cpp and the exit of the parent process. According to Matthias Clasen, pango_cairo_font_map_set_default(NULL); is needed before the fork to avoid the issue with the new Pango 1.52 code (which has changed the threading method). See https://gitlab.gnome.org/GNOME/pango/-/issues/784#note_2269462 https://gitlab.gnome.org/GNOME/pango/-/issues/784#note_2269810 I've tried the attached patch, and it seems to solve the issue, without any drawback. Concerning the Pango 1.52+ API+ABI breakage, the breakage is rather uncommon as it probably occurs only for code like with a fork + exit, but a soname bump seems to be needed anyway (this seems to be the same kind of issue as in libxml2, where Debian requested a soname bump - see https://gitlab.gnome.org/GNOME/libxml2/-/issues/751 about slight ABI changes). -- Vincent Lefèvre <vinc...@vinc17.net> - Web: <https://www.vinc17.net/> 100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/> Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)
Index: b/src/wxterminal/wxt_gui.cpp =================================================================== --- a/src/wxterminal/wxt_gui.cpp +++ b/src/wxterminal/wxt_gui.cpp @@ -4277,8 +4277,10 @@ void wxt_atexit() /* fork */ pid_t pid; - if (openwindows > 0) + if (openwindows > 0) { + pango_cairo_font_map_set_default(NULL); pid = fork(); + } else pid = -1;