Bug 101740 - assertion ustring.h in rtl::OUString::operator[](sal_int32)const (debug)
Summary: assertion ustring.h in rtl::OUString::operator[](sal_int32)const (debug)
Status: VERIFIED DUPLICATE of bug 105103
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.3.0.0.alpha0+
Hardware: All Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Crash-Assert
  Show dependency treegraph
 
Reported: 2016-08-26 16:21 UTC by Terrence Enger
Modified: 2017-09-02 20:09 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
gdb with backtrace from assertion (33.44 KB, text/plain)
2016-08-26 16:21 UTC, Terrence Enger
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Terrence Enger 2016-08-26 16:21:23 UTC
Created attachment 127037 [details]
gdb with backtrace from assertion

STR
(1) Start Writer from command line.  Program opens document window
    "Untitled 1".
(2) Type "asdf<Enter>".  First line shows "Asdf" and caret is on
    second line.
(3) Type "<up><Insert><End>".  Status bar shows "Overwrite".
(4) Type "<Enter><space>".  Program crashes.

I am setting bug status NEW.  Note that the assertion can appear only
in dbgutil builds.
Comment 1 Julien Nabet 2016-08-29 21:20:09 UTC
On pc Debian x86-64 with master sources updated yesterday, I could reproduce this.
Comment 2 Julien Nabet 2016-08-29 21:22:45 UTC
With this patch, it doesn't crash:
diff --git a/sw/source/core/edit/acorrect.cxx b/sw/source/core/edit/acorrect.cxx
index afc4d18..82cdd33 100644
--- a/sw/source/core/edit/acorrect.cxx
+++ b/sw/source/core/edit/acorrect.cxx
@@ -163,7 +163,7 @@ bool SwAutoCorrDoc::ReplaceRange( sal_Int32 nPos, sal_Int32 nSourceLength, const
 
     // text attributes with dummy characters must not be replaced!
     bool bDoReplace = true;
-    sal_Int32 const nLen = rText.getLength();
+    sal_Int32 const nLen = pNd->GetText().getLength();
     for ( sal_Int32 n = 0; n < nLen; ++n )
     {
         sal_Unicode const Char = pNd->GetText()[n + nPos];

but don't know if it's the right fix.
Comment 3 Julien Nabet 2016-08-30 05:39:50 UTC
I finally submitted the patch to review, see https://gerrit.libreoffice.org/28475
Let's see...
Comment 4 Julien Nabet 2016-08-30 07:13:39 UTC
Badfully the patch makes unit tests fail.
Certainly someone may help here.
Comment 5 Terrence Enger 2016-10-07 14:16:30 UTC
The source line number is now 641.  I am removing the line number from
the summary.
Comment 6 Michael Stahl (allotropia) 2017-09-01 11:14:18 UTC
was fixed by commit 76dc7897b0efb1104dea56fe65d0aececab4eca0

*** This bug has been marked as a duplicate of bug 105103 ***
Comment 7 Terrence Enger 2017-09-02 20:09:13 UTC
I observe in daily Linux dbgutil bibisect repository version
2017-09-01 running on debian-stretch that the assertion is absent.  I
am setting status VERI FIXE.

Thank you, Michael, for bringing this to my attention.