Bug 73698

Summary: Print "Hello World!" crash
Product: LibreOffice Reporter: Andras Timar <timar74>
Component: BASICAssignee: Andras Timar <timar74>
Status: RESOLVED FIXED    
Severity: normal CC: lgodard.libre, serval2412
Priority: medium    
Version: 4.2.0.2 rc   
Hardware: Other   
OS: All   
Whiteboard: target:4.3.0
Crash report or crash signature: Regression By:
Attachments: bt with symbols

Description Andras Timar 2014-01-16 11:51:14 UTC
Sub Main
    Print "Hello World!"
End Sub

This simple macro crashes LibreOffice 4.2 and master (dbgutil build).

soffice.bin: /home/timar/libreoffice-4-2/include/rtl/ustring.hxx:421: sal_Unicode rtl::OUString::operator[](sal_Int32) const: Assertion `index >= 0 && static_cast<sal_uInt32>(index) < static_cast<sal_uInt32>(getLength())' failed.
Comment 1 Julien Nabet 2014-01-16 20:24:35 UTC
On pc Debian x86-64 with master sources updated today, I can reproduce this.
Comment 2 Andras Timar 2014-01-16 20:28:41 UTC
https://gerrit.libreoffice.org/#/c/7474/
Comment 3 Julien Nabet 2014-01-16 21:01:13 UTC
Created attachment 92244 [details]
bt with symbols

Here's the bt.
I must say I don't understand the goal of this:
    984         OUString s(aOut.copy(0, n1));
    985         aOut = aOut.copy(n1);
    986         while (aOut[0] == '\n' || aOut[0] == '\r')
    987         {
    988             aOut = aOut.copy(1);
    989         }
Comment 4 Commit Notification 2014-01-17 06:10:55 UTC
Andras Timar committed a patch related to this issue.
It has been pushed to "master":

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

fdo#73698 check for empty aOut



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.