After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 686278 - Prefer-plain can break parts list
Prefer-plain can break parts list
Status: RESOLVED FIXED
Product: evolution
Classification: Applications
Component: Mailer
3.6.x (obsolete)
Other Linux
: Normal major
: ---
Assigned To: evolution-mail-maintainers
Evolution QA team
evolution[formatter]
: 685772 686216 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2012-10-17 08:55 UTC by Milan Crha
Modified: 2012-10-17 11:46 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
test message (2.55 KB, text/plain)
2012-10-17 08:55 UTC, Milan Crha
  Details
evo patch (1.95 KB, patch)
2012-10-17 09:52 UTC, Milan Crha
committed Details | Review

Description Milan Crha 2012-10-17 08:55:12 UTC
Created attachment 226615 [details]
test message

The attached message structure is a multipart/mixed, which contains another multipart/mixed part, and selecting this message for preview results in high CPU usage by evolution with no result in preview panel and left "Parsing message" in status bar. The below backtrace shows where it is.

Thread 3 (Thread 0x7f23b53f9700 (LWP 10783))

  • #0 g_slist_last
    at gslist.c line 789
  • #1 g_slist_concat
    at gslist.c line 390
  • #2 empe_mp_mixed_parse
    at e-mail-parser-multipart-mixed.c line 126
  • #3 e_mail_parser_extension_parse
    at e-mail-parser-extension.c line 86
  • #4 e_mail_parser_parse_part_as
    at e-mail-parser.c line 497
  • #5 empe_message_parse
    at e-mail-parser-message.c line 106
  • #6 e_mail_parser_extension_parse
    at e-mail-parser-extension.c line 86
  • #7 mail_parser_run
    at e-mail-parser.c line 101
  • #8 e_mail_parser_parse_sync
    at e-mail-parser.c line 309
  • #9 mail_reader_parse_message_run
    at e-mail-reader-utils.c line 1983
  • #10 run_in_thread
    at gsimpleasyncresult.c line 861
  • #11 io_job_thread
    at gioscheduler.c line 177
  • #12 g_thread_pool_thread_proxy
    at gthreadpool.c line 309
  • #13 g_thread_proxy
    at gthread.c line 801
  • #14 start_thread
    from /lib64/libpthread.so.0
  • #15 clone
    from /lib64/libc.so.6

Comment 1 Milan Crha 2012-10-17 09:52:27 UTC
Created attachment 226621 [details] [review]
evo patch

for evolution;

Found out that the issue is with prefer-plain, it mangled list of parts in a way that it made it recursive, thus the g_slist_concat never ended. This patch makes basically three things:
a) the text/plain part of multipart/alternative is always the first in
   the parts list for the formatter, as it ought to be
b) in case the multipart/alternative contains multiple text/plain parts
   the code doesn't leak, nor uses multiple place holders
c) the code is simpler
Comment 2 Milan Crha 2012-10-17 10:09:08 UTC
Created commit b30295b in evo master (3.7.1+)
Created commit 031f8b2 in evo gnome-3-6 (3.6.2+)
Comment 3 Dan Vrátil 2012-10-17 10:16:17 UTC
*** Bug 685772 has been marked as a duplicate of this bug. ***
Comment 4 Dan Vrátil 2012-10-17 11:46:21 UTC
*** Bug 686216 has been marked as a duplicate of this bug. ***