Search code examples
macoscocoaspotlight

Occasional mdworker crash with new custom importer for some files


My Spotlight importer is importing meta-data from a couple hundred of my app's document files.

All is working fine under the Xcode debugger with various files. However, the mdworker process crashes twice for the 300+ files when running the importer once it's installed on the system.

The stack trace doesn't help much to indicate the issue (some STL libary location) - Is there any way turning on more debugging information for importers running in the field in Spotlight server?
In particular the name of the file triggering the crash?

Any hints appreciated.


Solution

  • Ok, just running the importer under the debugger for pretty much everything (a.k.a. /Users/) not just a particular file eventually tracked down the problem files, i.e. in the Xcode scheme using mdimport as hosting executable and options

    • -d2 (or d4 or whatever)
    • -g $(BUILT_PRODUCTS_DIR)/MyImporter.mdimporter
    • /Users/