IBBoard / cawbird

A fork of the Corebird GTK Twitter client that continues to work with Twitter
https://ibboard.co.uk/cawbird/
GNU General Public License v3.0
310 stars 37 forks source link

Pango assertion kills cawbird #410

Open j1warren opened 2 years ago

j1warren commented 2 years ago

Pango:ERROR:../pango/pango-layout.c:3991:process_line: assertion failed: (result == BREAK_SOME_FIT || result == BREAK_EMPTY_FIT) Bail out! Pango:ERROR:../pango/pango-layout.c:3991:process_line: assertion failed: (result == BREAK_SOME_FIT || result == BREAK_EMPTY_FIT) Aborted

When I scroll cawbird to load earlier tweets it dies. Started happening today, I guess some tweet breaks it.

v 1.4.2-1+8.1, ubuntu 20.04

IBBoard commented 2 years ago

What version of Pango are you running?

I think the warning is a coincidence, since Pango deals with text and the Instagram loading is a GTK image widget.

You'll probably find that the issue goes away as you get new tweets. There will be one in particular that causes it. FakeUnicode used to wreak havoc with text rendering, but they've not done it in a while. I only remember that causing huge, wide windows, though!

If you could try and work out where it is (e.g. load Cawbird, slowly scroll until it loads back, then check on Twitter and see whether anything in the 28 tweets before the last one that you saw before the crash looks like it's using awkward combinations of characters or anything.

j1warren commented 2 years ago

Not sure I can find the exact tweet now.

$ apt list | rg pango | rg installed
gir1.2-coglpango-1.0/focal,now 1.22.6-1 amd64 [installed,automatic]
gir1.2-pango-1.0/focal,now 1.44.7-2ubuntu4 amd64 [installed]
libcogl-pango20/focal,now 1.22.6-1 amd64 [installed]
libpango-1.0-0/focal,now 1.44.7-2ubuntu4 amd64 [installed]
libpango1.0-dev/focal,now 1.44.7-2ubuntu4 amd64 [installed,automatic]
libpangocairo-1.0-0/focal,now 1.44.7-2ubuntu4 amd64 [installed]
libpangoft2-1.0-0/focal,now 1.44.7-2ubuntu4 amd64 [installed]
libpangomm-1.4-1v5/focal,now 2.42.0-2build1 amd64 [installed,automatic]
libpangoxft-1.0-0/focal,now 1.44.7-2ubuntu4 amd64 [installed]
pango1.0-tools/focal,now 1.44.7-2ubuntu4 amd64 [installed,automatic]
IBBoard commented 2 years ago

Looks like the assert is part of the process_line function in Pango (src). Specifically, it got a BREAK_NONE_FIT result and tried to recurse and try differently, but got something other than BREAK_SOME_FIT or BREAK_EMPTY_FIT.

I think that means we hit a really long, ugly string and it didn't like it because it couldn't wrap it. But if it hit that in the tweet body then it should trigger the scrolling behaviour (which I put in because of FakeUnicode) and if it was in most other widgets (display name etc) then it should be ellipsising it.

Interestingly, the long tweet that I just tried gets hyphenated mid-word rather than scrolling. That's Pango 1.48 on openSUSE Tumbleweed, though, so they must have improved their wrapping algorithm.

This might be a hard one to find the trigger for 😕