Bug 70960 - Repeat Action command results in LibreOffice crash ( steps in comment 8 )
Summary: Repeat Action command results in LibreOffice crash ( steps in comment 8 )
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
3.4.0 release
Hardware: All All
: medium normal
Assignee: Michael Stahl (allotropia)
URL:
Whiteboard: target:5.4.0
Keywords: regression
Depends on:
Blocks: Repeat
  Show dependency treegraph
 
Reported: 2013-10-28 13:42 UTC by icerabbit
Modified: 2017-07-23 21:33 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
text document with complete copy of crash report (91.07 KB, application/vnd.oasis.opendocument.text)
2013-10-28 13:42 UTC, icerabbit
Details
copy of the crash report text as given by OS X (138.06 KB, application/vnd.oasis.opendocument.text)
2014-11-02 21:17 UTC, icerabbit
Details

Note You need to log in before you can comment on or make changes to this bug.
Description icerabbit 2013-10-28 13:42:41 UTC
Created attachment 88232 [details]
text document with complete copy of crash report

Working in LibreOffice Writer on a 5 column table with probably 36 rows. Intended to be a simple checklist. Just many cells & rows filled out with one or more  words. Some rows were left blank as spacer rows. Font for entire document set to size 9. Doesn't all fit on a single page any more. Can't make multiple non-contiguous row selection (missing feature) ... so I figured to use the Repeat action button. 

Select a row which was left blank as a spacer. Change font size to 6. 
Select another blank row. Click repeat action icon. 
Doing that for the fifth time, I get the beach ball spinning for a brief while.
Saved my document (just in case)
Did Repeat action for a sixth time. 
LibreOffice Hangs indefinitely. 

Copy / Pasted the crash report from Apple into a text document to submit to your team. Adding that as an attachment.
Comment 1 icerabbit 2013-10-28 14:32:24 UTC
Repeatable crash. 

I've continued to work with the document a little. The crash is certainly repeatable. I needed to squeeze more stuff on the page. So I'm using Repeat to size down the font in the rows that were size 9 to size 8. Upon the 7th Repeat action there is a brief slow down. Then with the 8th it hangs a bit. 9th it seems really stuck. As I'm typing this note, I can't switch back to LibreOffice any more, it is that hung up. And then a minute later comes the crash report. 

Note that this is simple writer table, 5 columns, however many fit on a page. Repeat action asks to apply a font size to 5 cells in a row. 

Core i7, 16GB of RAM, ... something is definitely not right. 

====

Process:         soffice [758]
Path:            /Applications/LibreOffice.app/Contents/MacOS/soffice
Identifier:      org.libreoffice.script
Version:         4.1.0.4 (???)
Code Type:       X86 (Native)
Parent Process:  launchd [134]
User ID:         501

Date/Time:       2013-10-28 10:26:20.546 -0400
OS Version:      Mac OS X 10.8.5 (12F45)
Report Version:  10

Interval Since Last Report:          106616 sec
Crashes Since Last Report:           1
Per-App Crashes Since Last Report:   1
Anonymous UUID:                      A8027D46-3810-98A7-EE81-D0944559F5B3

Crashed Thread:  0  Dispatch queue: com.apple.main-thread

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000

Application Specific Information:
abort() called
terminate called throwing an exception

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib        	0x96c7ca6a __pthread_kill + 10
1   libsystem_c.dylib             	0x9737fb2f pthread_kill + 101
2   libsystem_c.dylib             	0x973b6631 abort + 168
3   libc++abi.dylib               	0x93fe97e0 abort_message + 151
4   libc++abi.dylib               	0x93fe7249 default_terminate() + 34
5   libc++abi.dylib               	0x93fe7289 safe_handler_caller(void (*)()) + 13
6   libc++abi.dylib               	0x93fe72f1 std::terminate() + 23
7   libc++abi.dylib               	0x93fe83e6 __cxa_throw + 110
8   libstdc++.6.dylib             	0x940502f6 operator new(unsigned long) + 127
9   libsvllo.dylib                	0x00b90483 std::vector<MarkedUndoAction, std::allocator<MarkedUndoAction> >::_M_insert_aux(__gnu_cxx::__normal_iterator<MarkedUndoAction*, std::vector<MarkedUndoAction, std::allocator<MarkedUndoAction> > >, MarkedUndoAction const&) + 499
10  libsvllo.dylib                	0x00b9085f std::vector<MarkedUndoAction, std::allocator<MarkedUndoAction> >::insert(__gnu_cxx::__normal_iterator<MarkedUndoAction*, std::vector<MarkedUndoAction, std::allocator<MarkedUndoAction> > >, MarkedUndoAction const&) + 63
11  libsvllo.dylib                	0x00b8d9de SfxUndoManager::ImplAddUndoAction_NoNotify(SfxUndoAction*, bool, bool, svl::undo::impl::UndoManagerGuard&) + 254
12  libsvllo.dylib                	0x00b8e66a SfxUndoManager::AddUndoAction(SfxUndoAction*, unsigned char) + 106
13  libswlo.dylib                 	0x12bde09c sw::UndoManager::AddUndoAction(SfxUndoAction*, unsigned char) + 108
14  libswlo.dylib                 	0x12bddea0 sw::UndoManager::AppendUndo(SwUndo*) + 32
15  libswlo.dylib                 	0x128fcae7 SwDoc::InsertItemSet(SwPaM const&, SfxItemSet const&, unsigned short) + 247
16  libswlo.dylib                 	0x12be5112 SwUndoAttr::RepeatImpl(sw::RepeatContext&) + 98
17  libsvllo.dylib                	0x00b8c077 SfxListUndoAction::Repeat(SfxRepeatTarget&) + 55
18  libswlo.dylib                 	0x12bde3ec sw::UndoManager::Repeat(sw::RepeatContext&, unsigned short) + 236
19  libswlo.dylib                 	0x129f6d0c SwEditShell::Repeat(unsigned short) + 140
20  libswlo.dylib                 	0x130efb10 SwWrtShell::Do(SwWrtShell::DoType, unsigned short) + 448
21  libswlo.dylib                 	0x12f9ad58 SwBaseShell::ExecUndo(SfxRequest&) + 280
22  libsfxlo.dylib                	0x0082b2d8 SfxDispatcher::Call_Impl(SfxShell&, SfxSlot const&, SfxRequest&, unsigned char) + 360
23  libsfxlo.dylib                	0x00594d33 SfxBindings::Execute_Impl(SfxRequest&, SfxSlot const*, SfxShell*) + 99
24  libsfxlo.dylib                	0x005cc175 SfxDispatchController_Impl::dispatch(com::sun::star::util::URL const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, com::sun::star::uno::Reference<com::sun::star::frame::XDispatchResultListener> const&) + 4021
25  libsfxlo.dylib                	0x005cd1f5 SfxOfficeDispatch::dispatch(com::sun::star::util::URL const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) + 341
26  libsvtlo.dylib                	0x00df1f7f svt::ToolboxController::execute(short) + 847
27  libsfxlo.dylib                	0x007d4ea0 SfxToolBoxControl::execute(short) + 48
28  libfwklo.dylib                	0x0eba0c1a framework::ToolBarManager::Select(void*) + 250
29  libvcllo.dylib                	0x01a160cf ToolBox::Select() + 111
30  libvcllo.dylib                	0x01a275b6 ToolBox::ImplHandleMouseButtonUp(MouseEvent const&, unsigned char) + 550
31  libvcllo.dylib                	0x01a27994 ToolBox::Tracking(TrackingEvent const&) + 100
32  libvcllo.dylib                	0x01a2b46a Window::EndTracking(unsigned short) + 266
33  libvcllo.dylib                	0x01a4f021 ImplHandleMouseEvent(Window*, unsigned short, unsigned char, long, long, unsigned long, unsigned short, unsigned short) + 3873
34  libvcllo.dylib                	0x01a4fd40 ImplWindowFrameProc(Window*, SalFrame*, unsigned short, void const*) + 1440
35  libvcllo.dylib                	0x01aa8bb9 -[SalFrameView sendMouseEventToFrame:button:eventtype:] + 489
36  libvcllo.dylib                	0x01aa5ae2 -[SalFrameView mouseUp:] + 66
37  com.apple.AppKit              	0x9598c9e0 -[NSWindow sendEvent:] + 7159
38  com.apple.AppKit              	0x9598790f -[NSApplication sendEvent:] + 4278
39  libvcllo.dylib                	0x01a9986f -[VCL_NSApplication sendEvent:] + 111
40  libvcllo.dylib                	0x01a5dbf5 AquaSalInstance::Yield(bool, bool) + 517
41  libvcllo.dylib                	0x0171fc54 Application::Yield(bool) + 84
42  libvcllo.dylib                	0x0171fd0c Application::Execute() + 60
43  libsofficeapp.dylib           	0x0006ebba desktop::Desktop::Main() + 7642
44  libvcllo.dylib                	0x01725fe2 ImplSVMain() + 226
45  libvcllo.dylib                	0x01a5cf31 AquaSalInstance::handleAppDefinedEvent(NSEvent*) + 129
46  libvcllo.dylib                	0x01a9993b -[VCL_NSApplication sendEvent:] + 315
47  com.apple.AppKit              	0x958a162c -[NSApplication run] + 951
48  com.apple.AppKit              	0x958445f6 NSApplicationMain + 1053
49  libvcllo.dylib                	0x01a5d7f7 ImplSVMainHook(int*) + 343
50  libvcllo.dylib                	0x0172601a SVMain() + 26
51  libsofficeapp.dylib           	0x0009c855 soffice_main + 325
52  org.libreoffice.script        	0x00001f4e main + 30
53  org.libreoffice.script        	0x00001f25 start + 53

etc ... as with the previously attached report.
Comment 2 Julien Nabet 2013-10-28 22:18:28 UTC
Comment on attachment 88232 [details]
text document with complete copy of crash report

Mimetype fixed
Comment 3 Caolán McNamara 2013-10-29 09:57:58 UTC
Looks like that if there are 5 columns then there are 5 selections so when we repeat an action we end up multiplying the last undo action * 5. We go from 5 undo attributes in the last undo level to 25 to 125 and so on for each repeat.
Comment 4 icerabbit 2013-10-29 14:02:51 UTC
Not sure what undo has to do with it, as when I select the rows, one by one, and make the font changes manually, it remains instantaneous. No hangs. No crashes. And the undo list keeps track of things properly. 

It is only after using the repeat button half a dozen times, that things fall apart.
Comment 5 tommy27 2014-11-02 08:51:23 UTC Comment hidden (obsolete)
Comment 6 icerabbit 2014-11-02 21:11:43 UTC
The issue is still present.

I just reopened the same table based document I created. Reset all the row heights and font heights for the entire document. Then selected a row, changed the font size. Going through a selection of rows, clicking the repeat action. By the time I do that a few times, the response time slows down, spinning beach ball shows up, then it takes 10-20-30secs, 1 min, then 2min, and then 5 minutes and counting. It is not giving a hard crash yet, but most certainly hanging / not responding to anything.

The only thing I can do with my system is alt-tab to another application. 
Or chose force-quit from the dock. Which I just did. It provided a crash report. Will add it from that system in a separate comment.
Comment 7 icerabbit 2014-11-02 21:17:32 UTC
Created attachment 108812 [details]
copy of the crash report text as given by OS X

copy of the crash report text as given by OS X
Comment 8 Julien Nabet 2015-04-06 20:31:49 UTC
On pc Debian x86-64 with master sources updated today, I could reproduce the hang.

I created a blank 5*35 table.
Then I selected the whole table and set the fontsize to 9.
Then I selected one row and set the fontsize to 6.
Finally, the more I test Repeat action, the more I must wait before being able to keep on.
Quite quickly, LO seems to hang (but in fact you just have to wait longer).
Comment 9 tommy27 2016-04-16 07:25:31 UTC Comment hidden (obsolete)
Comment 10 Julien Nabet 2016-06-12 14:28:41 UTC
Just to respond to automatic message, I can still reproduce this with master sources updated today.
Comment 11 Timur 2017-03-06 18:16:01 UTC
http://crashreport.libreoffice.org/stats/crash_details/82ebc7a0-33a9-43ed-ae90-2ab3ac1126c8
But that crash signature is simple, and already reported for Bug 95579 which, on the contrary, applies to 32-bit Win LO.
Comment 12 Timur 2017-03-06 18:26:50 UTC
Looks like a regression from 3.4. I couldn't reproduce on 3.3 and OO.
Comment 13 LeroyG 2017-04-04 18:05:20 UTC
Not only with text size: typeface, color, alignment, effects...

Now I'm working with LibreOffice Writer 5.1.6.2.

In "ancient" versions this error don't ocurred.
Comment 14 Julien Nabet 2017-04-04 18:11:00 UTC
Leroy:
1) version field must contain the earliest version which contains the problem
2) 5.1 branch is EOL. You can give a try to 5.2.6 or brand new 5.3.1
Comment 15 Michael Stahl (allotropia) 2017-05-08 15:23:33 UTC
introduced in OOo 3.4 beta -> probably CWS undoapi

fixed on master
Comment 16 Michael Stahl (allotropia) 2017-05-08 15:25:17 UTC
forgot to add: it's a mystery why this does not happen in OOo 3.3
because the old code in SwDoc::Repeat() had the exact same
loop structure, but it's too much of a pain to debug such old versions now.
Comment 17 Commit Notification 2017-05-08 15:25:53 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=13d7778fc10638a145af7fb077688e032bd16f81

tdf#70960 sw::UndoManager: fix exponential Repeat proliferation

It will be available in 5.4.0.

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 18 tommy27 2017-05-08 16:05:02 UTC
thanks Micheal fof fixing this old nasty bug.