LO hangs on the following steps, if option LibreOffice Writer / Formatting Aids / Protected areas - Enable cursor is unchecked. Default is checked, so I set medium priority. Steps to reproduce: [1] Open a new text document. [2] Type enter to move to 2nd line [3] Insert letter "h" and set x¸heading on 2nd line. [4] Insert a Table of Contents in 1st line: Insert > Table of contents.. > Table of Contents.. > OK. Writer hangs. Seen with LO 7.1+. Option appeared in LO 4.3 and it worked then. Somewhat similar bug with LO 4.4, it crashes already on insert ToC.
Seems worse, another steps (with option unchecked): 1. open ODT with ToC like attachment 130778 [details] 2. right-click ToC Hangs.
On pc Debian x86-64 with master sources updated today, I could reproduce this. It seems LO loops here: https://opengrok.libreoffice.org/xref/core/sw/source/core/crsr/crsrsh.cxx?r=fb34aeb7#1846
I noticed 2 fishy parts: 1) 1799 bool bWasAllProtect = m_bAllProtect; 1800 m_bAllProtect = false; 1801 if( bWasAllProtect && GetDoc()->GetDocShell() && 1802 GetDoc()->GetDocShell()->IsReadOnlyUI() ) 1803 { 1804 GetDoc()->GetDocShell()->SetReadOnlyUI( false ); 1805 CallChgLnk(); // notify UI! 1806 } 1807 } Shouldn't we add "m_bAllProtect = bWasAllProtect;" before line 1807 ? 2) 1899 bool bWasAllProtect = m_bAllProtect; 1900 m_bAllProtect = false; 1901 if( bWasAllProtect && GetDoc()->GetDocShell() && 1902 GetDoc()->GetDocShell()->IsReadOnlyUI() ) 1903 { 1904 GetDoc()->GetDocShell()->SetReadOnlyUI( false ); 1905 CallChgLnk(); // notify UI! 1906 } 1907 m_bAllProtect = false; shouldn't it be m_bAllProtect = bWasAllProtect; ?
My 1st test and versions were in Windows. Now that I tried to Lin bibisect, simple steps from comment 2 are only seen from 7.1. 6795676ae6d8a45cde4ba64b763d1f3baf2e5be0 is the first bad commit Author: Jenkins Build User <tdf@pollux.tdf> Date: Sun Jul 5 21:23:26 2020 +0200 source 3b9aa11d885c91a3b040cb2b103b815c75d170bc previous source 25c1a9be773fd3248463bdbd64c30140ac0d2406 author Bjoern Michaelsen <bjoern.michaelsen@libreoffice.org> 2020-07-05 02:20:52 +0200 committer Bjoern Michaelsen <bjoern.michaelsen@libreoffice.org> 2020-07-05 13:24:17 +0200 commit 3b9aa11d885c91a3b040cb2b103b815c75d170bc (patch) tree 6d27ceaa5b4683214438523aacdd080f550c8893 parent 25c1a9be773fd3248463bdbd64c30140ac0d2406 (diff) GotoTOXMarkBase: SwIterator no more ... Change-Id: I60935850596eeb7209bd84782c954919c02cb259 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98050 Tested-by: Jenkins Reviewed-by: Bjoern Michaelsen <bjoern.michaelsen@libreoffice.org> CC: Bjoern. Please see this.
Hi Xisco.I hope you can check bibisect here.
I can confirm in 7.2+ master on Ubuntu 20.04. I also confirmed your 7.1 bibisect. Notice that before 7.1, the right-click was NOT bringing up the TOX-context menu, but just the general page-context menu. This is also true in various versions that I checked down through 4.3. So I did not see the hang earlier than 7.1 in linux either.
Created attachment 169137 [details] perf.svg: a flamegraph taken during the "hung" time. It looks like it is getting hung up in a do{...}while(bAgainst) loop in sw/source/core/crsr/crsrsh.cxx's SwCursorShell::UpdateCursor. Wow - I am a genius. I just reproduced what was already given in comment 3...
SwViewOption::IsIgnoreProtectedArea() means Enable Cursor is checked on. The TOX is protected because "Protected against manual changes". It probably is done via a GetProtect() property. But I will do no more here because only a Michael-Stahl-comparable person should touch something like this.
https://gerrit.libreoffice.org/c/core/+/124133
Reporting similar behavior: Version: 7.2.3.2 (x64) / LibreOffice Community Build ID: d166454616c1632304285822f9c83ce2e660fd92 CPU threads: 8; OS: Windows 10.0 Build 19044; UI render: Skia/Vulkan; VCL: win Locale: en-US (en_US); UI: en-US Calc: CL Steps to reproduce: 1) Open any Writer doc that already has any automated index table object created through Insert->Table of Contents and Index. 2) Tools->Options->LO Writer->Formatting Aids->Protected Areas->check 'Enable cursor' if not already checked. Note this Option setting is only available when a Writer doc is open. 3) Placing the cursor over an index table object should not generate any unusual behavior. If the index table object was defined for hyperlink functionality of its line entries then cntrl-click jump behavior should work. 4) Tools->Options->LO Writer->Formatting Aids->Protected Areas->UNcheck 'Enable cursor'. 5) Placing the cursor over an index table object or attempting the previously working cntrl-click hyperlink functionality will result in an LO spin hang that can only be killed via the Windows Task Manager or banging on the close window 'X.' Sometimes, merely applying OK in step 4 will cause a spin. Regards.
*** Bug 147793 has been marked as a duplicate of this bug. ***
(In reply to Timur from comment #1) > Seems worse, another steps (with option unchecked): > 1. open ODT with ToC like attachment 130778 [details] > 2. right-click ToC > Hangs. Hm, I couldnt reproduce this with current master. Can you recheck?
Seems fixed somewhere in 7.3.
Fixed with: commit b14f5424dde966fa3764a7e5c813dc727390354c [log] author Michael Stahl <michael.stahl@allotropia.de> Jan 10 2022 committer Thorsten Behrens <thorsten.behrens@allotropia.de>Jan 12 2022 tree 7b9780e859649bf0295d9695989225c03b294bca parent 20c819bf3bfd9d203f860f1fd078903d0b3945a7 [diff] tdf#146605 sw: try to fix SwSectionFormat notifications (regression from commit 2e32f4ed5af16a68c97a50806a42ffa2d10f1d7a)