Bug 155542 - checkGlyphsEqual assert on IS_UNSAFE_TO_BREAK inconsistency seen in crashtesting
Summary: checkGlyphsEqual assert on IS_UNSAFE_TO_BREAK inconsistency seen in crashtesting
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: graphics stack (show other bugs)
Version:
(earliest affected)
7.6.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: ⁨خالد حسني⁩
URL:
Whiteboard: target:7.6.0 target:7.5.5
Keywords:
Depends on:
Blocks: RTL-CTL Font-Rendering
  Show dependency treegraph
 
Reported: 2023-05-29 09:35 UTC by Caolán McNamara
Modified: 2023-05-30 13:53 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Caolán McNamara 2023-05-29 09:35:42 UTC
Description:
We have one document in crashtesting that triggers an assert in SalLayoutGlyphsCache::GetLayoutGlyphs which I attempted to debug in https://github.com/harfbuzz/harfbuzz/issues/3824 but ultimately came short

Steps to Reproduce:
1) revert
commit ede2b2e70c33754df6643b7eb505b4db1e7e872d
Author: Caolán McNamara <caolanm@redhat.com>
Date:   Tue Nov 22 17:03:46 2022 +0000

    crashtesting: restore workaround

2) wget https://bugs.documentfoundation.org/attachment.cgi?id=143959 -O ~/tdf119074-1.odt
3) ./instdir/program/soffice.bin --headless --convert-to pdf ~/tdf119074-1.odt

Actual Results:

vcl/source/gdi/impglyphitem.cxx:318: void checkGlyphsEqual(const SalLayoutGlyphs&, const SalLayoutGlyphs&): Assertion `l1->isLayoutEquivalent(l2)' failed.


Expected Results:
no assert failure


Reproducible: Always


User Profile Reset: No

Additional Info:
https://github.com/harfbuzz/harfbuzz/issues/3824 is related
Comment 1 ⁨خالد حسني⁩ 2023-05-29 15:19:31 UTC
I *think* I know what is going on. The code is creating a glyph subset that cut between a base character and a combining mark, this should have failed but it didn’t and it included the combing mark glyph into the subset because it have the same charPos as the base glyph (this probably couldn’t happen when this code was written, but this changed in 09c076c3f29c28497f162d3a5b7baab040725d56, indeed if I set the cluster level again the assert does not happen). Now when it chceks the layouts, the new layout does nit include the combining mark and the new glyphs are one short so it asserts.

This code is pretty complex and I need a bit more time to understand it, but we have GlyphItem flags IS_CLUSTER_START and IS_IN_CLUSTER to allow detecting such situations.
Comment 2 Commit Notification 2023-05-30 08:54:56 UTC
Khaled Hosny committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/bf8d1290a4de26f06d429148a92cbdb7a63eecf5

tdf#155542: Fix crashtesting assert

It will be available in 7.6.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 3 Caolán McNamara 2023-05-30 08:57:02 UTC
outcome looks good to me
Comment 4 Commit Notification 2023-05-30 12:34:22 UTC
Khaled Hosny committed a patch related to this issue.
It has been pushed to "libreoffice-7-5":

https://git.libreoffice.org/core/commit/03721a30cea9d640d15b9e6ee247c862ba080707

tdf#155542: Fix crashtesting assert

It will be available in 7.5.5.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 5 Commit Notification 2023-05-30 13:53:36 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/d669df25d2ac950da85e9d60074d059f9ef1459a

Related: tdf#155542 drop workaround for "XB Roya" issue

It will be available in 7.6.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.