Bug 95987 - Writer crashes on closing, if Finnish spellchecker is installed
Summary: Writer crashes on closing, if Finnish spellchecker is installed
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Extensions (show other bugs)
Version:
(earliest affected)
5.0.2.2 release
Hardware: x86-64 (AMD64) Windows (All)
: medium major
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: haveBacktrace
Depends on:
Blocks:
 
Reported: 2015-11-22 16:38 UTC by Buovjaga
Modified: 2017-02-28 16:59 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Backtrace of crash on Windows, LibO 5.0.3 (10.32 KB, text/plain)
2015-11-22 16:38 UTC, Buovjaga
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Buovjaga 2015-11-22 16:38:34 UTC
Created attachment 120722 [details]
Backtrace of crash on Windows, LibO 5.0.3

Installed Voikko laaja (5.0.0.20151004) from: http://www.puimula.org/htp/ooo/libreoffice-voikko.html

If I close LibO with Writer running, it crashes. Removal of extension solves the problem.
Noticed it with 5.0.3.

Installed 5.0.2 and tried with it, too. Crashes as well as gives Fatal error / SEH exception: Access violation while typing, but these symptoms are not consistent.

Win 7 Pro 64-bit, Version: 5.0.3.2 (x64)
Build ID: e5f16313668ac592c1bfb310f4390624e3dbfb75
Locale: fi-FI (fi_FI)

Version: 5.0.2.2 (x64)
Build ID: 37b43f919e4de5eeaca9b9755ed688758a8251fe
Locale: fi-FI (fi_FI)
Comment 1 Harri Pitkänen 2015-11-22 17:51:18 UTC
Confirmed this with 64 bit 5.0.3 on Windows 8.1. The crash was only reproducible if I open a new empty Writer document and then closed LibreOffice without typing anything in the document.

I cannot reproduce this on Linux. I will look closer what exactly in the Voikko extension code (which is Python in this version) triggers this crash.
Comment 2 Harri Pitkänen 2015-11-22 20:41:39 UTC
The crash appears to be related to the following sequence of calls performed within the extension:

compContext = uno.getComponentContext()
servManager = compContext.ServiceManager
linguPropSet = servManager.createInstanceWithContext("com.sun.star.linguistic2.LinguProperties", compContext)
propSetInfo = linguPropSet.getPropertySetInfo()
propSetInfo.getProperties()

The actual getProperties call is here:
https://github.com/voikko/libreoffice-voikko/blob/master/oxt/pythonpath/PropertyManager.py#L174

If I replace the implementation of __setProperties with

  properties.getPropertySetInfo()

I don't get the crash but if I replace it with

  properties.getPropertySetInfo().getProperties()

the crash can be reproduced.

Thus it looks like simply calling getPropertySetInfo().getProperties() on a instance of LinguProperties within the lifetime of the process will lead to this crash at exit.
Comment 3 Harri Pitkänen 2015-11-22 21:02:27 UTC
This issue could be patched / worked round in Voikko extension by re-implementing __setProperties as follows:

def __setProperties(self, properties):
	for p in ["IsSpellWithDigits", "IsSpellUpperCase", "HyphMinLeading", "HyphMinTrailing", "HyphMinWordLength"]:
		pValue = PropertyValue()
		pValue.Name = p
		pValue.Value = properties.getPropertyValue(p)
		self.setValue(pValue)


I will likely release an bugfix version to the extension with this change. But to me this still looks like a bug at LibreOffice side since there should be no reason for properties.getPropertySetInfo().getProperties() to cause problems like this?
Comment 4 Buovjaga 2015-11-27 06:49:14 UTC
Confirmed that with the new extension version Writer doesn't crash on close.
Comment 5 Julien Nabet 2016-06-04 21:26:19 UTC
Buovjaga: may we close this one since the extension is ok?

BTW, i never know if
1) it's a LO bug to be fixed because an extension shouldn't make LO crash
or
2) an extension may crash LO because it calls some api in wrong way (I don't know if it's the case here) and so it should be NOTOURBUG.
Comment 6 Buovjaga 2016-06-05 15:21:44 UTC
We should avoid setting NEW reports to NEEDINFO without a very good reason (like original repro document missing etc.). Let's use needAdvice keyword instead.
Comment 7 Xisco Faulí 2016-09-19 15:29:43 UTC Comment hidden (obsolete)
Comment 8 Buovjaga 2017-02-28 16:59:01 UTC
I tried with the same old version http://www.puimula.org/htp/ooo/voikko-win/5.0.0.20151004/ but now it didn't crash! Closing.

Version: 5.3.0.3 (x64)
Build ID: 7074905676c47b82bbcfbea1aeefc84afe1c50e1
CPU Threads: 4; OS Version: Windows 6.19; UI Render: default; Layout Engine: new; 
Locale: fi-FI (fi_FI); Calc: group