Crash in Pango 1.44.5 (related to line wrapping)
Pango 1.44.5 crashes when wrapping certain inputs. It appears to be because the start and end indices of the wrapped lines don't line up with UTF8 characters. It doesn't happen with all inputs, it's actually quite rare. After downgrading to 1.43.0 the problem disappeared.
I have attached an example. In the example, I add a Shape attribute to every character. I don't know if this is actually important. If I don't add the attributes, the error doesn't occur, but that may just be because the lines wrap at different positions. In case you are wondering why anybody would do this, the answer is that I tried to condense the code down as much as possible. Of course my real code is more complicated.
Compile with gcc $(pkg-config --libs --cflags pango cairo pangocairo) -g pangobug.c
The output looks like this on my machine:
./a.out
UTF8 string is valid.
Line 6: Invalid line boundaries. [433, 510)
Line 7: Invalid line boundaries. [510, 581)
Line 8: Invalid line boundaries. [581, 637)
Line 9: Invalid line boundaries. [637, 704)
Line 10: Invalid line boundaries. [704, 725)
Line 11: Invalid line boundaries. [725, 786)
Line 12: Invalid line boundaries. [786, 826)
[1] 1043 segmentation fault (core dumped) ./a.out