Bug 150394

Summary: LibreOffice is crashing with long hyperlink on the last position (Don't hyphenate the last word)
Product: LibreOffice Reporter: BogdanB <buzea.bogdan>
Component: WriterAssignee: Not Assigned <libreoffice-bugs>
Status: VERIFIED FIXED    
Severity: major CC: buzea.bogdan, nemeth, serval2412
Priority: medium Keywords: haveBacktrace
Version: 7.4.0.0 alpha0+   
Hardware: All   
OS: All   
Whiteboard: target:7.5.0 target:7.4.1
Crash report or crash signature: Regression By:
Attachments: dmp file
demo document for testing
gdb bt

Description BogdanB 2022-08-13 09:17:33 UTC
Description:
1. Open the attached document (a simple paragraph ending with a long hyperlink)
2. Edit the Paragraph - Text Flow - Check "Don't hyphenate the last word"
3. CRASH

Steps to Reproduce:
See description

Actual Results:
CRASH

Expected Results:
NO CRASH


Reproducible: Always


User Profile Reset: Yes



Additional Info:
Version: 7.4.0.2 / LibreOffice Community
Build ID: 1512ce97d7ed39dce3121f7e15651fd8895f950e
CPU threads: 16; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
Calc: threaded
Comment 1 BogdanB 2022-08-13 09:23:51 UTC
Created attachment 181753 [details]
dmp file

Using dgb version I get this messages:

warn:legacy.osl:13258:13258:sw/source/core/text/guess.cxx:556: Deep cut
/opt/rh/devtoolset-7/root/usr/include/c++/7/debug/vector:417:
In function:
warn:desktop:13258:13258:desktop/source/app/crashreport.cxx:61: minidump generated: /home/bogdan/Documente/LibreOfficeDev_7.5.0.0.alpha0_Linux_x86-64_archive/program/../program/../libreofficedev/4/crash//9b47766d-9110-42ef-4575e69e-f42719d7.dmp

I have attached the .dmp file.
Comment 2 BogdanB 2022-08-13 09:25:29 UTC
Created attachment 181754 [details]
demo document for testing
Comment 3 Julien Nabet 2022-08-14 07:13:03 UTC
Created attachment 181766 [details]
gdb bt

On pc Debian x86-64 with master sources updated today, I could reproduce this.
Comment 4 Julien Nabet 2022-08-14 07:17:21 UTC
László: thought you might be interested in this one since it concerns hyphenation.

At the end of the bt, we see the values.
Also here's an extra info:
(gdb) p rInf
$5 = (SwDrawTextInfo &) @0x7ffef6d0be68: {m_pFrame = 0x555e74eee1d0, m_pOut = {m_rInnerRef = rtl::Reference to 0x555e74e0a5e0}, m_pSh = 0x555e74ec75f0, m_pScriptInfo = 0x555e74f4fd68, m_aPos = Point = {x = 0, 
    y = 0}, m_pCachedVclData = 0x555e74ffc620, 
  m_aText = "\tHe heard quiet steps behind him. That didn't bode well. Who could be following him this late at night and in this deadbeat part of town? And at this particular moment, just after he pulled off the bi"..., m_pWrong = 0x0, m_pGrammarCheck = 0x0, m_pSmartTags = 0x0, m_aSize = Size = {width = 0, height = 0}, m_pFnt = 0x555e782305a0, m_pUnderFnt = 0x0, m_pHyphPos = 0x0, m_nKanaDiff = 0, m_nIdx = {
    m_value = 1543}, m_nLen = {m_value = -1}, m_nOfst = 0, m_nWidth = 0, m_nAscent = 0, m_nCompress = 0, m_nCharacterSpacing = 0, m_nSpace = 0, m_nKern = 0, m_nNumberOfBlanks = {m_value = 0}, 
  m_nCursorBidiLevel = 0 '\000', m_bBullet = false, m_bUpper = false, m_bDrawSpace = false, m_bGreyWave = false, m_bSpaceStop = false, m_bSnapToGrid = true, m_bIgnoreFrameRTL = false, 
  m_bPosMatchesBounds = false, m_bPos = false, m_bWrong = false, m_bGrammarCheck = false, m_bSize = false, m_bFnt = true, m_bHyph = false, m_bKana = true, m_bOfst = false, m_bAscent = false, 
  m_bCharacterSpacing = false, m_bSpace = false, m_bNumberOfBlanks = false, m_bUppr = false, m_bDrawSp = false}
Comment 5 Commit Notification 2022-08-18 09:47:39 UTC
László Németh committed a patch related to this issue.
It has been pushed to "master":

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

tdf#150394 sw: fix crash of "Don't hyphenate last word"

It will be available in 7.5.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 6 BogdanB 2022-08-18 09:56:19 UTC
Wow, so fast, less than a week from initial report.
Thank you.
Comment 7 László Németh 2022-08-18 10:12:18 UTC
(In reply to BogdanB from comment #6)
> Wow, so fast, less than a week from initial report.
> Thank you.

@Bogdan: thanks for your bug report and feedback!
Comment 8 László Németh 2022-08-18 10:13:22 UTC
@Julien: thanks for CCing and backtracking!
Comment 9 Commit Notification 2022-08-19 05:59:49 UTC
László Németh committed a patch related to this issue.
It has been pushed to "libreoffice-7-4":

https://git.libreoffice.org/core/commit/301c94a73b96c45cb4bf6ed23b7626cb43a98605

tdf#150394 sw: fix crash of "Don't hyphenate last word"

It will be available in 7.4.1.

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 10 BogdanB 2022-08-23 11:54:44 UTC
Verified, ok in
Version: 7.5.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 5ac75131556b687a01517ce4520a05bb49c1d840
CPU threads: 4; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: ro-RO (ro_RO); UI: en-US
Calc: threaded

Was not ok in
Version: 7.4.0.2 (x64) / LibreOffice Community
Build ID: 1512ce97d7ed39dce3121f7e15651fd8895f950e
CPU threads: 4; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: ro-RO (ro_RO); UI: en-US
Calc: threaded
Comment 11 László Németh 2022-09-08 11:04:14 UTC
(In reply to BogdanB from comment #10)
> Verified, ok in
> Version: 7.5.0.0.alpha0+ (x64) / LibreOffice Community
> Build ID: 5ac75131556b687a01517ce4520a05bb49c1d840
> CPU threads: 4; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL:
> win
> Locale: ro-RO (ro_RO); UI: en-US
> Calc: threaded
> 
> Was not ok in
> Version: 7.4.0.2 (x64) / LibreOffice Community
> Build ID: 1512ce97d7ed39dce3121f7e15651fd8895f950e
> CPU threads: 4; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL:
> win
> Locale: ro-RO (ro_RO); UI: en-US
> Calc: threaded

@Bogdan: thanks for your feedback!