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 724909 - Highlight module hangs on large attachments
Highlight module hangs on large attachments
Status: RESOLVED FIXED
Product: evolution
Classification: Applications
Component: Mailer
3.11.x (obsolete)
Other Linux
: Normal normal
: ---
Assigned To: evolution-mail-maintainers
Evolution QA team
: 731344 732690 734998 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2014-02-21 19:58 UTC by Priit Laes (IRC: plaes)
Modified: 2014-11-20 13:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
freezing-email.txt (266.21 KB, text/plain)
2014-02-21 19:58 UTC, Priit Laes (IRC: plaes)
Details

Description Priit Laes (IRC: plaes) 2014-02-21 19:58:36 UTC
Created attachment 269947 [details]
freezing-email.txt

Attaching email causing the hang...
Comment 1 Priit Laes (IRC: plaes) 2014-02-21 20:13:46 UTC
This is with evolution-3.11.90 and webkit-gtk-2.2.4
Comment 2 Priit Laes (IRC: plaes) 2014-02-23 19:08:08 UTC
Backtrace after hang:

(gdb) thread apply all bt

Thread 1 (Thread 0x7ffff7f88940 (LWP 22586))

  • #0 select
    at ../sysdeps/unix/syscall-template.S line 81
  • #1 camel_write
    at camel-file-utils.c line 572
  • #2 camel_stream_write
    at camel-stream.c line 539
  • #3 camel_stream_write_string
    at camel-stream.c line 646
  • #4 emfe_text_highlight_format
    at e-mail-formatter-text-highlight.c line 234
  • #5 e_mail_formatter_format_as
    at e-mail-formatter.c line 999
  • #6 handle_mail_request
    at e-mail-request.c line 173
  • #7 mail_request_send_async
    at e-mail-request.c line 371
  • #8 WebCore::ResourceHandle::start()
    from /usr/lib64/libwebkitgtk-3.0.so.0
  • #9 WebCore::ResourceHandle::create(WebCore::NetworkingContext*, WebCore::ResourceRequest const&, WebCore::ResourceHandleClient*, bool, bool)
    from /usr/lib64/libwebkitgtk-3.0.so.0
  • #10 WebCore::ResourceLoader::start()
    from /usr/lib64/libwebkitgtk-3.0.so.0
  • #11 WebCore::ResourceLoadScheduler::servePendingRequests(WebCore::ResourceLoadScheduler::HostInformation*, WebCore::ResourceLoadPriority)
    from /usr/lib64/libwebkitgtk-3.0.so.0
  • #12 WebCore::ResourceLoadScheduler::scheduleSubresourceLoad(WebCore::Frame*, WebCore::CachedResource*, WebCore::ResourceRequest const&, WebCore::ResourceLoadPriority, WebCore::ResourceLoaderOptions const&)
    from /usr/lib64/libwebkitgtk-3.0.so.0
  • #13 WebCore::CachedResource::load(WebCore::CachedResourceLoader*, WebCore::ResourceLoaderOptions c---Type <return> to continue, or q <return> to quit--- onst&)
    from /usr/lib64/libwebkitgtk-3.0.so.0
  • #14 WebCore::CachedResourceLoader::requestResource(WebCore::CachedResource::Type, WebCore::CachedResourceRequest&)
    from /usr/lib64/libwebkitgtk-3.0.so.0
  • #15 WebCore::CachedResourceLoader::requestMainResource(WebCore::CachedResourceRequest&)
    from /usr/lib64/libwebkitgtk-3.0.so.0
  • #16 WebCore::DocumentLoader::startLoadingMainResource()
    from /usr/lib64/libwebkitgtk-3.0.so.0
  • #17 WebCore::FrameLoader::continueLoadAfterNavigationPolicy(WebCore::ResourceRequest const&, WTF::PassRefPtr<WebCore::FormState>, bool)
    from /usr/lib64/libwebkitgtk-3.0.so.0
  • #18 WebCore::FrameLoader::callContinueLoadAfterNavigationPolicy(void*, WebCore::ResourceRequest const&, WTF::PassRefPtr<WebCore::FormState>, bool)
    from /usr/lib64/libwebkitgtk-3.0.so.0
  • #19 WebCore::PolicyCallback::call(bool)
    from /usr/lib64/libwebkitgtk-3.0.so.0
  • #20 WebCore::PolicyChecker::continueAfterNavigationPolicy(WebCore::PolicyAction)
    from /usr/lib64/libwebkitgtk-3.0.so.0
  • #21 WebKit::FrameLoaderClient::dispatchDecidePolicyForNavigationAction(void (WebCore::PolicyChecker::*)(WebCore::PolicyAction), WebCore::NavigationAction const&, WebCore::ResourceRequest const&, WTF::PassRefPtr<WebCore::FormState>)
    from /usr/lib64/libwebkitgtk-3.0.so.0
  • #22 WebCore::PolicyChecker::checkNavigationPolicy(WebCore::ResourceRequest const&, WebCore::DocumentLoader*, WTF::PassRefPtr<WebCore::FormState>, void (*)(void*, WebCore::ResourceRequest const&, WTF::PassRefPtr<WebCore::FormState>, bool), void*)
    from /usr/lib64/libwebkitgtk-3.0.so.0
  • #23 WebCore::FrameLoader::loadWithDocumentLoader(WebCore::DocumentLoader*, WebCore::FrameLoadType, WTF::PassRefPtr<WebCore::FormState>)
    from /usr/lib64/libwebkitgtk-3.0.so.0
  • #24 WebCore::FrameLoader::loadWithNavigationAction(WebCore::ResourceRequest const&, WebCore::NavigationAction const&, bool, WebCore::FrameLoadType, WTF::PassRefPtr<WebCore::FormState>)
    from /usr/lib64/libwebkitgtk-3.0.so.0
  • #25 WebCore::FrameLoader::loadURL(WebCore::KURL const&, WTF::String const&, WTF::String const&, bool, WebCore::FrameLoadType, WTF::PassRefPtr<WebCore::Event>, WTF::PassRefPtr<WebCore::FormState>)
    from /usr/lib64/libwebkitgtk-3.0.so.0
  • #26 WebCore::FrameLoader::loadURLIntoChildFrame(WebCore::KURL const&, WTF::String const&, WebCore::Frame*)
    from /usr/lib64/libwebkitgtk-3.0.so.0
  • #27 WebKit::FrameLoaderClient::createFrame(WebCore::KURL const&, WTF::String const&, WebCore::HTMLFrameOwnerElement*, WTF::String const&, bool, int, int)
    from /usr/lib64/libwebkitgtk-3.0.so.0
  • #28 WebCore::SubframeLoader::loadSubframe(WebCore::HTMLFrameOwnerElement*, WebCore::KURL const&, WTF::String const&, WTF::String const&)
    from /usr/lib64/libwebkitgtk-3.0.so.0
  • #29 WebCore::SubframeLoader::loadOrRedirectSubframe(WebCore::HTMLFrameOwnerElement*, WebCore::KURL const&, WTF::AtomicString const&, bool, bool)
    from /usr/lib64/libwebkitgtk-3.0.so.0
  • #30 WebCore::SubframeLoader::requestFrame(WebCore::HTMLFrameOwnerElement*, WTF::String const&, WTF::AtomicString const&, bool, bool)
    from /usr/lib64/libwebkitgtk-3.0.so.0
  • #31 WebCore::HTMLFrameElementBase::openURL(bool, bool)
    from /usr/lib64/libwebkitgtk-3.0.so.0
  • #32 WebCore::ContainerNode::parserAppendChild(WTF::PassRefPtr<WebCore::Node>)
    from /usr/lib64/libwebkitgtk-3.0.so.0
  • #33 WebCore::HTMLConstructionSite::executeQueuedTasks()
    from /usr/lib64/libwebkitgtk-3.0.so.0
  • #34 WebCore::HTMLDocumentParser::constructTreeFromHTMLToken(WebCore::HTMLToken&)
    from /usr/lib64/libwebkitgtk-3.0.so.0
  • #35 WebCore::HTMLDocumentParser::pumpTokenizer(WebCore::HTMLDocumentParser::SynchronousMode)
    from /usr/lib64/libwebkitgtk-3.0.so.0
  • #36 WebCore::HTMLDocumentParser::append(WTF::PassRefPtr<WTF::StringImpl>)
    from /usr/lib64/libwebkitgtk-3.0.so.0
  • #37 WebCore::DecodedDataDocumentParser::appendBytes(WebCore::DocumentWriter*, char const*, unsigned long)
    from /usr/lib64/libwebkitgtk-3.0.so.0
  • #38 WebCore::DocumentLoader::commitData(char const*, unsigned long)
  • #39 WebKit::FrameLoaderClient::committedLoad(WebCore::DocumentLoader*, char const*, int)
    from /usr/lib64/libwebkitgtk-3.0.so.0
  • #40 WebCore::DocumentLoader::commitLoad(char const*, int)
    from /usr/lib64/libwebkitgtk-3.0.so.0
  • #41 WebCore::CachedRawResource::notifyClientsDataWasReceived(char const*, unsigned int)
    from /usr/lib64/libwebkitgtk-3.0.so.0
  • #42 WebCore::CachedRawResource::addDataBuffer(WebCore::ResourceBuffer*)
    from /usr/lib64/libwebkitgtk-3.0.so.0
  • #43 WebCore::SubresourceLoader::didReceiveDataOrBuffer(char const*, int, WTF::PassRefPtr<WebCore::SharedBuffer>, long long, WebCore::DataPayloadType)
    from /usr/lib64/libwebkitgtk-3.0.so.0
  • #44 WebCore::SubresourceLoader::didReceiveData(char const*, int, long long, WebCore::DataPayloadType)
    from /usr/lib64/libwebkitgtk-3.0.so.0
  • #45 WebCore::ResourceLoader::didReceiveData(WebCore::ResourceHandle*, char const*, int, int)
    from /usr/lib64/libwebkitgtk-3.0.so.0
  • #46 WebCore::readCallback(_GObject*, _GAsyncResult*, void*)
    from /usr/lib64/libwebkitgtk-3.0.so.0
  • #47 async_ready_callback_wrapper
    at /var/tmp/portage/dev-libs/glib-2.38.2/work/glib-2.38.2/gio/ginputstream.c line 519
  • #48 g_task_return_now
    at /var/tmp/portage/dev-libs/glib-2.38.2/work/glib-2.38.2/gio/gtask.c line 1108
  • #49 complete_in_idle_cb
    at /var/tmp/portage/dev-libs/glib-2.38.2/work/glib-2.38.2/gio/gtask.c line 1117
  • #50 g_main_dispatch
    at /var/tmp/portage/dev-libs/glib-2.38.2/work/glib-2.38.2/glib/gmain.c line 3066
  • #51 g_main_context_dispatch
    at /var/tmp/portage/dev-libs/glib-2.38.2/work/glib-2.38.2/glib/gmain.c line 3642
  • #52 g_main_context_iterate
    at /var/tmp/portage/dev-libs/glib-2.38.2/work/glib-2.38.2/glib/gmain.c line 3713
  • #53 g_main_loop_run
    at /var/tmp/portage/dev-libs/glib-2.38.2/work/glib-2.38.2/glib/gmain.c line 3907
  • #54 gtk_main
    at gtkmain.c line 1158
  • #55 main
    at main.c line 680

Comment 3 Priit Laes (IRC: plaes) 2014-02-23 22:06:47 UTC
The hang in evolution happens in modules/text-highlight/e-mail-formatter-text-highlight.c
on line 234 inside camel_stream_write_string function:

https://git.gnome.org/browse/evolution/tree/modules/text-highlight/e-mail-formatter-text-highlight.c#n234

I added debug messages before and after that function and only the message before was displayed.
Comment 4 Matthew Barnes 2014-02-24 14:15:27 UTC
Hangs for me too.  I didn't know the text-highlight module was doing blocking disk writes in the UI thread.  :(
Comment 5 Matthew Barnes 2014-02-24 14:25:24 UTC
The code spawns the 'highlight' utility, and tries to write the entire message through the stdin pipe before reading the converted output through the stdout pipe.

My guess is we're filling up a buffer somewhere, and we need to be writing and reading chunks simultaneously.  I'll see what I can do.
Comment 6 Matthew Barnes 2014-02-25 03:56:44 UTC
Fixed for Evolution 3.11.91:
https://git.gnome.org/browse/evolution/commit/?id=e15c81b8ee34fff9aa1da9085587e568e59da854
Comment 7 Milan Crha 2014-06-10 14:38:33 UTC
*** Bug 731344 has been marked as a duplicate of this bug. ***
Comment 8 Milan Crha 2014-09-08 11:13:41 UTC
I'm reopening this, it is still not fixed. The downstream bug report:
https://bugzilla.redhat.com/show_bug.cgi?id=1136807

evolution-3.12.4-1.fc20.i686
evolution-debuginfo-3.12.4-1.fc20.i686
evolution-ews-3.12.4-1.fc20.i686
evolution-data-server-debuginfo-3.12.5-1.fc20.i686
evolution-data-server-3.12.5-1.fc20.i686
evolution-ews-debuginfo-3.12.4-1.fc20.i686
highlight-3.18-1.fc20.i686

but I'm able to reproduce this with git master too.

Evolution backtrace shows:

Thread 1 (Thread 0x7f090dff5a80 (LWP 20873))

  • #0 write
    from /lib64/libc.so.6
  • #1 g_unix_output_stream_write
    at gunixoutputstream.c line 367
  • #2 g_pollable_output_stream_default_write_nonblocking
    at gpollableoutputstream.c line 156
  • #3 write_async_pollable
    at goutputstream.c line 1580
  • #4 g_output_stream_real_write_async
    at goutputstream.c line 1623
  • #5 real_splice_async_read_cb
    at goutputstream.c line 1806
  • #6 async_ready_callback_wrapper
    at ginputstream.c line 518
  • #7 g_task_return_now
    at gtask.c line 1076
  • #8 complete_in_idle_cb
    at gtask.c line 1085
  • #9 g_idle_dispatch
    at gmain.c line 5319
  • #10 g_main_dispatch
    at gmain.c line 3064
  • #11 g_main_context_dispatch
    at gmain.c line 3663
  • #12 g_main_context_iterate
    at gmain.c line 3734
  • #13 g_main_loop_run
    at gmain.c line 3928
  • #14 text_highlight_feed_data
    at e-mail-formatter-text-highlight.c line 232
  • #15 emfe_text_highlight_format
    at e-mail-formatter-text-highlight.c line 367
  • #16 e_mail_formatter_extension_format
    at e-mail-formatter-extension.c line 78
  • #17 e_mail_formatter_format_as
    at e-mail-formatter.c line 1014
  • #18 handle_mail_request
    at e-mail-request.c line 167
  • #19 mail_request_send_async
  • #20 WebCore::ResourceHandle::start()
    from /lib64/libwebkitgtk-3.0.so.0

(it's cut significantly, with webkit related stuff).
Comment 9 Milan Crha 2014-09-08 11:14:10 UTC
backtrace from highlight:

Thread 1 (process 21122)

  • #0 __write_nocancel
    from /lib64/libc.so.6
  • #1 _IO_new_file_write
    from /lib64/libc.so.6
  • #2 __GI__IO_do_write
    from /lib64/libc.so.6
  • #3 __GI__IO_file_sync
    from /lib64/libc.so.6
  • #4 fflush
    from /lib64/libc.so.6
  • #5 std::ostream::flush()
    from /lib64/libstdc++.so.6
  • #6 std::istream::sentry::sentry(std::istream&, bool)
    from /lib64/libstdc++.so.6
  • #7 std::basic_istream<char, std::char_traits<char> >& std::getline<char, std::char_traits<char>, std::allocator<char> >(std::basic_istream<char, std::char_traits<char> >&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >&, char)
    from /lib64/libstdc++.so.6
  • #8 highlight::CodeGenerator::readNewLine(std::string&)
  • #9 highlight::CodeGenerator::getInputChar()
  • #10 highlight::CodeGenerator::getCurrentState(highlight::State)
  • #11 highlight::CodeGenerator::processSymbolState()
  • #12 highlight::CodeGenerator::processRootState()
  • #13 highlight::HtmlGenerator::printBody()
  • #14 highlight::CodeGenerator::generateFile(std::string const&, std::string const&)
  • #15 HLCmdLineApp::run(int, char const**)
  • #16 main

Comment 10 Milan Crha 2014-09-09 11:31:19 UTC
I dumped the previous fix and replaced it with a simpler, smaller (code-line wise), quicker and the most importantly working solution which doesn't depend on any Unix specific features which just break portability of the code. It's currently WebKit processing which takes most of the time of the large text processing, which can be indicated by a higher CPU usage.

Created commit b10ef4f in evo master (3.13.6+) [1]
Created commit 13008d6 in evo evolution-3-12 (3.12.7+)

[1] https://git.gnome.org/browse/evolution/commit/?id=b10ef4f
Comment 11 Milan Crha 2014-10-30 12:00:43 UTC
*** Bug 734998 has been marked as a duplicate of this bug. ***
Comment 12 Milan Crha 2014-11-20 13:50:36 UTC
*** Bug 732690 has been marked as a duplicate of this bug. ***