‘Segmentation fault: 11’ almost always means the process ran out of RAM whilst trying to perform some operation/calculation. This would corroborate with your slow Mail due to the size of the database you're trying to process (or it's just corrupted in such a way).
It may also be worth checking your free disk space, since the VACUUM command specifically requires plenty of space:
The VACUUM command works by copying the contents of the database into a temporary database file and then overwriting the original with the contents of the temporary file. […] as much as twice the size of the original database file is required in free disk space.
How Mojave responds when an application tries to access this sensitive information; will it alert the user, block unsigned apps or what?
When an application attempts to access restricted directory the user will be prompted with a dialog box explaining the following information:
- What Application
- What the application is trying to access
- Option to Allow or to Not Allow access
Many applications will prompt for a folder or file selection. If you attempt to drag a folder from a restricted directory (from a normal finder window) into the
choose a file dialog box, the folder will open as a blank folder with the prohibited folder icon. This will not produce a request permission dialog box.
The exception to asking for access is Terminal. If certain Terminal commands attempts to access these directories they will be blocked automatically without a dialog box.
$ sudo cp -r ~/Library/Messages/ ~/Desktop/test
cp: /Users/[User]/Library/Messages/: unable to copy extended attributes to /Users/[User]/Desktop/test: Operation not permitted
cp: /Users/[User]/Library/Messages/: Operation not permitted
When attempting to use the zip command the directory is ziped up, recursively, until the blocked directory at which it will appear to be empty.
$ zip -r ~/Desktop/imessage.zip ~/Library/Messages/
Screenshot taken of finder after unzipping (~/Desktop/imessage.zip) and opening. As you can see it is empty.
If you would like to add exceptions to give certain apps unrestricted permissions this can be done in System Preferences.
- System Preferences>Security & Privacy>Privacy
- Unlock if needed
- Select type of permission
- Location Services
- Application Data (Includes Message data, Mail data, etc.)
- Click the
- Select your app
- Press Add
Note: The application will have to be restarted for changes to take effect.
Warning: Adding terminal will give all terminal commands access.
I was having this issue and solved it before posting the question. I was also having other quirky permissions issues within Terminal after upgrading to Mojave.
I stumbled upon this and thought I would share here, since I don't normally consult the more casual Mac user pages: Fix Terminal “Operation not permitted” Error in MacOS Mojave
Basically, you need to add Terminal.app to have Full Disk Access within System Preferences -> Security & Privacy -> Privacy tab.