GNOME Bugzilla – Bug 695913
test-pangocairo-threads fails on Win32
Last modified: 2014-04-10 03:51:16 UTC
Hi, In the process of making the Win32 backend threadsafe, I was building and running the test-pangocairo-threads test program, which failed with the following output: -A whole bunch of messages, as the following line: (test-pangocairo-threads.exe:1312): Pango-WARNING **: All font fallbacks failed! !!! (the number "1312" is different with every run) -A message that says "image for thread 0 different from reference image." This means the issue mentioned in https://bugzilla.gnome.org/show_bug.cgi?id=377539#c73 is yet to be investigated and fixed :| With blessings, thank you!
Created attachment 238981 [details] image that indicates failure This is the image I get as output as the test failed.
I also checked under wine and get the same results. Don't know enough about the win32 backend to investigate right now.
Got the same results with Pango 1.36.1
Hi, It does seem more and more to me that Cairo needs to be dealt with on Windows in terms of thread safety (perhaps along with PangoWin32). I tried to update PangoWin32 for thread safety, but still failed by getting the same problem-looking back to it that FontMaps were used as a GPrivate in PangoCairo. Any further insights or observations would be great. With blessings, thank you!
I have no suggestions.
Hi, Upon some searching, it does seem that this is both a PangoWin32 issue and a Cairo-Win32 font issue[1], adapting the suggested patch from the given link [1] does make the test program fare better on Windows, at least I was able to run 30 consecutive runs of the test without crashing (previously the crashes reduced, but still occur intermittently), although the test still does fail. It's at least getting better, still striving forward for this. I will open a bug at Cairo's bugzilla for this. Well, Merry Christmas, and with blessings! [1]: http://lists.cairographics.org/archives/cairo/2010-July/020297.html
Hi, I have filed a bug against Cairo in https://bugs.freedesktop.org/show_bug.cgi?id=73012 for this issue. With blessings, thank you, and Merry Christmas!
Created attachment 269749 [details] [review] Improve the thread-safety situation in pangowin32-fontmap.c Hi, This is an attempt to improve the thread-safety situation on PangoWin32 by reading the aliases only during initialization of PangoWin32, and ensuring that it is only done once. Any suggestions on this patch is welcome-this does not yet make Pango thread-safe on Windows, but I think it at least improves the situation as the test-pangocairo-threads does not crash anymore, if used with the fix that I proposed for Cairo (in the link suggested by the patch's commit message). With blessings, thank you!
Comment on attachment 269749 [details] [review] Improve the thread-safety situation in pangowin32-fontmap.c >+ if (g_once_init_enter (&ht_loaded)) >+ { >+ if (pango_aliases_ht == NULL) >+ load_aliases (); >+ g_once_init_leave (&ht_loaded, 1); >+ } You only need a very short change, no mutex, etc. Just make load_aliases() return the hash-table instead of setting pango_aliases_ht directly, and then in lookup_aliases(), add g_once_init_* instead of the current: if (pango_aliases_ht == NULL) load_aliases ();
Created attachment 269871 [details] [review] Improve the thread-safety situation in pangowin32-fontmap.c (take ii) Hello Behdad, I saw your suggestions, so is this better for you? Thanks though, with blessings.
I pushed out a modified patch. Please test.
Hi Behdad, Just wondering, did I miss something? Just did a 'git pull origin master' on git.gnome.org/pango and the last patch was the patch I did for building introspection with Windows builds... Thanks very much though-just also wondering whether this patch from you is on Cairo? With blessings, thank you!
Oops. Pushed. Not sure what you meant re cairo.
Created attachment 273952 [details] [review] Fix the build of the pushed patch Hi Behdad, It seems to do the job, though PangoWin32 is not yet thread-safe (so I think it goes down to Cairo further, or so). I did, however, needed to update the patch as it had problems on pointer level indirection, that caused warnings/errors. Thanks very much, with blessings.
Fixed differently.