Bug 107627 - Calc crashes when closing a document
Summary: Calc crashes when closing a document
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
5.3.2.2 release
Hardware: All macOS (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-05-04 14:33 UTC by bintoro
Modified: 2018-01-08 10:50 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Stack trace (66.25 KB, text/plain)
2017-05-04 14:33 UTC, bintoro
Details

Note You need to log in before you can comment on or make changes to this bug.
Description bintoro 2017-05-04 14:33:27 UTC
Created attachment 133072 [details]
Stack trace

I'm trying (once again) to migrate from AOO to LO, but I'm finding that Calc is still pretty unstable on macOS. The good news is that I'm seeing fewer random crashes than before (I think). They now seem to be often associated with closing or reloading a workbook, particularly when the workbook has been idle for a while (might be coincidental).

What happens is I suddenly get the Document Recovery crash dialog, but the OK button remains unresponsive and I have to Force Quit.

I've got a new Mac, a new profile, and a new LO installation. I've disabled OpenCL, OpenGL, and Java. This is on the latest macOS Sierra (10.12.4). The spreadsheets I work on are not particularly large or complex.

I'm attaching a stack trace of the latest occurrence. I tried to look for logs kept by LO itself but couldn't find any.

So far I've tried versions 5.3.2.2 and 5.3.3.1 (5.3.3 RC 1).

What next?
Comment 1 Xisco Faulí 2017-05-04 14:35:47 UTC Comment hidden (obsolete)
Comment 2 Alex Thurgood 2017-05-04 16:31:26 UTC
So, from the trace, it would appear that we are seeing event thread management shenanigans in:

15  -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 2796 (AppKit + 8136798) [0x7fffb927485e]
  15  _DPSNextEvent + 1120 (AppKit + 290340) [0x7fffb8af8e24]
  15  _BlockUntilNextEventMatchingListInModeWithFilter + 71 (HIToolbox + 199462) [0x7fffba55db26]
  15  ReceiveNextEventCommon + 432 (HIToolbox + 199921) [0x7fffba55dcf1]
  15  RunCurrentEventLoopInMode + 240 (HIToolbox + 200380) [0x7fffba55debc]
  15  CFRunLoopRunSpecific + 420 (CoreFoundation + 553412) [0x7fffbaffc1c4]
  15  __CFRunLoopRun + 2065 (CoreFoundation + 556081) [0x7fffbaffcc31]
  15  __CFRunLoopDoTimers + 298 (CoreFoundation + 591082) [0x7fffbb0054ea]
  15  __CFRunLoopDoTimer + 1071 (CoreFoundation + 592271) [0x7fffbb00598f]
  15  __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 20 (CoreFoundation + 593156) [0x7fffbb005d04]
  15  __NSFireTimer + 83 (Foundation + 667455) [0x7fffbca8ef3f]


@ikjt : in order to narrow this down, could you please provide the following information :

1) have you tried resetting your user profile ?

2) does the sheet contain any macros ? If so, please provide a sample sheet containing them with instructions on how to use.

3) please indicate your graphics hardware chip(s) and which one is activated when running LO if you have more than one

4) Also please indicate the resolution you are using and the type of display output (screen type)

5) please also indicate whether you get a crash with the document in question if you start LO from the terminal:

/Applications/LibreOffice.app/Contents/MacOS/soffice
Comment 3 bintoro 2017-05-11 15:00:10 UTC
Thanks for the quick responses, guys.

I have tried to come up with a consistent STR but without success. Since posting the issue, the crash has always coincided with closing a file. It's not related to any specific file, nor does it happen every time I close a file.

> 1) have you tried resetting your user profile ?

As indicated in the initial report, I started out with a fresh profile and experienced the crashes right from the start.

> 2) does the sheet contain any macros ?

No.

> 3) please indicate your graphics hardware chip(s) and which one is activated
> when running LO if you have more than one

I've got a 2015 MBP with the integrated Intel Iris Pro only.

> 4) Also please indicate the resolution you are using and the type of display
> output (screen type)

External wide gamut EIZO display at 1920x1200.

> 5) please also indicate whether you get a crash with the document in
> question if you start LO from the terminal:
> 
> /Applications/LibreOffice.app/Contents/MacOS/soffice

Yes.
Comment 4 Alex Thurgood 2017-05-12 12:16:06 UTC
(In reply to ikjt from comment #3)


> I have tried to come up with a consistent STR but without success. Since
> posting the issue, the crash has always coincided with closing a file. It's
> not related to any specific file, nor does it happen every time I close a
> file.
> 


Is it always the same file, or does it happen with a variety of Calc files ?
If it always happens with the same file, then it is going to be difficult to pin down without a copy of that file, or else a minimum reproduction that causes the crash.

Re: logs - if LibreOffice does produce any logs, you might find them here:
/Users/username/Library/Logs/DiagnosticReports/
Comment 5 bintoro 2017-05-12 12:35:33 UTC
(In reply to Alex Thurgood from comment #4)
> 
> Is it always the same file, or does it happen with a variety of Calc files ?
> If it always happens with the same file, then it is going to be difficult to
> pin down without a copy of that file, or else a minimum reproduction that
> causes the crash.

Sorry, I thought I had made it clear that it seems to happen with a variety of files. One crash occurred when closing a freshly created spreadsheet with nothing but a few values on it. (But it should be noted that even in that instance I still had other files open in the background. So I suppose in theory there could be a feature in all my old OpenOffice workbooks that upsets LibreOffice. But this seems far-fetched, particularly since the spreadsheets are pretty basic.)
Comment 6 Alex Thurgood 2017-05-12 14:11:14 UTC
(In reply to ikjt from comment #5)


> Sorry, I thought I had made it clear that it seems to happen with a variety
> of files. One crash occurred when closing a freshly created spreadsheet with
> nothing but a few values on it. (But it should be noted that even in that
> instance I still had other files open in the background. So I suppose in
> theory there could be a feature in all my old OpenOffice workbooks that
> upsets LibreOffice. But this seems far-fetched, particularly since the
> spreadsheets are pretty basic.)

How many documents are open at the same time ? There is already a bug open against the performance of LO when context switching and I'm wondering whether this might be a factor in your case (e.g. some memory corruption in the windowserver process, or some such)
 
Does the crash seem to occur when closing a document that then brings another open document into focus ?
Comment 7 Alex Thurgood 2017-05-12 14:13:43 UTC
Your trace indicates that the app hung before it crashed :

Event:           hang
Duration:        1.50s (process was unresponsive for 8 seconds before sampling)
Steps:           15 (100ms sampling interval)

which would be similar to performance issues encountered in the bug report on multiple open documents (reduced or otherwise displayed).
Comment 8 Alex Thurgood 2017-05-12 14:21:21 UTC
Hmm re-reading your first post, I would also suggest installing an Oracle JDK.
Comment 9 bintoro 2017-05-12 14:35:03 UTC
> Does the crash seem to occur when closing a document that then brings
> another open document into focus ?

Not exclusively. Sometimes I'm closing files and after closing the last one the crash dialog pops up.

> Your trace indicates that the app hung before it crashed

The specific visible symptom is that the crash dialog appears suddenly (the LO dialog that explains that the application has crashed and that documents will be recovered); at the same time I get the beachball and the dialog cannot be dismissed except by Force Quit.

Before the crash occurs there are no noticeable performance issues. The UI is certainly sluggish compared to OpenOffice, but the sluggishness is always there. In other words, my spreadsheets are not large or complicated enough to cause additional performance degradation.

A report containing a stack trace is produced only occasionally. From the viewpoint of the OS, the event is indeed "hang", never "crash". Now that I think of it, I wonder if the stack trace simply represents the situation during the crash dialog with the beachball, not the actual LO crash that precedes it.

> I would also suggest installing an Oracle JDK

Okay, I'll see if it makes a difference.
Comment 10 Alex Thurgood 2017-05-12 14:40:38 UTC
Thanks for the return information. I don't know what else to suggest as a possible way of pinning this down more, unless you are up for a spot of debugging with lldb  and a debug-enabled build of LibreOffice from one of the daily servers (I'm not sure that they are even debug builds at the moment).
Comment 11 Buovjaga 2017-05-12 18:12:43 UTC
(In reply to Alex Thurgood from comment #10)
> (I'm not sure that they are even debug builds at the
> moment).

They are not: http://dev-builds.libreoffice.org/daily/master/MacOSX-x86_64@49-TDF/current/master~2017-05-12_01.58.58_build_info.txt
Comment 12 Alex Thurgood 2017-05-14 10:01:27 UTC
Possible duplicate of bug 107706 ?
Comment 13 Alex Thurgood 2017-05-24 12:33:43 UTC
ikjt: does it also crash if you just use the MPB screen instead of both your Eizo display and the MPB screen ?
Comment 14 bintoro 2017-05-27 16:29:07 UTC
Update:

I have learned to reproduce the issue pretty reliably as follows:

(1) Open at least two (saved) spreadsheets.

(2) Hide LibreOffice and let it sit in the background for a while (20–30 minutes should be enough).

(3) Bring LO up again and close the documents => crash.

I've eliminated Witch and BetterTouchTool as potential causes. Enabling Java has made no difference either.


> Possible duplicate of bug 107706 ?
Unlikely, as that one was related to the Find dialog only.

> does it also crash if you just use the MPB screen instead
> of both your Eizo display and the MPB screen ?
Yes.


*** If anyone reading this is experiencing the same issue, PLEASE LEAVE A COMMENT. For now, it remains unconfirmed whether this is really a bug in LO. ***
Comment 15 Buovjaga 2017-05-27 17:32:26 UTC
(In reply to ikjt from comment #14)
> Update:
> 
> I have learned to reproduce the issue pretty reliably as follows:
> 
> (1) Open at least two (saved) spreadsheets.
> 
> (2) Hide LibreOffice and let it sit in the background for a while (20–30
> minutes should be enough).
> 
> (3) Bring LO up again and close the documents => crash.

I let it sit for 60 minutes. No crash.

macOS 10.12.5
LibO 5.3.3.2
Comment 16 superurbi 2017-06-01 12:05:30 UTC
Could it be a hardware problem? Related to memory?

Regards,
Comment 17 Buovjaga 2017-06-01 14:44:08 UTC
(In reply to superurbi from comment #16)
> Could it be a hardware problem? Related to memory?
> 
> Regards,

https://www.raymond.cc/blog/memory-test-for-macos-x/
Comment 18 Alex Thurgood 2017-06-12 07:39:00 UTC
(In reply to ikjt from comment #14)
> Update:
> 
> I have learned to reproduce the issue pretty reliably as follows:
> 
> (1) Open at least two (saved) spreadsheets.
> 
> (2) Hide LibreOffice and let it sit in the background for a while (20–30
> minutes should be enough).
> 
> (3) Bring LO up again and close the documents => crash.
> 
> I've eliminated Witch and BetterTouchTool as potential causes. Enabling Java
> has made no difference either.
> 


Under some circumstances, LO is reported as leaking memory when windows of multiple documents are left reduced for a while, causing the XSession window manager to consume all resources and crash. This could be a similar scenario.

It might be helpful to have a System Monitor snapshot of the ongoing processes and memory usage at the time you manage to get LO to crash.
Comment 19 Christo 2017-10-24 16:19:44 UTC
I have the same problem as described in comment 14. Just switched Macbooks, and it happens on both ones, using 

LibreOffice 5.3.6.1, Build-ID: 686f202eff87ef707079aeb7f485847613344eb7, CPU-Threads: 8; BS-Version: Mac OS X 10.12.6; UI-Render: Standard; Layout-Engine: neu; Gebietsschema: de-DE (de_DE.UTF-8); Calc: group. 

The old one was 2012 hardware, also with Mac OS 10.12.6. 

Especially, the Dokumentwiederherstellung dialogue directly after the crash freezes and can only be killed manually (sofort beenden), in my case.
Comment 20 Alex Thurgood 2017-10-25 07:10:04 UTC
(In reply to ikjt from comment #14)
> Update:
> 
> I have learned to reproduce the issue pretty reliably as follows:
> 

This description sounds similar to bug 31607
Comment 21 Alex Thurgood 2017-10-25 07:38:58 UTC
(In reply to ikjt from comment #14)
> Update:
> 
> I have learned to reproduce the issue pretty reliably as follows:
> 
> (1) Open at least two (saved) spreadsheets.
> 
> (2) Hide LibreOffice and let it sit in the background for a while (20–30
> minutes should be enough).
> 
> (3) Bring LO up again and close the documents => crash.
> 


Unfortunately, still no repro for me with:

Version: 5.4.2.2
Build ID: 22b09f6418e8c2d508a9eaf86b2399209b0990f4
Threads CPU : 4; OS : Mac OS X 10.13; UI Render : par défaut; 
Locale : fr-FR (fr_FR.UTF-8); Calc: group

I opened 2 fairly large Calc documents with graphs and then reduced their windows for 30 mins. 
Re-expanded the windows, then Cmd-Q. The save dialog was displayed (despite having made no changes, but whatever).
Clicked on "No" (don't save), and document windows closed gracefully as did LO.
Comment 22 bintoro 2017-11-07 15:04:54 UTC
The issue seems to have gone away with the upgrade to High Sierra (10.13.1). It's been a week, and so far so good.
Comment 23 Buovjaga 2017-11-07 15:11:06 UTC
(In reply to ikjt from comment #22)
> The issue seems to have gone away with the upgrade to High Sierra (10.13.1).
> It's been a week, and so far so good.

Christo: have you upgraded any of your systems to High Sierra yet?
Comment 24 Xisco Faulí 2018-01-08 10:50:45 UTC
(In reply to ikjt from comment #22)
> The issue seems to have gone away with the upgrade to High Sierra (10.13.1).
> It's been a week, and so far so good.

Let's set it to RESOLVED WORKSFORME then. Please, feel free to reopen it if the crashes reappear again