Mojave 10.14.4 here --
mds_worker processes constantly crashing and re-spawning as per the logs. The 'indexing' spotlight bar stops at various different points, always getting stuck, though in different places apparently. I've rebuilt the database many times (using mdutil -i on/off, -a -E, etc., as well as the GUI method). The database is clearly not complete - searching filenames that I can literally see turns up nothing in some cases and finds it in others. Mail isn't returning good search results either.
In-place OS reinstall has been done; didn't clear up the issue.
Apple is now recommending I install Mojave on a separate partition, boot into it and see if it has the same issue - don't see how that's going to help (yet), but I have to do it in order to move the process forward. I'll update with any findings once I've done that.
It seems like it's choking on some piece of data I have, and I need to figure out what that is so I can remove it.
It seems like many
md_worker processes get spawned from a parent -- and the process that crashes does so, so quickly that I can't don't have time to do an
lsof -p on it.
Is there another way to do this, or to get more information about the file(s) it's choking on from
Edit1: Ok, I figured out that I can get significantly more information about what mds* is doing with the following commands. I have yet to run this on the affected machine.
sudo log config --mode "private_data:on"
log stream --style compact --predicate '(process contains[c] "mdworker") && (subsystem == [c] "com.apple.spotlightserver")' --info --debug
The first command turns off obfuscation, otherwise file paths are obscured (and replaced with "<private>") - I suppose to make it safe to share logs. See here: https://superuser.com/questions/1311578/in-console-app-how-can-i-reveal-to-what-private-tags-are-actually-referring