Bug 91043 - Crash in gtk+ file dialog from LibreLex ...
Summary: Crash in gtk+ file dialog from LibreLex ...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
4.4.3.2 release
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:5.0.0 target:5.3.0 target:5.2...
Keywords: regression
Depends on:
Blocks:
 
Reported: 2015-05-03 12:42 UTC by Michael Meeks
Modified: 2016-09-26 16:23 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
strace log of the crash (851.58 KB, application/x-bzip)
2016-09-23 20:30 UTC, Cor Nouws
Details
gdbtrace log of the crash (51.97 KB, text/x-log)
2016-09-23 20:31 UTC, Cor Nouws
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Meeks 2015-05-03 12:42:06 UTC
Load LibreLex; create a new / empty document; open the place-document dialog click the '...' expander to select a file-name; enter random stuff, hit 'ok'
Crash =)
Comment 1 Michael Meeks 2015-05-03 12:42:56 UTC
Cor filed; poked at it - some unsafe handling of the case with no file filters in the 'save' path - not a terribly common use-case; protected those.
Comment 2 Commit Notification 2015-05-03 12:52:30 UTC
Michael Meeks committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=58b76d531b7fe3a810b39a38b0a2ba62b710eee7

tdf#91043 - attempted fix of filer-less gtk+ save dialog crash.

It will be available in 5.0.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 3 Michael Meeks 2015-05-03 13:58:02 UTC
prolly fixed =)
Comment 4 Cor Nouws 2015-05-07 14:20:57 UTC
Thanks for picking this up.

Alas, still crashes in Version: 5.0.0.0.alpha1+
Build ID: 6e78bf76f3a10b43475e1bd801bdcbb9ce62f668
TinderBox: Linux-rpm_deb-x86@45-TDF, Branch:master, Time: 2015-05-07_00:08:39
Locale: nl-NL (nl_NL.UTF-8)

Will dive into the LibreLex part of the stuff and report here more clearly what is going on.
(And test the same scenario in other versions too.)
Comment 5 Michael Meeks 2015-05-07 17:54:41 UTC
You will need a stack-trace taken vs. a build with debug symbols to make this useful I think; fixing such things blind is a bit of a pain =)
Comment 6 Cor Nouws 2015-05-08 06:38:33 UTC
(In reply to Michael Meeks from comment #5)
> You will need a stack-trace taken vs. a build with debug symbols to make
> this useful I think; fixing such things blind is a bit of a pain =)

Some combined ugliness going on there. Also an unhandeld basic exception, but solving that does not end the crash. So will get the needed stuff.
Comment 7 Cor Nouws 2015-06-30 09:45:03 UTC
(In reply to Michael Meeks from comment #5)
> You will need a stack-trace taken vs. a build with debug symbols to make
> this useful I think;

I repaired some errors for corner cases, but indeed, unrelated.

Two more things:
 - choosing the LibreOffice file dialog makes that it does not crash.
 - I'm doing lots of praying/meditation these days in my normal operations, 
   since my laptop can't handle all the load, so little hope to do a
   build with debug symbols myself..
Comment 8 QA Administrators 2015-12-27 20:31:33 UTC Comment hidden (obsolete)
Comment 9 QA Administrators 2016-05-09 20:08:17 UTC Comment hidden (obsolete)
Comment 10 Cor Nouws 2016-09-19 19:50:10 UTC
still crashes with non libreoffice file dialog in 

Version: 5.3.0.0.alpha0+
Build ID: 1ef48f3bebe80a386490e2a0f8fd0ae40de07ada
CPU Threads: 4; OS Version: Linux 4.4; UI Render: default; 
TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:master, Time: 2016-09-18_23:46:24
Locale: nl-NL (nl_NL.UTF-8); Calc: group
Comment 11 Cor Nouws 2016-09-19 19:52:33 UTC
downloading master_dbg~2016-09-18_23.51.47_LibreOfficeDev_5.3.0.0.alpha0_Linux_x86_archive.tar.gz

for retrieving a stack trace..
Comment 12 Cor Nouws 2016-09-23 20:30:26 UTC
Created attachment 127579 [details]
strace log of the crash

Mind! LibreOffice starts with document recovery, unrelated to the crashing problem.
Comment 13 Cor Nouws 2016-09-23 20:31:10 UTC
Created attachment 127580 [details]
gdbtrace log of the crash

Mind! LibreOffice starts with document recovery, unrelated to the crashing problem.
Comment 14 Cor Nouws 2016-09-23 20:31:40 UTC
@michael: does this help :) ?
Comment 15 Michael Meeks 2016-09-23 21:10:04 UTC
Trace is very helpful;

#4  0x00007fffda86fc57 in std::__debug::list<FilterEntry, std::allocator<FilterEntry> >::end (this=0x0) at /opt/rh/devtoolset-2/root/usr/include/c++/4.8.2/debug/list:193

Shows that m_pFilterList is nullptr - and we de-reference it thus:

            FilterList::iterator aListIter = ::std::find_if(
                m_pFilterList->begin(), m_pFilterList->end(), FilterTitleMatch(sFilterName) );

bang ! =)

So - the fix is simple enough; although - I've not fully thought through whether this is really meaningful; I assume you're creating this with UNO and not populating the filter list somehow (?) =)
Comment 16 Michael Meeks 2016-09-23 21:12:15 UTC
Testing appreciated for:

https://gerrit.libreoffice.org/29238 tdf#91043 - vcl: gtk file picker should tolerate empty filter list.

as/when/if it is merged etc. =)

Thanks !
Comment 17 Commit Notification 2016-09-24 10:40:09 UTC
Michael Meeks committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=3be5deadcb46e09d84d99b2b108b65b06ff356e9

tdf#91043 - vcl: gtk file picker should tolerate empty filter list.

It will be available in 5.3.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 Cor Nouws 2016-09-24 19:24:36 UTC
(In reply to Commit Notification from comment #17)

> Affected users are encouraged to test the fix and report feedback.

Thanks - fixed the problem!

(In reply to Michael Meeks from comment #15)

> So - the fix is simple enough; although - I've not fully thought through
> whether this is really meaningful; I assume you're creating this with UNO
> and not populating the filter list somehow (?) =)

Heh ;) The simple version of what is used to populate the dialog:

 = = 
	sFilePickerArgs = Array(com.sun.star.ui.dialogs.TemplateDescription.FILESAVE_AUTOEXTENSION_PASSWORD )

With oFilePickerDlg
	.Initialize ( sFilePickerArgs() )
	Select Case PsDocType
		.AppendFilter( "OpenDocument Text (.odt)", "*.odt" )
		.AppendFilter( "OpenDocument Drawing (.odg)", "*.odg" )
		.SetCurrentFilter( "OpenDocument Text (.odt)" )
.SetValue(com.sun.star.ui.dialogs. ExtendedFilePickerElementIds.CHECKBOX_AUTOEXTENSION, 0, true)   
		.SetValue(com.sun.star.ui.dialogs. ExtendedFilePickerElementIds.CHECKBOX_PASSWORD, 0, false)
End With

	If oFilePickerDlg.execute() > 0 Then
		sFilesPicked() = oFilePickerDlg.getFiles()
		GetNameUsingFilePicker = sFilesPicked(0)
	End If

 = =
Comment 19 Michael Meeks 2016-09-26 08:40:28 UTC
Hi Cor; what would be lovely would be creating a unit-test that sets up a file-picker with no filters like this and exercises it so the issue doesn't come back =)
Anyhow - glad it fixes it, will pick to -5-1.
Comment 20 Commit Notification 2016-09-26 16:21:13 UTC
Michael Meeks committed a patch related to this issue.
It has been pushed to "libreoffice-5-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=60f87b899ba856b1c71a73e12f169f4fed3da121&h=libreoffice-5-2

tdf#91043 - vcl: gtk file picker should tolerate empty filter list.

It will be available in 5.2.3.

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 21 Commit Notification 2016-09-26 16:23:29 UTC
Michael Meeks committed a patch related to this issue.
It has been pushed to "libreoffice-5-1":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=651c6aaa44c9748d6900296b1227c89c2a43e3ed&h=libreoffice-5-1

tdf#91043 - vcl: gtk file picker should tolerate empty filter list.

It will be available in 5.1.6.

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.