Issue 119681 - Crash when undo a RegExp change
Summary: Crash when undo a RegExp change
Status: CLOSED FIXED
Alias: None
Product: Writer
Classification: Application
Component: editing (show other issues)
Version: 3.4.0
Hardware: PC All
: P3 Major (vote)
Target Milestone: 3.4.1
Assignee: Oliver-Rainer Wittmann
QA Contact:
URL:
Keywords: crash, regression
: 119526 120000 120130 (view as issue list)
Depends on:
Blocks:
 
Reported: 2012-06-01 21:29 UTC by rgb
Modified: 2012-07-25 09:07 UTC (History)
10 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---
jsc: 3.4.1_release_blocker+


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description rgb 2012-06-01 21:29:34 UTC
Tested with both, AOO 3.4.0 and a recent deb build for 3.4.1, on openSUSE 11.4, 64 bits.

On a Writer document, type several lines like 

Text
text
text
text
text
text
text
text
text
text

Now, open Search/Replace dialogue. On "Search for" type $, on "Replace by" a single space. Check "Regular expressions" under "More options" and hit "Replace all". Here comes a first problem: instead of a single line with all the words separated by a space, you get

Text 
texttext 
texttext 
texttext 
texttext 
text

Now the second problem: back to the document, hit Ctrl-Z a couple of times and you'll get a crash. 

Running from a terminal, I obtain a segment fault message for soffice on line 122:  7684 that ends with  "$sd_prog/$sd_binary" "$@"
Comment 1 Ariel Constenla-Haile 2012-06-02 04:23:10 UTC
According to the test I did for bug 119526 the cursor insertion point influences the behavior, if I change the cursor position before undoing as described in 
https://issues.apache.org/ooo/show_bug.cgi?id=119526#c3
the crash does not happen.
For example:
- type two lines:

Text
Text

- before replacing, the cursor position is at the end of the last line
- search and replace
- place the cursor at the beginning of the first line
- undo
There is no crash
Comment 2 Li Feng Wang 2012-06-12 08:12:26 UTC
can reproduce crash after double times Ctrl+Z, when cursor position at the end of text.

cursor position may have different behavior, learn it.
Comment 3 Ariel Constenla-Haile 2012-06-18 00:05:31 UTC
*** Issue 120000 has been marked as a duplicate of this issue. ***
Comment 4 Ariel Constenla-Haile 2012-06-18 00:06:58 UTC
Requesting release blocker status: it's a crash
Comment 5 Regina Henschel 2012-06-18 17:46:24 UTC
Write the content

Text
Text
Text

with cursor after the last word.
Call find&replace with
  search for $
  replace with blank
  RegExp checked
  backwards checked

A warning pops up:
To proceed with this action, you must first turn off the "undo" function. Do
you want to turn off the "undo" function?
   [ Yes ] [ No ] [Cancel]

Clicking "Yes" makes AOO hang with 100% CPU.
Comment 6 Regina Henschel 2012-06-18 18:43:11 UTC
In a debug build I get an endless loop containing the message:
Error: ### illegal index of sequence!
C:/AOO_2012_05_git_Calc/trunk/main/solver/340/wntmsci12/inc\com/sun/stat/uno/Sequence.hxx at Line 174

(The one backslash is no typo, but this way in the error message.)
Comment 7 Regina Henschel 2012-06-18 18:57:43 UTC
Doing as in 'Description' I get the error message:
Error: operator[]: Index ausserhalb
From File c:/AOO_2012_05_git_Calc/trunk/main/sw/source/core/bastyp/bparr.cxx at Line 138
Comment 8 binguo 2012-06-19 07:25:02 UTC
Verified it on Aoo_Trunk_20120616.1800.1350879 and it also reproduces.
Comment 9 Oliver-Rainer Wittmann 2012-06-19 14:40:28 UTC
I have reproduced the described two defects on Windows 7 in OOo 3.4 Beta and AOO 3.4
Comment 10 Oliver-Rainer Wittmann 2012-06-20 12:51:08 UTC
Investigation reveals that fix for bug 102333 causes this defect.

I will look for a solution which fits both - bug 102333 and this regression
Comment 11 jsc 2012-06-20 13:19:36 UTC
set 3.4.1 release blocker flag
Comment 12 Oliver-Rainer Wittmann 2012-06-20 13:23:46 UTC
Investigation reveals that for these Search&Replace use cases the code which has been removed by fix for bug 102333 is needed, while it is wrong for the use cases of bug 102333.

These use cases can be already distinguished internally.
Thus, I will bring back the removed code, but guarding it with corresponding conditions.
Comment 13 Oliver-Rainer Wittmann 2012-06-21 08:46:55 UTC
fixed on branch AOO34 - changed file:
/sw/source/core/doc/docedt.cxx, rev. 1352456
Comment 14 Oliver-Rainer Wittmann 2012-06-21 09:19:05 UTC
merged fix from branch AOO34 into trunk, revision 1352469
Comment 15 Oliver-Rainer Wittmann 2012-06-21 12:21:07 UTC
*** Issue 119526 has been marked as a duplicate of this issue. ***
Comment 16 Ariel Constenla-Haile 2012-07-01 15:03:05 UTC
*** Issue 120130 has been marked as a duplicate of this issue. ***
Comment 17 Li Feng Wang 2012-07-09 07:17:39 UTC
Verify steps:
1)New a Writer document
2)type servel strings, like 
test
test
test
test
3)Open Find/Replace dialog, 
4)On "Search for" type $, on "Replace by" a single space. 
5)Check "Regular expressions" under "More options"
6)Click "Replace ALL"
7)Ctrl+Z serval times.

result:
On WindowsXP with AOO341 branch 1354891
1)after step 6, a single line with all the words separated by a space
2)after step 7, no crash.
Comment 18 Li Feng Wang 2012-07-09 08:09:28 UTC
Verify steps:
1)New a Writer document
2)type servel strings, like 
test
test
test
test
3)Open Find/Replace dialog, 
4)On "Search for" type $, on "Replace by" a single space. 
5)Check "Regular expressions" under "More options"
6)Click "Replace ALL"
7)Ctrl+Z serval times.

result:
On WindowsXP with AOO341 branch 1354891
1)after step 6, a single line with all the words separated by a space
2)after step 7, no crash.
Comment 19 Li Feng Wang 2012-07-09 08:11:59 UTC
Suggest Regina Henschel to open another defect about AOO hang.
I also reproduce it.
Comment 20 Li Feng Wang 2012-07-18 08:12:26 UTC
Verified pass on trunk r1362376
Comment 21 jsc 2012-07-25 09:07:18 UTC
set target milestone AOO 3.4.1