Created attachment 70965 [details] document with macro that causes crash Basic Crash. This macro saves opened document. At least intended to do this. Used UNO function :: com::sun::star::frame:: interface XStorable method store() Close all documents before experiment Steps to reproduce: 1. Press Alt-F11, select macro from this document, press “Edit” 2. in Basic IDE press F5 to start macro Actually: LO crashes Expected: anything, but not crash reproduced in 3.4.2 and 3.5.0 on Windows XP 32 bit in 3.5.7 and 3.6.3 on RFR 17 64 bit
Created attachment 70966 [details] bt with symbols, produced in self-compiled 3.6.2 on RFR 17 64 bit
On pc Debian x86-64 with master sources updated today (commit 8b568c1dd472021ebeb9d1536a8aab7e0b286074), I reproduced the crash. Even if I put an if (rMedium.GetFilter()) before this line: 1301 long nFormat = rMedium.GetFilter()->GetFormat(); until end of if (pFilt) line 1325, it's not sufficient. I got : #0 0x00007f9fed5f2f00 in SfxFilter::GetFilterFlags (this=0x0) at /home/julien/compile-libreoffice/libo/sfx2/inc/sfx2/docfilt.hxx:77 #1 0x00007f9fed8ad127 in SfxObjectShell::SaveTo_Impl (this=0x5939580, rMedium=..., pSet=0x61b51d0) at /home/julien/compile-libreoffice/libo/sfx2/source/doc/objstor.cxx:1344 if( bOwnTarget && !( (pFilter && pFilter->GetFilterFlags()) & SFX_FILTER_STARONEFILTER ) ) pFilter is (0x0) quotation's Markus: what I could imagine is that the problem is that the BAsicIDE has no filters attached
(In reply to comment #2) > On pc Debian x86-64 with master sources updated today (commit > 8b568c1dd472021ebeb9d1536a8aab7e0b286074), I reproduced the crash. > > Even if I put an if (rMedium.GetFilter()) before this line: > 1301 long nFormat = rMedium.GetFilter()->GetFormat(); > until end of if (pFilt) line 1325, it's not sufficient. > I got : > #0 0x00007f9fed5f2f00 in SfxFilter::GetFilterFlags (this=0x0) at > /home/julien/compile-libreoffice/libo/sfx2/inc/sfx2/docfilt.hxx:77 > #1 0x00007f9fed8ad127 in SfxObjectShell::SaveTo_Impl (this=0x5939580, > rMedium=..., pSet=0x61b51d0) at > /home/julien/compile-libreoffice/libo/sfx2/source/doc/objstor.cxx:1344 > > if( bOwnTarget && !( (pFilter && pFilter->GetFilterFlags()) & > SFX_FILTER_STARONEFILTER ) ) > pFilter is (0x0) > > quotation's Markus: > what I could imagine is that the problem is that the BAsicIDE has no filters > attached I presume ( I didn't get a chance to run the macro itself yet... rebuilding for something else ) that what is happening is that the macro here is trying to do something stupid, i.e. it's trying to store its model, if that is the case then like Markus says then there would be no filter found for the IDE for sure and that triggers the pain you see. So, while this is kindof unfortunate it's probably fairly unlikely to occur often or even at all in real life, but... crashing is not nice anytime. I guess we should at the least throw an exception when trying to store the basic IDE model that would seem to be the easiest solution. It is however still a little disturbing that failure to find a filter doesn't get handled but perhaps this is regarded as somewhat impossible ( i.e. a model doesn't know how to store itself ) given the rats nest that sfx2 is it might be easier to just throw for the specific basic ide model ( that is if there is one, I don't recall ever even seeing where the ide model was :-) )
added a fix for this to master, should work, if another solution is forthcoming then we could revert it
Noel Power committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=ab96b65e0d4fab541d8b31b46e3f37db0fb548b5 fix for fdo#57836 throw when attempting to store basicide model 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.
Thanks for fixing this bug
Exception thrown and message displayed when macro tried in Version 3.6.3.2 (Build ID: 58f22d5). Error message is missing - dialog contains: BASIC runtime error. An exception occurred Type: com.sun.star.task.ErrorCodeIOException Message: . The difference between the crash (x86-64) and a blank exception (x86-32b) is likely the 32b/64b difference. Verified the fix in a build from master 12/20: the message 'Can't store IDE model.' comes through with type...io.IOException. I am not on a 64bit system and could not re-create the crash so not marking resolved.
marking as fixed ( independently confirmed on 32 bit ) and additionally 64 bit here. Also fix is up for review to be backported to 3.6
Noel Power committed a patch related to this issue. It has been pushed to "libreoffice-3-6": http://cgit.freedesktop.org/libreoffice/core/commit/?id=37eea402ed3b8b401c8eca841ca65c997994be90&h=libreoffice-3-6 fix for fdo#57836 throw when attempting to store basicide model 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.