Multi-threading bug on GTK

Skip to first unread message

Neil Hodgson

Jul 5, 2022, 7:47:12 AMJul 5
to Scintilla mailing list,
Today I found a bug with multi-threaded text measurement for encodings other than UTF-8. Converter objects could be called by multiple threads without synchronization. This could lead to bad text placement and potentially writing to out-of-bounds memory. The problem has only been seen so far with binary files - not text files and occurred when I ran "SciTE scite/gtk/*” which opened a whole lot of files, ending up with “Widget.o” selected. There may be other requirements for the bug to occur such as text that isn’t valid in the selected encoding but I haven’t been able to narrow the problem down too far.

There is a potential fix committed but I’m not completely certain it is correct as it has changed conversion APIs and the new APIs could have different failure modes. There may also be performance differences - another thing not examined yet.

For now, GTK applications should disable multi-threaded layout. For Scintilla don’t call SCI_SETLAYOUTTHREADS or set it with the argument 1. For SciTE:

Reply all
Reply to author
0 new messages