Bug 118517 - Adding long entry to Autocorrect replace table causes a crash ( steps on comment 6 )
Summary: Adding long entry to Autocorrect replace table causes a crash ( steps on comm...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.1.0.0.alpha0+
Hardware: All All
: high critical
Assignee: Xisco Faulí
URL:
Whiteboard: target:6.2.0 target:6.1.1 target:6.1.0
Keywords: bibisected, bisected, haveBacktrace, regression
Depends on:
Blocks: AutoCorrect-Complete
  Show dependency treegraph
 
Reported: 2018-07-03 09:12 UTC by Elmar
Modified: 2018-07-27 08:08 UTC (History)
5 users (show)

See Also:
Crash report or crash signature: ["SwXMLTextBlocks::GetBlockText(rtl::OUString const &,rtl::OUString &)"]


Attachments
text for autocorrect (24.45 KB, application/vnd.oasis.opendocument.text)
2018-07-03 09:18 UTC, Elmar
Details
GDB trace of crash with master (30.25 KB, text/plain)
2018-07-15 14:38 UTC, Buovjaga
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Elmar 2018-07-03 09:12:06 UTC
Description:
I prefer to use Autokey rather than AutoCorrect (although, I still use AutoCorrect as well.
LO Writer crashed when I attempted to save a formatted set of text

Steps to Reproduce:
1. Copy formatted text from an email message (i was using Thunderbird)
2. Select AutoCorrect, Options save to [all]
3. paste text, save


Actual Results:
LO crashes

Expected Results:
To be warned that cannot save that.


Reproducible: Always


User Profile Reset: No



Additional Info:
[Information automatically included from LibreOffice]
Locale: en-US
Module: TextDocument
[Information guessed from browser]
OS: Linux (All)
OS is 64bit: yes
Version: 6.2.0.0.alpha0+
Build ID: b30b4e9c7c492542e1ae726e2e45627ee33f7cd5
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk2; 
TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:master, Time: 2018-07-02_00:46:33
Locale: en-GB (en_ZA.UTF-8); Calc: group threaded


What I attempted to store was in the attached doc
Comment 1 Elmar 2018-07-03 09:18:07 UTC
Created attachment 143282 [details]
text for autocorrect
Comment 2 Elmar 2018-07-03 09:28:40 UTC
For example, if I create an entry in Autokey, like this:
1. ejr- with correction as "Elmar" , (excluding the "") or 
2. ejr= to be "Elmar Josef Roberg"
3. pmbok- should be PMBOK® 
4. pmbok= should be Project Management Body of Knowledge 
5. pmi- should be PMI®
6. pmi= should be Project Management Institute, Inc.

then here in Firefox and text editor and other tools comes out right (as in the examples above)

I cannot figure out the logic in LO, it does this (with the same text as above):
1. ejr- E
2. Elmar Josef Roberg 
3. pmPMBOK
4. pProject Management Body of Knowledge
5. pmiP
6. Project Management Institute, Inc.
Comment 3 Buovjaga 2018-07-15 14:38:45 UTC
Created attachment 143561 [details]
GDB trace of crash with master

Copied the text to Autocorrect Options "Replace" tab "With" field and gave some string to "Replace" field, New, OK.

Arch Linux 64-bit
Version: 6.2.0.0.alpha0+
Build ID: 860a9daf2b45942a4b10ff22d36aa3fe29be19f4
CPU threads: 8; OS: Linux 4.17; UI render: default; VCL: gtk3; 
Locale: fi-FI (fi_FI.UTF-8); Calc: group threaded
Built on July 14th 2018
Comment 4 Buovjaga 2018-07-15 14:59:33 UTC
Bisected with Win 6.1 repo to https://cgit.freedesktop.org/libreoffice/core/commit/?id=0f166ef5240ee155bf2544e6bc3c985b1e3bf646

cppcheck - fix variableScope in some files
Reduced the scope of some variables in source.

It includes a change to editeng/source/misc/svxacorr.cxx

Adding Cc: to Gökhan Gurbetoğlu
Comment 5 Xisco Faulí 2018-07-23 19:43:21 UTC
@Julien, I thought you could be interested in this issue....
Comment 6 Xisco Faulí 2018-07-23 19:57:45 UTC
Steps to reproduce:
1. Open the attached document
2. Select all
3. Copy
4. Go to tools - Autocorrect - Autocorrect Options
5. Add some text to Replace textbox
6. Click on New
7. Click Ok
Comment 7 Xisco Faulí 2018-07-23 20:04:12 UTC
patch in gerrit: https://gerrit.libreoffice.org/#/c/57881/
Comment 8 Commit Notification 2018-07-24 06:53:52 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=a61d61f66f80c91c14825f8fe8fb9bd3f295591b

tdf#118517: Use xStg before resetting it

It will be available in 6.2.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 9 Commit Notification 2018-07-24 13:18:02 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "libreoffice-6-1":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=1706ed7334461420274584b875ae6ab209f4dad9&h=libreoffice-6-1

tdf#118517: Use xStg before resetting it

It will be available in 6.1.1.

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

Affected users are encouraged to test the fix and report feedback.
Comment 10 Commit Notification 2018-07-27 08:08:09 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "libreoffice-6-1-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=28f8e7434065e040e17562014db3624a8d3cd6ea&h=libreoffice-6-1-0

tdf#118517: Use xStg before resetting it

It will be available in 6.1.0.

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

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