Bug 93474 - Crash on importing a macro library
Summary: Crash on importing a macro library
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: x86-64 (AMD64) All
: medium major
Assignee: Caolán McNamara
URL:
Whiteboard: target:5.2.0
Keywords: haveBacktrace
Depends on:
Blocks:
 
Reported: 2015-08-16 23:38 UTC by sworddragon2
Modified: 2016-10-25 19:02 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Macro library that causes a crash on importing (167 bytes, application/vnd.ms-excel)
2015-08-16 23:38 UTC, sworddragon2
Details
console logs + bt with debug symbols (24.61 KB, text/plain)
2015-08-18 20:49 UTC, Julien Nabet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description sworddragon2 2015-08-16 23:38:20 UTC
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.
Comment 1 tommy27 2015-08-17 14:05:47 UTC
I confirm crash under Win8.1 x64 using LibO 5.0.0.4
did it work in earlier releases?
Comment 2 sworddragon2 2015-08-17 15:04:29 UTC
I don't know as I have never worked with macros before.
Comment 3 Julien Nabet 2015-08-18 20:49:31 UTC
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.
Comment 4 Julien Nabet 2015-08-18 20:54:51 UTC
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 "")
    at /home/julien/compile-libreoffice/libreoffice/basic/source/uno/scriptcont.cxx:1246
#1  0x00002aaaae2a053c in basic::SfxScriptLibrary::isLibraryElementValid(com::sun::star::uno::Any const&) const (this=0x6a5d1e0, rElement=uno::Any "")
    at /home/julien/compile-libreoffice/libreoffice/basic/source/uno/scriptcont.cxx:1251
#2  0x00002aaaae28e83c in basic::SfxLibrary::insertByName(rtl::OUString const&, com::sun::star::uno::Any const&) (this=0x6a5d1e0, aName="test", aElement=uno::Any "")
    at /home/julien/compile-libreoffice/libreoffice/basic/source/uno/namecont.cxx:3178
Comment 5 Matthew Francis 2015-08-20 15:50:34 UTC
Amusingly this seems to predate the universe. Is it really the case that nobody has ever pressed this button before?

-> Version: Inherited From OOo
Comment 6 Commit Notification 2016-05-24 18:10:45 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

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

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:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 7 Cor Nouws 2016-05-25 08:22:57 UTC
(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.