Bug 79499 - EDITING: Crash on undo deletion
Summary: EDITING: Crash on undo deletion
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.2.4.2 release
Hardware: Other Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: BSA target:4.3.5
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-01 08:23 UTC by ThomasS
Modified: 2015-02-11 14:23 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
bt with symbols on 4.2 (3.63 KB, text/plain)
2014-06-01 10:00 UTC, Julien Nabet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ThomasS 2014-06-01 08:23:02 UTC
Problem description: 

- deleting words by pressing ctrl+backspace leads to an inconsistent result
- undo this operation will crash LibreOffice

Steps to reproduce:
1. Open a new Document in Writer
2. type in some spaces and then some text, eg. '    some text'
3. set the cursor to the beginning of the text, eg. '    |some text'
4. press crtl+backspace to delete the whole spaces
----
5. press ctrl+z to undo this operation

Current behavior:

in 4.: Writer deletes more than nescessary ('me text') and sets the cursor to the end of the line

in 5.: Writer crashes

Expected behavior:

in 4.: just deleting the spaces ('some text')

in 5.: undo the operation in 4.              
Operating System: Windows 7
Version: 4.2.4.2 release
Comment 1 Julien Nabet 2014-06-01 10:00:09 UTC
Created attachment 100227 [details]
bt with symbols on 4.2

On pc Debian x86-64 with 4.2 sources updated today, I got a crash just when doing Ctrl-Space
Comment 2 Julien Nabet 2014-06-01 10:00:56 UTC
I don't reproduce this with master sources (future 4.4.0) updated today but I reproduce the exact behavior with 4.2.4 LO Debian package.
Comment 3 Julien Nabet 2014-06-01 11:10:17 UTC
Michael: it seems 4.3 is too much different from 4.2 for this part.
For example for the bt I retrieved:
in function lcl_CalcBreaks from sw/source/core/doc/docedt.cxx
   1409     const sal_Int32 nStart(rPam.Start()->nContent.GetIndex())
nStart value is 0 in 4.3, -1 in 4.2
that's why I've got a segfault line 1416:
  1414     for (sal_Int32 i = nStart; i < nEnd; ++i)
  1415     {
  1416         const sal_Unicode c(pTxtNode->GetTxt()[i]);

After having checked this, I got another crash during Ctrl-backspace:
#4  0x00002aaaaad19255 in rtl_uString_newFromSubString (ppThis=0x7fffffff3c78, pFrom=0x1e700d0, beginIndex=65535, count=5)
    at /home/julien/compile-libreoffice/libo_4_2/sal/rtl/strtmpl.cxx:1269
#5  0x00002aaac8459a59 in rtl::OUString::copy (this=0x1601718, beginIndex=65535, count=5) at /home/julien/compile-libreoffice/libo_4_2/include/rtl/ustring.hxx:1483
#6  0x00002aaac8b31fd3 in SwUndoDelete::SaveCntnt (this=0x1ac8940, pStt=0x7fffffff41d0, pEnd=0x7fffffff4198, pSttTxtNd=0x1601660, pEndTxtNd=0x1601660)
    at /home/julien/compile-libreoffice/libo_4_2/sw/source/core/undo/undel.cxx:364
#7  0x00002aaac8b30d7b in SwUndoDelete::SwUndoDelete (this=0x1ac8940, rPam=SwPaM = {...}, bFullPara=0 '\000', bCalledByTblCpy=0 '\000')
    at /home/julien/compile-libreoffice/libo_4_2/sw/source/core/undo/undel.cxx:159
#8  0x00002aaac85a7d9d in SwDoc::DeleteRangeImplImpl (this=0x15f2b00, rPam=SwPaM = {...}) at /home/julien/compile-libreoffice/libo_4_2/sw/source/core/doc/docedt.cxx:1655
#9  0x00002aaac85a7660 in SwDoc::DeleteRangeImpl (this=0x15f2b00, rPam=SwPaM = {...}) at /home/julien/compile-libreoffice/libo_4_2/sw/source/core/doc/docedt.cxx:1565
#10 0x00002aaac85a758c in SwDoc::DeleteAndJoinImpl (this=0x15f2b00, rPam=SwPaM = {...}, bForceJoinNext=false)
    at /home/julien/compile-libreoffice/libo_4_2/sw/source/core/doc/docedt.cxx:1545
#11 0x00002aaac85a6e75 in lcl_DoWithBreaks(SwDoc &, SwPaM &, struct {...}, bool) (rDoc=..., rPam=SwPaM = {...}, pFunc=
    (bool (SwDoc::*)(SwDoc * const, SwPaM &, bool)) 0x2aaac85a753e <SwDoc::DeleteAndJoinImpl(SwPaM&, bool)>, bForceJoinNext=false)
    at /home/julien/compile-libreoffice/libo_4_2/sw/source/core/doc/docedt.cxx:1438
#12 0x00002aaac85a8462 in SwDoc::DeleteAndJoin (this=0x15f2b00, rPam=SwPaM = {...}, bForceJoinNext=false)
    at /home/julien/compile-libreoffice/libo_4_2/sw/source/core/doc/docedt.cxx:1783
#13 0x00002aaac87a7c2b in SwEditShell::DeleteSel (this=0x169e790, rPam=SwPaM = {...}, pUndo=0x7fffffff45ff "")
    at /home/julien/compile-libreoffice/libo_4_2/sw/source/core/edit/eddel.cxx:98

Any idea?
Comment 4 Caolán McNamara 2015-02-11 14:23:34 UTC
4-2 definitely crashes, but 4-3 has this fixed and there isn't going to be another 4-2 release so we can close this now