Bug 47689 - mdimporter module causes mdworker32 to crash
Summary: mdimporter module causes mdworker32 to crash
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
3.5.3 RC1
Hardware: x86-64 (AMD64) macOS (All)
: medium critical
Assignee: Not Assigned
URL:
Whiteboard: target:4.3.0 target:4.2.0
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-21 20:10 UTC by Chris Murphy
Modified: 2018-12-18 11:58 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
crash log 1 (14.68 KB, text/plain)
2012-03-21 20:10 UTC, Chris Murphy
Details
crashlog 2 (14.68 KB, text/plain)
2012-03-21 20:10 UTC, Chris Murphy
Details
crashlog1 (14.68 KB, text/plain)
2012-03-21 20:11 UTC, Chris Murphy
Details
crashlog2 (14.68 KB, text/plain)
2012-03-21 20:12 UTC, Chris Murphy
Details
crashlog3 (14.46 KB, text/plain)
2012-03-21 20:12 UTC, Chris Murphy
Details
crash log after adding otp file to LO template path (32.02 KB, application/octet-stream)
2014-01-08 21:36 UTC, Alex Thurgood
Details
lyt-yereblend from templates/layout/lang/de (766.17 KB, application/vnd.oasis.opendocument.presentation-template)
2014-01-14 09:07 UTC, Alex Thurgood
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Murphy 2012-03-21 20:10:15 UTC
Created attachment 58839 [details]
crash log 1

During either full Time Machine backups, or full Spotlight rebuilds, mdworker32 process crashes dozens of times, with substantial delays in the backup or rebuild. The crash log implicated org.openoffice.mdimporter in path:

/Applications/LibreOffice.app/Contents/Library/Spotlight/OOoSpotlightImporter.mdimporter/Contents/MacOS/OOoSpotlightImporter
Comment 1 Chris Murphy 2012-03-21 20:10:40 UTC
Created attachment 58840 [details]
crashlog 2
Comment 2 Chris Murphy 2012-03-21 20:11:40 UTC
Created attachment 58841 [details]
crashlog1
Comment 3 Chris Murphy 2012-03-21 20:12:03 UTC
Created attachment 58842 [details]
crashlog2
Comment 4 Chris Murphy 2012-03-21 20:12:28 UTC
Created attachment 58843 [details]
crashlog3
Comment 5 uwehob 2012-06-01 03:09:49 UTC
Can confirm this bug for LibreOffice 3.5.3 on OSX 10.7.4. Renaming the file OOoSpotlightImporter alliviated the problem, however, OOO-files will remaim un-indexed. Importance seems high to me given the number of users using LibreOffice on a Mac
Comment 6 Alex Thurgood 2012-08-14 09:45:04 UTC
Confirming, on OSX 10.8 Mountain Lion.

I think this is Thorsten's area ?


Alex
Comment 7 Alex Thurgood 2012-08-14 09:51:53 UTC
@Thorsten : your call, I think ?


Alex
Comment 8 Don't use this account, use tml@iki.fi 2013-02-20 08:52:36 UTC
The attached crash logs unfortunately don't really give much hints what the problem in our importer code is/was.

Luckily (?), our Spotlight importer code hasn't actually even been invoked after LibreOffice 3.5, I think, so these crashes haven't been seen in more recent versions... I recently noticed that the importer isn't working, because the required symbol in the importer (which is actually a dynamic library) was not exported. And after that was fixed, another problem in the importer that caused it to not actually handle the ODF documents that it is supposed to handle was found and fixed. In my very light testing, it seems to work now. But whether we should dare include a thusly fixed importer it in 4.0.1 or not, I don't know.
Comment 9 How can I remove my account? 2013-11-16 07:52:41 UTC
Can anybody confirm that the Spotlight importer code works in current versions of LibreOffice?
Comment 10 Alex Thurgood 2014-01-08 20:26:24 UTC
Hi Tor,

As per my findings today indicated on IRC dev, mdworker32 still sigsevs with the plugin in LO 4.1.3.2, at least on Mavericks, because I don't see any such problem on Mountain Lion, but the crashreport indicates that a particular OTP template file is the reason for this, which I don't have in my production release running on Mountain Lion.

Alex
Comment 11 Alex Thurgood 2014-01-08 20:51:58 UTC
The file indicated as suspicious :

lyt-yereblend.otp

which can be found, among others, in :

suse/noarch/libreoffice-templates-presentation-layouts-3.3-1.3.1.noarch.rpm

and called in :
extras/AllLangZip_accessoriestemplateslayout.mk
Comment 12 Alex Thurgood 2014-01-08 21:21:22 UTC
Oh, wait, there are several different versions of the same file...

core/extras/source/premium/templates/layout/lang/de

and 

core/extras/source/premium/templates/layout/lang/en-US

with different sizes, groan...
Comment 13 Alex Thurgood 2014-01-08 21:33:55 UTC
OK, so after copying the template into my LO 4132 app share/templates folder, I get 4 crash logs within one minute, whereas before I had none. The suspicious file indicated by the crash log via mdutil -t xxxxxxxx

points to: 
/Users/alex/DevHack/git/libo/core/extras/source/premium/templates/layout/lang/de/lyt-yereblend.otp
Comment 14 Alex Thurgood 2014-01-08 21:36:46 UTC
Created attachment 91709 [details]
crash log after adding otp file to LO template path
Comment 15 How can I remove my account? 2014-01-09 12:10:32 UTC
Could somebody please attach the problematic lyt-yereblend.otp file to this bug, thanks.
Comment 16 How can I remove my account? 2014-01-09 12:12:12 UTC
Ah, found it at http://sourceforge.net/projects/aoo-templates/files/184/lyt-yereblend.otp
Comment 17 How can I remove my account? 2014-01-09 12:18:46 UTC
If I try to import the metadata from that file from sourceforge, it succeeds. I used the mdimport32 command, see 'man mdimport', as in:

mdimport32 -d4 Downloads/lyt-yereblend.otp

This is with LibreOffice 4.1.4.2 on Mavericks.
Comment 18 How can I remove my account? 2014-01-09 12:38:15 UTC
I guess it is possible that the copy of the problematic .otp file that I found is different from the one that causes the crash, so please, do attach that.
Comment 19 Alex Thurgood 2014-01-14 09:07:08 UTC
Created attachment 92021 [details]
lyt-yereblend from templates/layout/lang/de
Comment 20 Alex Thurgood 2014-01-14 09:12:09 UTC
On Mountain Lion 10.8.5


mdimport -d4 /Users/alex/DevHack/git/libo/core/extras/source/premium/templates/layout/lang/de/lyt-yereblend.otp  
(Debug) Import: file:/Users/alex/DevHack/git/libo/core/extras/source/premium/templates/layout/lang/de/lyt-yereblend.otp plugin:file://localhost/Applications/LibreOffice.app/Contents/Library/Spotlight/OOoSpotlightImporter.mdimporter/ /Applications/LibreOffice.app/Contents/Library/Spotlight/OOoSpotlightImporter.mdimporter
2014-01-14 10:08:29.108 mdimport[2632:707] Error loading /Applications/LibreOffice.app/Contents/Library/Spotlight/OOoSpotlightImporter.mdimporter/Contents/MacOS/OOoSpotlightImporter:  dlopen(/Applications/LibreOffice.app/Contents/Library/Spotlight/OOoSpotlightImporter.mdimporter/Contents/MacOS/OOoSpotlightImporter, 262): no suitable image found.  Did find:
	/Applications/LibreOffice.app/Contents/Library/Spotlight/OOoSpotlightImporter.mdimporter/Contents/MacOS/OOoSpotlightImporter: mach-o, but wrong architecture
2014-01-14 10:08:29.110 mdimport[2632:707] Cannot find function pointer MetadataImporterPluginFactory for factory A3FCC88D-B9A6-4364-8B93-92123C8A2D18 in CFBundle/CFPlugIn 0x7fdf2142e020 </Applications/LibreOffice.app/Contents/Library/Spotlight/OOoSpotlightImporter.mdimporter> (bundle, not loaded)
(Error) Import: Could not create instance for plugIn 'file://localhost/Applications/LibreOffice.app/Contents/Library/Spotlight/OOoSpotlightImporter.mdimporter/'
(Error) Import: BAD IMPORTER ~~~~~~~~~~~~~~~~~~ file://localhost/Applications/LibreOffice.app/Contents/Library/Spotlight/OOoSpotlightImporter.mdimporter/
2014-01-14 10:08:29.112 mdimport[2632:707] Imported '/Users/alex/DevHack/git/libo/core/extras/source/premium/templates/layout/lang/de/lyt-yereblend.otp' of type 'org.oasis-open.opendocument.presentation-template' with plugIn /Applications/LibreOffice.app/Contents/Library/Spotlight/OOoSpotlightImporter.mdimporter.
2014-01-14 10:08:29.113 mdimport[2632:707] Attributes: {
    "_kMDItemFinderLabel" = 0;
    "_kMDItemStaticInterestScore" = "0.1111111";
    "com_apple_metadata_modtime" = 305576163;
    kMDItemContentCreationDate = "2010-09-07 18:16:03 +0000";
    kMDItemContentModificationDate = "2010-09-07 18:16:03 +0000";
    kMDItemContentType = "org.oasis-open.opendocument.presentation-template";
    kMDItemContentTypeTree =     (
        "org.oasis-open.opendocument.presentation-template",
        "public.data",
        "public.item",
        "public.content"
    );
    kMDItemDisplayName =     {
        "" = "lyt-yereblend.otp";
    };
    kMDItemKind =     {
        "" = "OpenDocument Presentation Template";
        fr = "Mod\U00e8le de pr\U00e9sentation OpenDocument";
    };
    kMDItemLogicalSize = 784556;
    kMDItemPhysicalSize = 786432;
}
macbookpro:~ alex$
Comment 21 Alex Thurgood 2014-01-14 09:17:39 UTC
Note that I do not appear to have mdimport32 on my system.

My understanding of the first part of the output is that it mdimport expects a 64bit importer plugin and that this doesn't happen with current release versions of LO (which are 32bit), hence the mach-o error. As to the rest of the output, I have no idea.



Alex
Comment 22 How can I remove my account? 2014-01-14 09:19:06 UTC
Ah ok, well without mdimport32 I guess it is impossible to test the spotlight plug-in from the command line.
Comment 23 Alex Thurgood 2014-01-14 09:20:00 UTC
The LibreOffice.app referenced in the output is :

Version: 4.2.0.1
Build ID: 7bf567613a536ded11709b952950c9e8f7181a4a


Alex
Comment 24 Alex Thurgood 2014-01-14 09:23:15 UTC
Trying with 64bit dev build importer plugin :



mdimport -d4 -g /Applications/LibreOfficeDev.app/Contents/Library/Spotlight/OOoSpotlightImporter.mdimporter /Users/alex/DevHack/git/libo/core/extras/source/premium/templates/layout/lang/de/lyt-yereblend.otp  
2014-01-14 10:22:34.483 mdimport[3036:707] loading plugin at path '/Applications/LibreOfficeDev.app/Contents/Library/Spotlight/OOoSpotlightImporter.mdimporter' for all files
(Debug) Import: file:/Users/alex/DevHack/git/libo/core/extras/source/premium/templates/layout/lang/de/lyt-yereblend.otp plugin:file://localhost/Applications/LibreOfficeDev.app/Contents/Library/Spotlight/OOoSpotlightImporter.mdimporter/ /Applications/LibreOfficeDev.app/Contents/Library/Spotlight/OOoSpotlightImporter.mdimporter
Segmentation fault: 11
Comment 25 How can I remove my account? 2014-01-14 10:19:07 UTC
OK, with the document from comment #19 I can reproduce the crash using mdimport32, also in a fresh debug build. Let's hope I can find and fix the root cause.
Comment 26 Commit Notification 2014-01-14 12:52:28 UTC
Tor Lillqvist committed a patch related to this issue.
It has been pushed to "master":

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

fdo#47689: Avoid crashing mdworker: Don't use uninitialized variable



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 27 Alex Thurgood 2014-01-14 13:01:22 UTC
(In reply to comment #26)

> fdo#47689: Avoid crashing mdworker: Don't use uninitialized variable
> 

Nice catch, thanks !


Alex
Comment 28 Commit Notification 2014-01-15 11:27:17 UTC
Tor Lillqvist committed a patch related to this issue.
It has been pushed to "libreoffice-4-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=2158a26f25b67fdd2564d2e01c2a0a720ef7f2e1&h=libreoffice-4-2

fdo#47689: Avoid crashing mdworker: Don't use uninitialized variable


It will be available in LibreOffice 4.2.1.

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 29 Commit Notification 2014-01-16 09:01:33 UTC
Tor Lillqvist committed a patch related to this issue.
It has been pushed to "libreoffice-4-2-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=b591830c3cba2698aee26b806214e229db4c4483&h=libreoffice-4-2-0

fdo#47689: Avoid crashing mdworker: Don't use uninitialized variable


It will be available already in LibreOffice 4.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 30 Joel Madero 2015-05-02 15:44:14 UTC Comment hidden (obsolete)
Comment 31 Alex Thurgood 2016-05-19 07:29:50 UTC
Seems that the problem is back again in bug 98363 and recent versions of LO on OSX 10.11.4.
Comment 32 Caolán McNamara 2016-08-09 15:09:19 UTC
Lets keep this closed. The issue mentioned here was fixed in 2014 and the code touched there is unchanged now. The new problem with perhaps similar symptoms is bug 98363.