Created attachment 156734 [details] Text which crashes Writer on replace 1. Open attached file in Writer 2. Ctrl+H 3. Find: $ 4. Replace with empty string; enable regular expressions 5. Replace All In current master, it shows an assertion; trying to ignore it shows another one, then LibreOffice crashes. --------------------------- Microsoft Visual C++ Runtime Library --------------------------- Debug Error! Program: C:\lo\src\core\instdir\program\soffice.bin abort() has been called (Press Retry to debug the application) --------------------------- Abort Retry Ignore --------------------------- Tested with Version: 6.5.0.0.alpha0+ (x64) Build ID: 876afccc7be4c708bd51f5892bdf9edec6820ea9 CPU threads: 12; OS: Windows 10.0 Build 18363; UI render: Skia/Raster; VCL: win; Locale: ru-RU (ru_RU); UI-Language: en-US Calc: CL This likely depends on first paragraph's length - more than 64 Ki characters (the text itself doesn't matter; the original was in ODT and some normal text).
Ah, the test document is irrelevant. Create a new text document; press Enter once to have 2 empty paragraphs; replace regex $ with empty string => crash.
Created attachment 156735 [details] bt with debug symbols On pc Debian x86-64 with master sources updated today + enable-dbgutil, I got an assert.
Michael: could you please take a look? The SwTextFrame::MapModelToViewPos code with the assert that own node must be passed to the function was added in https://git.libreoffice.org/core/+/c5abcfdf0c2e98c8f3445a92dd2d71eab23a7268 "sw_redlinehide: add TextFrameIndex type & SwTextFrame mapping functions" (2018-06-08). The two calls to the function from ReplaceBackReferences were added in https://git.libreoffice.org/core/+/5e81b966778d82692b4763d892b457186a7f269d "sw_redlinehide_4b: FindText() adapt the replace part as well" (2018-12-18). And the calls are guaranteed to pass a node other than the frame's node: they are made for a PaM that must start at end of a previous paragraph, and end at beginning of the next - for single "$" regex that is treated specially: see [1]. Simply commenting out the assert "solves" the problem. And release builds don't give crashes here (so I initially thought it's a regression in master, but now I suspect it only happens in debug builds). Could you see if this is OK, or does it actually violates some of your assumptions in the code? [1] https://help.libreoffice.org/latest/en-US/text/shared/01/02100001.html
Not reproducible in Version: 6.5.0.0.alpha0+ Build ID: 0322a41224a7264bbe03a068647ab093bcc88f90 CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; Locale: ca-ES (ca_ES.UTF-8); UI-Language: en-US Calc: threaded
(In reply to Julien Nabet from comment #2) > Created attachment 156735 [details] > bt with debug symbols > > On pc Debian x86-64 with master sources updated today + enable-dbgutil, I > got an assert. Moving to NEW
fixed on master
Michael Stahl committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/83122add64ecbf0fd3ba30368d5d87bde3dac278 tdf#129553 sw_redlinehide: fix replace of paragraph breaks with $ It will be available in 7.0.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.
Michael Stahl committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/796aeeb0f4c26824f3477b45e0d3bae9cf2c4648 tdf#129553 sw_redlinehide follow-up: simplify ReplaceBackReferences() It will be available in 7.0.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.
Michael Stahl committed a patch related to this issue. It has been pushed to "libreoffice-6-4": https://git.libreoffice.org/core/commit/988383d3dce56536082a639d5a8b0cc0a23da7c4 tdf#129553 sw_redlinehide: fix replace of paragraph breaks with $ It will be available in 6.4.2. 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.
Michael Stahl committed a patch related to this issue. It has been pushed to "libreoffice-6-3": https://git.libreoffice.org/core/commit/df88c042a978c4c14aa1c12fdbb106ec7a1190e9 tdf#129553 sw_redlinehide: fix replace of paragraph breaks with $ It will be available in 6.3.6. 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.