[GH-ISSUE #150] Crash in email header encoding conversion on macOS Sonoma #118

Closed
opened 2026-03-03 01:19:57 +03:00 by kerem · 2 comments
Owner

Originally created by @lexgorbunov on GitHub (Dec 14, 2023).
Original GitHub issue: https://github.com/d99kris/nmail/issues/150

Originally assigned to: @d99kris on GitHub.

Description:

unexpected termination: 6
0   0x0000000104ea4324  Util::SignalCrashHandler(int)
1   0x0000000185053a24  _sigtramp
2   0x0000000185024cc0  pthread_kill
3   0x0000000184f34a40  abort
4   0x0000000184f33d30  err
5   0x0000000222b22ca4  _citrus_iconv_std_iconv_convert.cold.3
6   0x0000000222b227e0  _citrus_iconv_std_iconv_convert
7   0x00000001918b6cd8  __bsd_iconv
8   0x0000000104efeca4  mail_iconv
9   0x0000000104efe9f4  charconv
a   0x0000000104ef96a4  mailmime_encoded_phrase_parse
b   0x0000000104ea6350  Util::MimeToUtf8(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&)
c   0x0000000104e10940  Header::Parse()
d   0x0000000104e0fac8  Header::SetHeaderData(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, long)
e   0x0000000104e1579c  Imap::GetHeaders(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, std::__1::set<unsigned int, std::__1::less<unsigned int>, std::__1::allocator<unsigned int>> const&, bool, bool, std::__1::map<unsigned int, Header, std::__1::less<unsigned int>, std::__1::allocator<std::__1::pair<unsigned int const, Header>>>&)
f   0x0000000104e3b914  ImapManager::PerformRequest(ImapManager::Request const&, bool, bool, ImapManager::Response&)
10  0x0000000104e36f80  ImapManager::Process()
11  0x0000000104e3d5ec  void* std::__1::__thread_proxy[abi:v160006]<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct>>, void (ImapManager::*)(), ImapManager*>>(void*)
12  0x0000000185025034  _pthread_start
13  0x000000018501fe3c  thread_start

How to reproduce it:
Just run application and waiting for few seconds

Environment:
OS: Sonoma 14.1.2
Chip: Apple M1 Max

Originally created by @lexgorbunov on GitHub (Dec 14, 2023). Original GitHub issue: https://github.com/d99kris/nmail/issues/150 Originally assigned to: @d99kris on GitHub. **Description**: ``` unexpected termination: 6 0 0x0000000104ea4324 Util::SignalCrashHandler(int) 1 0x0000000185053a24 _sigtramp 2 0x0000000185024cc0 pthread_kill 3 0x0000000184f34a40 abort 4 0x0000000184f33d30 err 5 0x0000000222b22ca4 _citrus_iconv_std_iconv_convert.cold.3 6 0x0000000222b227e0 _citrus_iconv_std_iconv_convert 7 0x00000001918b6cd8 __bsd_iconv 8 0x0000000104efeca4 mail_iconv 9 0x0000000104efe9f4 charconv a 0x0000000104ef96a4 mailmime_encoded_phrase_parse b 0x0000000104ea6350 Util::MimeToUtf8(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) c 0x0000000104e10940 Header::Parse() d 0x0000000104e0fac8 Header::SetHeaderData(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, long) e 0x0000000104e1579c Imap::GetHeaders(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, std::__1::set<unsigned int, std::__1::less<unsigned int>, std::__1::allocator<unsigned int>> const&, bool, bool, std::__1::map<unsigned int, Header, std::__1::less<unsigned int>, std::__1::allocator<std::__1::pair<unsigned int const, Header>>>&) f 0x0000000104e3b914 ImapManager::PerformRequest(ImapManager::Request const&, bool, bool, ImapManager::Response&) 10 0x0000000104e36f80 ImapManager::Process() 11 0x0000000104e3d5ec void* std::__1::__thread_proxy[abi:v160006]<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct>>, void (ImapManager::*)(), ImapManager*>>(void*) 12 0x0000000185025034 _pthread_start 13 0x000000018501fe3c thread_start ``` **How to reproduce it**: Just run application and waiting for few seconds **Environment**: OS: Sonoma 14.1.2 Chip: Apple M1 Max
kerem 2026-03-03 01:19:57 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@d99kris commented on GitHub (Dec 14, 2023):

Hi @lexgorbunov - thanks for reporting. It seems like a bad bug, but I need some more data to determine the root cause.

Could you help apply the attached patch nmail-charconv.patch, build nmail and try reproduce the crash again?

Once it crashes, can you share the end of your log file ~/.nmail/log.txt, likely the last line containing MimeToUtf8 before the crash callstack will be sufficient. Should the line contain data you do not wish to share here, feel free to send it via email to d99kris at gmail dot com.

To apply the patch:

# go to your clone directory for nmail
git apply ~/nmail-charconv.patch
# build nmail, ex:
./make.sh build
# run:
./build/nmail
<!-- gh-comment-id:1855659666 --> @d99kris commented on GitHub (Dec 14, 2023): Hi @lexgorbunov - thanks for reporting. It seems like a bad bug, but I need some more data to determine the root cause. Could you help apply the attached patch [nmail-charconv.patch](https://github.com/d99kris/nmail/files/13672545/nmail-charconv.patch), build nmail and try reproduce the crash again? Once it crashes, can you share the end of your log file `~/.nmail/log.txt`, likely the last line containing `MimeToUtf8` before the crash callstack will be sufficient. Should the line contain data you do not wish to share here, feel free to send it via email to `d99kris` `at` `gmail` `dot` `com`. To apply the patch: ``` # go to your clone directory for nmail git apply ~/nmail-charconv.patch # build nmail, ex: ./make.sh build # run: ./build/nmail ```
Author
Owner

@d99kris commented on GitHub (Jan 7, 2024):

Hi again - I did some googling and it seems there are others who encountered similar issues on macOS 14.1.x and iOS 17.1.x. It appears the the issue should be fixed in 17.2, and thus likely also in macOS 14.2. I will proceed to close this issue for now, but feel free to re-open it if you still see it on macOS 14.2 (or later) and help to provide the information requested in the above comment. Thanks!

<!-- gh-comment-id:1879929847 --> @d99kris commented on GitHub (Jan 7, 2024): Hi again - I did some googling and it seems there are [others](https://github.com/dinhvh/libetpan/issues/442) [who](https://github.com/boostorg/locale/issues/196) [encountered](https://github.com/MailCore/mailcore2/issues/1992) similar issues on macOS 14.1.x and iOS 17.1.x. It appears the the issue [should be fixed in 17.2](https://github.com/MailCore/mailcore2/issues/1992#issuecomment-1833840272), and thus likely also in macOS 14.2. I will proceed to close this issue for now, but feel free to re-open it if you still see it on macOS 14.2 (or later) and help to provide the information requested in the above comment. Thanks!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nmail#118
No description provided.