Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I recently migrated a user from OS X 10.4 to 10.5. When we run Mail.app, it will crash when certain messages are clicked.

I've tried everything I could to get the mail in in a different way -- importing it in different ways, deleting ~/Library/Preferences/com.apple.mail.plist, and re-importing, etc.

It certainly seems that the problem is tied to the individual message, as clicking on a certain message, even if it is in different folders (because of the way it was imported) causes the crash.

Most of the dozen-or-so crash logs start like this:

Process:         Mail [17905] Path:   
/Applications/Mail.app/Contents/MacOS/Mail
Identifier:      com.apple.mail
Version:         3.3 (926.1) Build
Info:      Mail-9260100~1 Code Type:  
X86 (Native) Parent Process:  launchd
[119]

Date/Time:       2009-09-29
10:47:52.713 -0600 OS Version:     
Mac OS X 10.5.7 (9J61) Report Version:
6 Anonymous UUID: 
285B8613-3118-4F91-A28C-BC405D91FAFD

Exception Type:  EXC_BAD_ACCESS
(SIGSEGV) Exception Codes:
KERN_INVALID_ADDRESS at
0x0000000089082454 Crashed Thread:  0

Application Specific Information:
-[MessageContentController _fetchContentsForMessage:fromStore:withViewingState:]

One entry shows:

Application Specific Information:
-[MessageTransfer _synchronouslyPerformTransfer]
+[Library synchronouslyUpdateMessageFiles]
-[MessageContentController _fetchContentsForMessage:fromStore:withViewingState:]


Update

Do see my comments to the answer(s) below.

I was able to determine which file corresponds to which e-mail. First, I had to figure out where the e-mail folder was. Looking in ~/Library/com.apple.mail.plist helped. (I think running

defaults read com.apple.mail | grep AccountPath

will get that information)

In this case, the folder was analogous to:

~/Library/Mail/POP-first.last#mail.ourdomain.com@IP_ADDRESS/INBOX.mbox/Messages

I then went to that directory, and issued this command:

grep -r . -e "^From: " -e "^Subject: " -e "^Date: " -m 3 > summary.txt

I then opened the file and searched in it. Searching for the subject makes it easy to see which file the message resides in.

Having done that, I looked at some of the files -- and nothing appears to be amiss to me :(

Update 2 - Ongoing Problem

I had hopes that this only affected older e-mails, but an e-mail received yesterday (Oct 21) also exhibits the problem.

Update 3 - System Log

Curiously, when I opened the console as the user, nothing showed up in the "All Messages" or "Console Messages" section. Here is what I got from tailing the system.log, when I opened Mail, selected a message that would crash it, and repeated the process a second time:

Oct 23 10:01:29 [computer-name] Console[56949]: Error: status 2 returned by _asl_server_query
Oct 23 10:01:39 [computer-name] ReportCrash[57070]: Formulating crash report for process Mail[56828]
Oct 23 10:01:40 [computer-name] ReportCrash[57070]: Saved crashreport to /Users/[user-name]/Library/Logs/CrashReporter/Mail_2009-10-23-100136_[computer-name].crash using uid: 504 gid: 504, euid: 504 egid: 504
Oct 23 10:01:40 [computer-name] com.apple.launchd[296] ([0x0-0x14c14c].com.apple.mail[56828]): Exited abnormally: Segmentation fault
Oct 23 10:02:01 [computer-name] ReportCrash[57098]: Formulating crash report for process Mail[57085]
Oct 23 10:02:02 [computer-name] ReportCrash[57098]: Saved crashreport to /Users/[user-name]/Library/Logs/CrashReporter/Mail_2009-10-23-100159_[computer-name].crash using uid: 504 gid: 504, euid: 504 egid: 504
Oct 23 10:02:02 [computer-name] com.apple.launchd[296] ([0x0-0x150150].com.apple.mail[57085]): Exited abnormally: Segmentation fault
Oct 23 10:03:02 [computer-name] Console[56949]: Error: status 2 returned by _asl_server_query

Additional Question

It occurs to me that there is a slight chance that the data is good and the application (or one of the libraries or frameworks it depends upon) is corrupt. Is there a good way to check? (I could recursively md5sum the whole hard drive, and do that on a machine that has a pristine image, but there would still be a lot of noise in the data, I'm sure.)

I am copying the library folder from the old partition and will try to restore it on a different computer.

share|improve this question
    
Are the messages only stored locally (eg. POP account) or is it possible to resyncronize the account (eg. IMAP)? –  Chealion Sep 29 '09 at 21:28
    
The messages are in a POP account. –  Clinton Blackmore Sep 29 '09 at 22:33

3 Answers 3

up vote 1 down vote accepted
+200

Unless I have overlooked, I don't find that you have mentioned the version of 10.5 you are using. I had Mail.app crashing when opening attachments (and even reading some messages) issue when I was running 10.5.4. I upgraded to 10.5.5, but the problem persisted. From 10.5.5, I made a whopping jump to 10.5.8, which came with a new version of Mail.app that completely fixed the problem. Mail.app no longer crashed. I have since upgraded to Snow Leopard, which I believe also brings the latest version of Mail.app. I have been happy since.

share|improve this answer
    
It is running 10.5.7. I'll try upgrading it; that is a good idea. –  Clinton Blackmore Oct 23 '09 at 16:41
    
Hooray! It worked. I did use the combo updater, just in case the regular updater would miss something. I can't believe the solution was so simple. –  Clinton Blackmore Oct 23 '09 at 17:38

Just to reiterate, the problem is: even though the mail store itself has been migrated successfully into 10.5, Mail.app will crash when trying to view certain individual messages.

You need to check a few things of course.

  • First add the attachments view column, View->Columns->Attachments. See if the messages that make mail crash correspond with attachments.
  • Second deduce if there is something common amongst all the messages that crash.
  • Third test to see if the same mail message will consistently make the app crash. If it does then at least you know it's a problem with the messages and not the app.

    Also, try disabling the built in ACL's to see if it's some sort of permissions error. On the command line type: fsaclctl -p / -d

    Please let us know what you find.

  • share|improve this answer
        
    Acknowledged; thank you. Your understanding on the migration is correct. I know that specific messages will, when selected (and before displaying anything) make Mail crash 100% of the time. I will have to look into your other points when I have a chance (hopefully tomorrow). –  Clinton Blackmore Oct 21 '09 at 23:04
        
    All the messages that cause the crash have attachments (but not all messages with attachments cause a crash). I haven't determined any other commonalities. It is something related to the message; a given message will always cause the app to crash (although I did have a hang once). Disabling the ACLs did not seem to help. The user owns all the files in the Mail Downloads folder. Some have extended attributes; it does not appear to be ACLs but "com.apple.FinderInfo 32" when viewed with ls -l@e –  Clinton Blackmore Oct 22 '09 at 16:27
        
    On a whim, I quit Mail and renamed ~/Library/Mail Downloads. I then opened a message with an attachment and double-clicked on it. I was surprised when it opened. There is now a new Mail Downloads folder with the one file in it. I take that to mean that downloads are stored with the original message until someone requests them. Mail still crashes when I select certain messages. –  Clinton Blackmore Oct 22 '09 at 16:33
        
    Yes, the attachment is stored in the email and then extracted out when requested. I'm not sure what else I can suggest at this point to solve the problem. It sounds like it's working better than before at least. –  Jordan Eunson Oct 22 '09 at 17:05

    Did you check with Console.app (left panel : Database -> all messages) if they were any third-party plugins or extensions that were loaded before Mail launches or before you read those crashing emails ?

    If the problem comes from something other than Mail, it should be log there.

    share|improve this answer
        
    That does not appear to be the case. I don't believe there are any extensions to Mail installed, and (see my updates to the post), there doesn't appear to be anything in the system.log about it. –  Clinton Blackmore Oct 23 '09 at 16:21

    Your Answer

     
    discard

    By posting your answer, you agree to the privacy policy and terms of service.

    Not the answer you're looking for? Browse other questions tagged or ask your own question.