Created attachment 117954 [details]
Macro library that causes a crash on importing
On making some tests with macros I have noticed that Writer can crash on importing specific macro libraries. Steps to reproduce:
1. Open Writer.
2. Go to the menu bar -> Tools -> Macros -> "Organize Macros" -> "LibreOffice Basic..." -> Organizer... -> Libraries and click in "Import...".
3. Import the attached macro.
4. Click on "OK".
Now Writer does crash immediately.
I confirm crash under Win8.1 x64 using LibO 184.108.40.206
did it work in earlier releases?
I don't know as I have never worked with macros before.
Created attachment 118006 [details]
console logs + bt with debug symbols
On pc Debian x86-64 with master sources updated today, I could reproduce the crash.
I attached console logs and bt.
A part bt which explains where this warning come from:
warn:basic:25915:1:basic/source/uno/namecont.cxx:3180: SfxLibrary::insertByName: to-be-inserted element is invalid!
#0 0x00002aaaae2a04e5 in basic::SfxScriptLibrary::containsValidModule(com::sun::star::uno::Any const&) (rElement=uno::Any "")
#1 0x00002aaaae2a053c in basic::SfxScriptLibrary::isLibraryElementValid(com::sun::star::uno::Any const&) const (this=0x6a5d1e0, rElement=uno::Any "")
#2 0x00002aaaae28e83c in basic::SfxLibrary::insertByName(rtl::OUString const&, com::sun::star::uno::Any const&) (this=0x6a5d1e0, aName="test", aElement=uno::Any "")
Amusingly this seems to predate the universe. Is it really the case that nobody has ever pressed this button before?
-> Version: Inherited From OOo
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":
Resolves: tdf#93474 crash on importing a macro library
It will be available in 5.2.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:
Affected users are encouraged to test the fix and report feedback.
(In reply to Matthew Francis from comment #5)
> Amusingly this seems to predate the universe. Is it really the case that
> nobody has ever pressed this button before?
I did :)
But in the report I read "can crash on importing specific macro libraries", so apparently not a generic problem.