Closed quarcko closed 7 months ago
Could it be that Qt 6.5.3 is linked against libicu 56 and while building webkit it linked agains system libicu 70 ?
and now when running
ldd libQt6WebKit.so.6.212.0 | grep libicu
i get this:
libicui18n.so.70 => /lib/x86_64-linux-gnu/libicui18n.so.70 (0x00007f44d3c00000)
libicuuc.so.70 => /lib/x86_64-linux-gnu/libicuuc.so.70 (0x00007f44d3a05000)
libicui18n.so.56 => /program_files/Qt-6.5.3/6.5.3/gcc_64/lib/libicui18n.so.56 (0x00007f44d2600000)
libicuuc.so.56 => /program_files/Qt-6.5.3/6.5.3/gcc_64/lib/libicuuc.so.56 (0x00007f44d2200000)
libicudata.so.56 => /program_files/Qt-6.5.3/6.5.3/gcc_64/lib/libicudata.so.56 (0x00007f44d0800000)
libicudata.so.70 => /lib/x86_64-linux-gnu/libicudata.so.70 (0x00007f44cea00000)
So it happens libICU has probably nothing to do with it. The issue is probably with libharfbuzz: Because QT under the hood uses libharfbuzz-ng 8.3.0 and system one is 2.xx something. And most probably when face is extracted from QFontEngine is incompatible struct or something. So here is what helps:
//Extract a blob from hb_face_t which is returned from QT's version of harfbuzz
NakedPtr<hb_blob_t> blob = hb_face_reference_blob (hb_qt_face_get_for_engine(fe));
//Use that blob to re-created face and font.
NakedPtr<hb_face_t> face(hb_face_create(blob.get(), 0));
NakedPtr<hb_font_t> harfBuzzFont(hb_font_create(face.get()));
and no more crashing. but: webpages look terribly:
As far as i tested: if webpage explicitly sets ifs own font - then it is displayed great But if webpage is relaying on some system font - then you see result in screenshot.
What can be done further?
Ok, so after adding this code after creating Face and Font:
const float size = fontPlatformData.size();
if (floorf(size) == size)
hb_font_set_ppem(harfBuzzFont.get(), size, size);
int scale = floatToHarfBuzzPosition(size);
hb_font_set_scale(harfBuzzFont.get(), scale, scale);
rendering is fixed and QtTestBrowser displays web pages correctly.
Dear Webkit maintainers,
As we are moving towards updating QT Framework - and badly need webkit, we tried to build this repos branch "qt6" using QT 6.5.3 version of Qt. so firstly few notes:
1) We fixed all compilation errors for TOUCH and GESTURE_EVENTS 2) QT6 OPENGL is undetectable - but we dont needed (info just in case it is important to this crash) 3) There was a small fix inside Path.c where returning "platformPath" crashed inside QPainterPath constructor.
If needed i can upload all the fixes to you later on, but main problem is, that while trying to render page webkit crashes like this:
Thread 1 "QtTestBrowser" received signal SIGSEGV, Segmentation fault.
hb_blob_ptr_t<OT::GSUB>::get (this=<optimized out>) at ../../src/hb-blob.hh:88 88 ../../src/hb-blob.hh: No such file or directory.
`
1 hb_blob_ptr_t::operator* (this=) at ../../src/hb-blob.hh:85
85 in ../../src/hb-blob.hh `
`
2 get_gsubgpos_table (face=0x7fffe8fc7560 <_hb_Null_hb_font_t>, table_tag=) at ../../src/hb-ot-layout.cc:403
403 ../../src/hb-ot-layout.cc: No such file or directory. `
`
3 0x00007fffe75869b9 in hb_ot_layout_table_find_feature_variations (face=, table_tag=,
1262 in ../../src/hb-ot-layout.cc `
`
4 0x00007fffe75b529a in hb_ot_shape_plan_key_t::init (num_coords=0, coords=0x3ed0000080000000, face=0x7fffe8fc7560 <_hb_Null_hb_font_t>,
45 ../../src/hb-ot-shape.hh: No such file or directory. `
`
5 hb_shape_plan_key_t::init (this=this@entry=0x555555922be8, copy=copy@entry=true, face=face@entry=0x7fffe8fc7560 <_hb_Null_hb_font_t>,
90 ../../src/hb-shape-plan.cc: No such file or directory. `
`
6 0x00007fffe75b57a2 in hb_shape_plan_create2 (face=face@entry=0x7fffe8fc7560 <_hb_Null_hb_font_t>, props=props@entry=0x555555922aa8,
248 in ../../src/hb-shape-plan.cc `
`
7 0x00007fffe75b94a4 in hb_shape_plan_create_cached2 (face=0x7fffe8fc7560 <_hb_Null_hb_font_t>, props=props@entry=0x555555922aa8,
555 in ../../src/hb-shape-plan.cc `
`
8 0x00007fffe75b9522 in hb_shape_full (font=0x555555731f50, buffer=0x555555922a70, features=0x0, num_features=0, shaper_list=)
135 ../../src/hb-shape.cc: No such file or directory. `
`
9 0x00007fffed5a3cc6 in WebCore::ComplexTextController::collectComplexTextRunsForCharacters (this=0x7fffffff70d0,
435 hb_shape(harfBuzzFont.get(), buffer.get(), nullptr, 0); `
Also, enabled qDEBUG (that was put by someone of you):
void WebCore::ComplexTextController::collectComplexTextRunsForCharacters(const UChar*, unsigned int, unsigned int, const WebCore::Font*) 400 0x555555709050 4 void WebCore::ComplexTextController::collectComplexTextRunsForCharacters(const UChar*, unsigned int, unsigned int, const WebCore::Font*) 402 hb_qt_font_get_for_engine 0x555555731f50 void WebCore::ComplexTextController::collectComplexTextRunsForCharacters(const UChar*, unsigned int, unsigned int, const WebCore::Font*) 403 0x7fffe8fc7560 void WebCore::ComplexTextController::collectComplexTextRunsForCharacters(const UChar*, unsigned int, unsigned int, const WebCore::Font*) 405 0x555555a9d0c0 void WebCore::ComplexTextController::collectComplexTextRunsForCharacters(const UChar*, unsigned int, unsigned int, const WebCore::Font*) 406 hb_qt_face_get_for_engine 0x555555a9d0c0 void WebCore::ComplexTextController::collectComplexTextRunsForCharacters(const UChar*, unsigned int, unsigned int, const WebCore::Font*) 407 0x555555731f50 void WebCore::ComplexTextController::collectComplexTextRunsForCharacters(const UChar*, unsigned int, unsigned int, const WebCore::Font*) 408 0x7fffe8fc7560 void WebCore::ComplexTextController::collectComplexTextRunsForCharacters(const UChar*, unsigned int, unsigned int, const WebCore::Font*) 411 0x555555a9d0c0 void WebCore::ComplexTextController::collectComplexTextRunsForCharacters(const UChar*, unsigned int, unsigned int, const WebCore::Font*) 412 0x555555731f50 void WebCore::ComplexTextController::collectComplexTextRunsForCharacters(const UChar*, unsigned int, unsigned int, const WebCore::Font*) 413 0x7fffe8fc7560
I have no knowledge of libharfbuzz and don't understand why it happens, maybe here are some alive people that might guide me in correct direction, so i could fix the issue.
Lets soleve it and I will contribute back to the project with all that was already done + what's left to do.