MailCore / mailcore2

MailCore 2 provide a simple and asynchronous API to work with e-mail protocols IMAP, POP and SMTP. The API has been redesigned from ground up.
Other
2.61k stars 627 forks source link

iOS - Crashes at MCData.cc - appendBytes #1518

Open JesusMartinAlonso opened 8 years ago

JesusMartinAlonso commented 8 years ago

I have MailCore integrated in my iOS project. Recenty, I have received in Crittercism (now Apteligent), several reports about crashes of the app caused by MailCore. The crashes are caused by the appendBytes method of MCData.cc, which is called from several methods of MailCore2. An example of a crash is:

Name: MCData.cc Reason: SEGV_MAPERR

    libsystem_platform.dylib 0x0000000180c52240 _platform_memmove + 76
!   1   app 0x000000010029f6f4 appendBytes (char, unsigned int) (MCData.cc:123)
    2   app 0x000000010029f4d0 Data (char, unsigned int) (MCData.cc:84)
    3   app 0x000000010029f600 dataWithBytes (char, unsigned int) (MCData.cc:101)
    4   app 0x00000001002b997c dataAndFilterBccAndForEncryption (bool, bool) (MCMessageBuilder.cc:792)
    5   app 0x00000001002d64e8 -[MCOMessageBuilder data] (MCOMessageBuilder.mm:66) 

Another example is the next trace:

Name: MCData.cc Reason: SEGV_MAPERR

        0   libsystem_platform.dylib 0x00000001810d6240 _platform_memmove + 76
!   1   app 0x00000001001b76f4 appendBytes (char, unsigned int) (MCData.cc:123)
    2   app 0x00000001001b74d0 Data (char, unsigned int) (MCData.cc:84)
    3   app 0x00000001001b7600 dataWithBytes (char, unsigned int) (MCData.cc:101)
    4   app 0x00000001001f6424 -[MCOSMTPSession sendOperationWithData:] (MCOSMTPSession.mm:109) 

And more:

Name: MCData.cc Reason: SEGV_MAPERR

libsystem_platform.dylib 0x00000001819fe240 _platform_memmove + 76
!   1   app 0x000000010021f6f4 appendBytes (char, unsigned int) (MCData.cc:123)
    2   app 0x000000010021f4d0 Data (char, unsigned int) (MCData.cc:84)
    3   app 0x000000010021f600 dataWithBytes (char, unsigned int) (MCData.cc:101)
    4   app 0x0000000100255cf8 +[MCOAttachment attachmentWithData:filename:] (MCOAttachment.mm:63) 

I have tried to reproduce the crashes, but everything appears to be OK. Any ideas, what is causing these crashes?

Thank you very much

dinhvh commented 7 years ago

Could you show a simple code sample the reproduces the issue?