Bug 56549 - CRASH in menu 'Format → Autocorrect → Apply and Edit Changes'
Summary: CRASH in menu 'Format → Autocorrect → Apply and Edit Changes'
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Master old -3.6
Hardware: All All
: high critical
Assignee: Caolán McNamara
URL:
Whiteboard: BSA target:4.0.0 target:3.6.5
Keywords: regression
: 58278 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-10-29 22:52 UTC by Linus Drumbler
Modified: 2013-11-13 19:26 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments
Compressed video showing the crash (1011.16 KB, application/x-7z-compressed)
2012-10-31 01:03 UTC, Linus Drumbler
Details
Soure document for test (9.03 KB, application/vnd.oasis.opendocument.text)
2012-11-15 05:18 UTC, Rainer Bielefeld Retired
Details
Mac OS X log file for the crash, with LOdev 4.0, pull time 2012-11-13 (73.36 KB, text/plain)
2012-11-15 09:36 UTC, Roman Eisele
Details
bt with symbols (5.82 KB, text/plain)
2012-11-15 21:41 UTC, Julien Nabet
Details
screenshot test (67.59 KB, image/png)
2012-11-25 12:40 UTC, Julien Nabet
Details
proposed patch (2.32 KB, patch)
2012-11-25 13:30 UTC, Julien Nabet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Linus Drumbler 2012-10-29 22:52:13 UTC
I'm not sure exactly what is causing this problem. I am typing a document with the font changed from the default, and want to disable automatic numbering (it would be nice if someone could tell me how to do that). So I go to Format → Autocorrect → Apply and LibreOffice crashes, though it recovers my file.

I'd say this is a pretty severe bug.

My operating system is Windows 7, and my browser is Chrome/22.0.1229.94.
Comment 1 Linus Drumbler 2012-10-30 19:47:56 UTC
For further information, I am using version 3.6.2.2.
Comment 2 Julien Nabet 2012-10-30 20:26:02 UTC
On Vista with 3.6.2.2, I did this:
- created a new doc
- typed a word
- format, autocorrect, apply
=> no crash here 

Do you reproduce this only on this document or on any document? If on specific doc, could you attach it to the bugtracker?
Could you, for the test, rename your LO profile (...\AppData\Roaming\libreoffice\3) and try again?
Comment 3 Linus Drumbler 2012-10-31 00:11:02 UTC
I have uploaded a video of the crash. See http://vidicy.com/Fzvnr/.
Comment 4 Linus Drumbler 2012-10-31 01:03:07 UTC
Created attachment 69335 [details]
Compressed video showing the crash

Oops, wrong video. See the attachment.
Comment 5 Julien Nabet 2012-11-01 06:01:37 UTC
(In reply to comment #4)
> Created attachment 69335 [details]
> Compressed video showing the crash
> 
> Oops, wrong video. See the attachment.
When I try to open the video with Totem, it's upside-down (+ mirrored?)
Meanwhile did you test with a brand new LO profile (see http://wiki.documentfoundation.org/UserProfile)
Comment 6 Julien Nabet 2012-11-01 07:06:36 UTC
Ok I could read the video from Windows, I'll take a look.
Comment 7 Julien Nabet 2012-11-01 07:13:31 UTC
dhruv: could you uninstall completely your LO version and try the prerelease 3.6.3 RC2 (see http://www.libreoffice.org/download/pre-releases/)?

I ask this because you and reproduce this on 3.6.2 (you with Ubuntu, me with Vista) and I don't reproduce this on 3.6 sources.
Of course, a test with 3.6 sources some days ago means it's slightly different from 3.6.3 but perhaps we'll be lucky.
Comment 8 Julien Nabet 2012-11-01 07:16:35 UTC
Obviously answering to the wrong bugtracker :-(
I'd like to know how to remove this kind of comment:-)

BTW, I didn't reproduce this. I must recognize, I don't have the first font you selected
Comment 9 Linus Drumbler 2012-11-02 20:07:03 UTC
It's called Quattrocento Sans, and you can download it at http://www.google.com/webfonts#UsePlace:use/Collection:Quattrocento+Sans.
Comment 10 Julien Nabet 2012-11-02 22:14:25 UTC
ejectmail: do you reproduce this without using Quattrocento Sans font?
Could you give a try to brand new LO 3.6.3?
Comment 11 Linus Drumbler 2012-11-03 03:03:34 UTC
I don't think the font is the problem. I have reproduced the crash with two different native fonts and two different installed fonts. Even the default font results in a crash when the text shown in the video is used.

I just installed the new version today, and the bug persists in it.
Comment 12 Jean-Baptiste Faure 2012-11-04 12:16:38 UTC
(In reply to comment #11)
> [...] 
> I just installed the new version today, and the bug persists in it.

Even with a clean new LO user profile ?
http://wiki.documentfoundation.org/Faq/General/110
Comment 13 Linus Drumbler 2012-11-06 20:24:48 UTC
Yes, even with a clean profile.
Comment 14 Marcus Macauley 2012-11-14 01:45:13 UTC
It happens for me too. Very simple: Open LibreOffice Writer, paste some text which includes straight quotes, Format - AutoCorrect - Apply and Edit Changes ... CRASH.

Some background, in case it helps: Just before experiencing this problem I upgraded from 3.5 to 3.6. One of the reasons I upgraded was because of a problem with AutoCorrect I was experiencing in 3.5. I pasted a document which included straight quotes, double-dashes, and lots of similar things needing replacement. I did Format - AutoCorrect - Apply and Edit Changes, evaluated the changes, rejected some which I didn't want (like superscript 1st and Capitalize first word of sentence), tried to reject one but it wouldn't let me (the Reject button was grayed out), so I clicked Reject All. Then I slightly customized the AutoCorrect options. Then I tried Format - AutoCorrect - Apply and Edit Changes again, but there were no changes offered, even though there should have been many. I tried this repeatedly, re-pasting the text into a new file, et cetera, and nothing helped. So I upgraded to 3.6. The first time I tried Format - AutoCorrect - Apply and Edit Changes after upgrading, it crashed. If I tried it with a blank file, it didn't crash. But as soon as I pasted one sentence with straight quotes and tried it again, it crashed.
Comment 15 Julien Nabet 2012-11-14 18:44:04 UTC
Rainer or Roman: if one of you have some time, it could be interesting you take a look.
Comment 16 Rainer Bielefeld Retired 2012-11-15 05:18:12 UTC
Created attachment 70097 [details]
Soure document for test

[Reproducible] with "LibreOffice 3.6.3.2" German UI/ German Locale [Build-ID: 58f22d5] on German WIN7 Home Premium (64bit); I tried due to comment 14. Unfortunately available instructions in movie are are much to imprecise. 

Steps to reproduce:
0. Launch LibO
1. open New Writer document from LibO Start Center
2. In menu 'Tools -> Autocorrect Options' activate all options in tabs 'Options'
   and 'Localized Options'
3. Open attached sample document
4. <control+a> to select all
5. <control+c> for copy
6. switch to empty Writer document
7. <control+v> for paste
8. Menu 'Format -> Autocorrect -> Apply and edit changes'
  > CRASH 

No crash with 'Format -> Autocorrect -> Apply and edit changes'

Still [Reproducible] with parallel installation of Master "LOdev  3.7.0.0.alpha0+   -  ENGLISH UI / German Locale  [Build ID: 70ec82)]"  {tinderbox: @16, pull time 2012-11-09 00:53:19} on German WIN7 Home Premium (64bit) with separate User Profile for Master Branch

@ejectmail:
Thank you for the video, but we all know how to launch LibO (by the way, it's a very unusual way how you launch writer) and to type text, we need no video for that. Much more useful is a sample document needing only few additional steps to provoke the crash. Please attach such a sample document so that we can check whether your problem really is the same as the  Marcus Macauley's
And please do not modify Status field to NEW, please see <https://wiki.documentfoundation.org/BugTriage#Process>  item 5
Comment 17 Rainer Bielefeld Retired 2012-11-15 05:35:13 UTC
I was not able to reproduce the problem with "LibreOffice 3.5.7.2 rc German UI/Locale [Build-ID: 3215f89-f603614-ab984f2-7348103-1225a5b] on German WIN7 Home Premium (64bit), so this one seems to be a regression

Already [Reproducible] with Server installation of  Master "LOdev 3.6.0alpha0+  – WIN7 Home Premium (64bit) ENGLISH UI [Build ID: 475d0c5-829fc92-39746e8-206648e-fefd87]" (2012-02-14)

Crash also is reproducible with copy paste strings "This is -- some text here" and "http://www.web.de" in Comment 16 step 5, it seems crash happens for any change what can be applied.

@Michael:
Bug appeared very early in 3.6, please decide whether "bibisectrequest" can be useful.
Please change Status to ASSIGNED and add yourself to "Assigned To" if you accept this Bug or forward the Bug if it's not your turf
Comment 18 Roman Eisele 2012-11-15 09:33:54 UTC
This issue is not limited to Windows:

Also REPRODUCIBLE on Mac OS X 10.6.8 (Intel) with
* LibreOffice 3.6.3.2 (Build ID: 58f22d5)
* LOdev 4.0.0.0.alpha0+ (Build ID: 32315e; pull time: 2012-11-13 00:32:26)

following the steps in Rainer’s comment #16 (thank you, Rainer, for the clear and precise description!).
Comment 19 Roman Eisele 2012-11-15 09:36:05 UTC
Created attachment 70102 [details]
Mac OS X log file for the crash, with LOdev 4.0, pull time 2012-11-13


In the crash log created by Mac OS X, both 3.6.3.2 and LOdev 4.0 show the same (simple) stack trace. I attach the log file created for the crash of LOdev 4.0.0.0.alpha0+ (Build ID: 32315e; pull time: 2012-11-13 00:32:26).
Comment 20 Julien Nabet 2012-11-15 21:41:51 UTC
Created attachment 70143 [details]
bt with symbols

On pc Debian x86-64 with master sources updated today (13ef9dcc206d30ebd4d63afb186d379dc849b36c, Rename "Mozilla headers" to "NPAPI headers") with a "make clean && make" made after having retrieved this commit + a brand new LO profile, I reproduced this bug. So I attached the bt (no specific console logs)
Obviously, I had the same as Roman.


Rainer: thank you for your clear and detailed steps to reproduce this, always useful!
Comment 21 Julien Nabet 2012-11-15 21:54:23 UTC
Here is a quick gdb debug session:
Breakpoint 1, SwAutoFormat::_SetRedlineTxt (this=0x7fff833e0420, nActionId=14) at /home/julien/compile-libreoffice/libo/sw/source/core/edit/autofmt.cxx:290
290	    sal_uInt16 nSeqNo = 0;
(gdb) n
291	    if( STR_AUTOFMTREDL_END > nActionId )
(gdb) list
286	
287	void SwAutoFormat::_SetRedlineTxt( sal_uInt16 nActionId )
288	{
289	    String sTxt;
290	    sal_uInt16 nSeqNo = 0;
291	    if( STR_AUTOFMTREDL_END > nActionId )
292	    {
293	        sTxt = ViewShell::GetShellRes()->GetAutoFmtNameLst()[ nActionId ];
294	        switch( nActionId )
295	        {
(gdb) p ViewShell::GetShellRes()
$1 = (ShellResource *) 0x5081850
(gdb) p ViewShell::GetShellRes()->GetAutoFmtNameLst()
$2 = (const std::__debug::vector<String, std::allocator<String> > &) @0x0: <error reading variable>
(gdb) 

ViewShell::GetShellRes()->GetAutoFmtNameLst() returns nothing. So obviously, [] on nothing => crash.
Now the thing is, is it normal it returns nothing? If not, why does it return nothing?
Comment 22 Linus Drumbler 2012-11-16 01:18:00 UTC
(In reply to comment #16)
> @ejectmail:
> Thank you for the video, but we all know how to launch LibO (by the way,
> it's a very unusual way how you launch writer) and to type text, we need no
> video for that. Much more useful is a sample document needing only few
> additional steps to provoke the crash. Please attach such a sample document
> so that we can check whether your problem really is the same as the  Marcus
> Macauley's
> And please do not modify Status field to NEW, please see
> <https://wiki.documentfoundation.org/BugTriage#Process>  item 5

Would you like me to submit a new video?
Comment 23 Linus Drumbler 2012-11-16 01:20:24 UTC
I only opened it that way because I was running it from a flash drive.
Comment 24 Rainer Bielefeld Retired 2012-11-16 05:26:02 UTC
(In reply to comment #22)
@ejectmail: No, thank you, the problem has been reproduced, our developers now can fix that. 

I only wanted to tell you that a video of course ca help to follow exactly reporter's steps, but often also shows lots of irrelevant details, what can be worrying (for example the way you opened the document), and at least for me it is hard to record all those details and to filter the important ones. Because of that I prefer a test kit (sample document) and a step by step instruction, and a video as second attempt if it was not possible to reproduce the bug. But I am not sure whether all people prefer that approach. 

And thank you for your attention and your commitment to report the bug you observed.
Comment 25 Linus Drumbler 2012-11-16 23:47:54 UTC
(In reply to comment #24)
> And thank you for your attention and your commitment to report the bug you
> observed.

You're very welcome! I really want LibreOffice to be bug-free (see bug 56853, bug 55946, bug 56363, and bug 33281 for some other bugs I care about), and use it because OpenOffice is much worse. I would love to get more involved with the debugging, if only I could code.
Comment 26 Julien Nabet 2012-11-24 22:35:33 UTC
I made a test and found that my previous comment (number 21) is wrong :-(
I tried to trace with gdb but had been lost between ImpAutoFmtNameListLoader method, pLst vector
Comment 27 Julien Nabet 2012-11-25 12:40:48 UTC
Created attachment 70536 [details]
screenshot test

Rainer: I tried to make a fix then I followed your process and had this (see screenshot)
Just to be sure, is this what was expected?
Comment 28 Julien Nabet 2012-11-25 13:30:17 UTC
Created attachment 70538 [details]
proposed patch

Just in case screenshot is ok for Rainer, here is the proposed patch.
Comment 29 Julien Nabet 2012-11-25 13:30:41 UTC
Comment on attachment 70538 [details]
proposed patch

mark as patch
Comment 30 Rainer Bielefeld Retired 2012-11-26 05:08:30 UTC
(In reply to comment #27)
@Julien:
Yes, I think that's the expected result. When this selector appeared everything was ok.
Comment 31 Roman Eisele 2012-11-29 11:50:01 UTC
@ Juline Nabet:
So please copy your patch to Gerrit (for review and pushing) ...
Comment 32 Roman Eisele 2012-11-29 11:50:59 UTC
> @ Juline Nabet:
        ^^
Sorry for the typo! No offence! I wanted to write “Julien”, of course ...
Comment 33 Julien Nabet 2012-11-29 12:40:10 UTC
Roman: No problem for the typo :-)
I sent a post to dev mailing list here:
http://nabble.documentfoundation.org/PATCH-proposed-patch-for-fdo56549-CRASH-in-menu-Format-Autocorrect-Apply-and-Edit-Changes-td4020695.html

About gerrit, submitting a patch is easy but when one's has to update it, it's less easy (and I think I'll have to update it). For the moment, I don't understand enough git and branches (or what to do when you retrieve something and you're no more on a branch!), sub modules, tracking, etc.

(See http://nabble.documentfoundation.org/PATCH-Convert-some-UniString-to-OUString-td4016767.html and http://nabble.documentfoundation.org/PATCH-Convert-some-UniString-to-OUString-improved-td4018047.html)

In brief, for the moment I prefer to let Gerrit to the experts.
Comment 34 Caolán McNamara 2012-12-01 12:08:36 UTC
Probably commit http://cgit.freedesktop.org/libreoffice/core/commit/?id=cad9afa15f53d547733fa55f1353772f6d696611 is an incorrect conversion from the old containers to stl and is the root of this
Comment 35 Not Assigned 2012-12-01 12:23:07 UTC
Caolan McNamara committed a patch related to this issue.
It has been pushed to "master":

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

Resolves: fdo#56549 crash in format->autocorrect->apply and edit changes



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 36 Caolán McNamara 2012-12-01 12:26:55 UTC
IMO ^^^ was the intent of the original code and after fixing that up it appears to "do the right thing now". Patch proposed for 3-6 in gerrit.
Comment 37 Not Assigned 2012-12-03 08:44:11 UTC
Caolan McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-3-6":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=a0926265dbfc617603cfa1fb8a4a22a5663183fe&g=libreoffice-3-6

Resolves: fdo#56549 crash in format->autocorrect->apply and edit changes


It will be available in LibreOffice 3.6.5.

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 38 Michael Stahl (allotropia) 2012-12-17 19:10:19 UTC
*** Bug 58278 has been marked as a duplicate of this bug. ***