Bug 1089107 - Busy loop under replace_local_image_links()
Summary: Busy loop under replace_local_image_links()
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: evolution
Version: 20
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Matthew Barnes
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-04-18 00:49 UTC by Donnie Roberson
Modified: 2014-04-30 12:47 UTC (History)
6 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2014-04-30 12:47:12 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Tarball of stack trace and thread list of evolution during hang (140.00 KB, application/x-tar)
2014-04-18 00:50 UTC, Donnie Roberson
no flags Details
signatures (30.00 KB, application/x-tar)
2014-04-27 02:25 UTC, Donnie Roberson
no flags Details
latest thread list from hang during delete (6.84 KB, text/plain)
2014-04-27 02:28 UTC, Donnie Roberson
no flags Details

Description Donnie Roberson 2014-04-18 00:49:07 UTC
Description of problem:
When deleting mail with the trash button evolution hangs for 5 to 10 seconds and when going to edit preferences signatures evolution hangs for minutes


Version-Release number of selected component (if applicable):
evolution -v
evolution 3.10.3


How reproducible:
Always

Steps to Reproduce:
1.Delete mail with the trash button
2.Click Edit preferences signatures
3.

Actual results:
Hangs


Expected results:
maybe a couple second delay when editing signatures and almost immediate deletion of mail


Additional info:
I have attached a threadlist of the pid of evolution during a hang of editing the signature along with at stack trace. I see in the output of top that evolution is taking most of the time 110-120% of a dual core cpu and 75-95% of 3GB of memory when this happens.  If needed I will get the output.  Please let me know if there is anything else that would help debug this issue


Looking at the thread list t 1 in most of the frames are calling the function replace_local_image_links (). Without looking at the code my guess is we are trying to load a image file locally that is part of a url. 
There are not images but are some hyperlinks in the signature This signature was created in a evoultion release on fedora 16. On the deletions I cannot see anything causing the the 5-10 sec delay in the delete and return of the cursor

Comment 1 Donnie Roberson 2014-04-18 00:50:23 UTC
Created attachment 887382 [details]
Tarball of stack trace and thread list of evolution during hang

Comment 2 Milan Crha 2014-04-22 07:45:46 UTC
Thanks for a bug report. Could you install debuginfo package for evolution, and reget the backtrace, please? It should stop using libevolution-util.so and start showing source file name with a line number instead.

You mentioned your signature is having some URLs. Is the signature HTML based, thus you entered a URL with a short description, or Plain Text based, thus the URL is just pasted in the signature body?

The routine where it's stuck is supposed to traverse the "message" body and "correct" URLs to remote images to use evolution internal structures for image loading.

Maybe if you would be able to share the signature, I guess it's not a private information, as you want to use it in your mails, but if you consider it private, then feel free to send it only to me, with a bug number in message subject. The signatures are stored in two places now, one is
   ~/.config/evolution/signatures/
where actual signature bodies are stored, and the other is
   ~/.config/evolution/sources/
where a file of the same name as in the previous folder are stored, they only have appended ".source" extension. These two files define signature together. I'd like you to find the files for the offending signature and either attach it here or send it directly to me. You can eventually replace any private information by "censoring" it with an "x" letter where appropriate, by overwriting actual text in it. I would prefer to keep the structure as much as possible, thus for example to censor "my name" have "xx xxx". Thanks in advance.

Comment 3 Donnie Roberson 2014-04-27 02:18:54 UTC
Sorry for the slow reply.  I have had a hard time finding the debuginfo package.  I finally found it on a fedora mirror but it was for 3.10.2 and not 3.10.3. I installed allthe rpms for evolution (im sure you just wanted the debug-info package which i installed 1 by 1 and tested) but it still uses libevolution-util.so and does not show the line number or .c source file.  Am I missing any other packages.  My appologies I debug in a controlled environment on systems built off fc4 and when I load the binaries with gdb I get the line# and source file and will just cross reference the cscope data base I built.  I am attaching the latest thread list where it hung on deleting mail.  Would it be better if I dumped a full thread list with all localsand not just the thread list?  I am also attaching the full signatures.  Please let me know if there is anything else needed.

--Donnie

Comment 4 Donnie Roberson 2014-04-27 02:25:01 UTC
Created attachment 890136 [details]
signatures

tarball of the signatures and source as all 3 of the signatures have the same issues.

Comment 5 Donnie Roberson 2014-04-27 02:28:22 UTC
Created attachment 890137 [details]
latest thread list from hang during delete

latest thread list from hang during delete of email

Comment 6 Milan Crha 2014-04-29 14:48:16 UTC
Thanks for the update and files. There is no problem with delay, I've got busy with other stuff meanwhile too.

The backtrace is interesting, because it shows evolution in an idle state - the UI should react on your requests without any delay. On the other hand, I can reproduce the busy-loop with your signature just when entering Edit->Preferences->Composer Preferences->Signatures and selecting "24Fit Challenge Registration" signature.The backtrace on git master reads:

Thread 1 (Thread 0x7f77d9b1fa80 (LWP 2028)):
#0  0x00000033e4a32c48 in g_type_check_instance_cast () from /lib64/libgobject-2.0.so.0
#1  0x00000031775067c9 in WebKit::core(_WebKitDOMElement*) () from /lib64/libwebkitgtk-3.0.so.0
#2  0x000000317750b5a8 in webkit_dom_element_get_next_element_sibling () from /lib64/libwebkitgtk-3.0.so.0
#3  0x00007f77dbe3cfab in replace_local_image_links (element=0x6222480) at e-mail-signature-preview.c:98
#4  0x00007f77dbe3cfbb in replace_local_image_links (element=0x6222480) at e-mail-signature-preview.c:99
#5  0x00007f77dbe3cfbb in replace_local_image_links (element=0x6257d40) at e-mail-signature-preview.c:99
#6  0x00007f77dbe3cfbb in replace_local_image_links (element=0x68e7b30) at e-mail-signature-preview.c:99
#7  0x00007f77dbe3cfbb in replace_local_image_links (element=0x695b010) at e-mail-signature-preview.c:99
#8  0x00007f77dbe3cfbb in replace_local_image_links (element=0x695af70) at e-mail-signature-preview.c:99
#9  0x00007f77dbe3cfbb in replace_local_image_links (element=0x65530e0) at e-mail-signature-preview.c:99
#10 0x00007f77dbe3cfbb in replace_local_image_links (element=0x5b3c540) at e-mail-signature-preview.c:99
#11 0x00007f77dbe3cfbb in replace_local_image_links (element=0x64c8d60) at e-mail-signature-preview.c:99
#12 0x00007f77dbe3cfbb in replace_local_image_links (element=0x6548d40) at e-mail-signature-preview.c:99
#13 0x00007f77dbe3cfbb in replace_local_image_links (element=0x6102770) at e-mail-signature-preview.c:99
#14 0x00007f77dbe3cfbb in replace_local_image_links (element=0x6421d40) at e-mail-signature-preview.c:99
#15 0x00007f77dbe3cfbb in replace_local_image_links (element=0x68e7990) at e-mail-signature-preview.c:99
#16 0x00007f77dbe3cfbb in replace_local_image_links (element=0x6958d30) at e-mail-signature-preview.c:99
#17 0x00007f77dbe3cfbb in replace_local_image_links (element=0x6206040) at e-mail-signature-preview.c:99
#18 0x00007f77dbe3cfbb in replace_local_image_links (element=0x6958d00) at e-mail-signature-preview.c:99
#19 0x00007f77dbe3cfbb in replace_local_image_links (element=0x6204130) at e-mail-signature-preview.c:99
#20 0x00007f77dbe3cfbb in replace_local_image_links (element=0x6956ae0) at e-mail-signature-preview.c:99
#21 0x00007f77dbe3cfbb in replace_local_image_links (element=0x6234620) at e-mail-signature-preview.c:99
#22 0x00007f77dbe3cfbb in replace_local_image_links (element=0x6958a20) at e-mail-signature-preview.c:99
#23 0x00007f77dbe3cfbb in replace_local_image_links (element=0x6553270) at e-mail-signature-preview.c:99
#24 0x00007f77dbe3cf9f in replace_local_image_links (element=0x6256610) at e-mail-signature-preview.c:95
#25 0x00007f77dbe3cfbb in replace_local_image_links (element=0x6256610) at e-mail-signature-preview.c:99
#26 0x00007f77dbe3cf9f in replace_local_image_links (element=0x61f0730) at e-mail-signature-preview.c:95
#27 0x00007f77dbe3cfbb in replace_local_image_links (element=0x61f0730) at e-mail-signature-preview.c:99
#28 0x00007f77dbe3cf9f in replace_local_image_links (element=0x7f7704007130) at e-mail-signature-preview.c:95
#29 0x00007f77dbe3d092 in signature_preview_document_loaded_cb (web_view=0x61c0360, web_frame=0x61bc9c0, user_data=0x0) at e-mail-signature-preview.c:116
#30 0x00000033e4a10298 in g_closure_invoke () from /lib64/libgobject-2.0.so.0
#31 0x00000033e4a2235d in signal_emit_unlocked_R () from /lib64/libgobject-2.0.so.0
#32 0x00000033e4a2a0f2 in g_signal_emit_valist () from /lib64/libgobject-2.0.so.0
#33 0x00000033e4a2a8f8 in g_signal_emit_by_name () from /lib64/libgobject-2.0.so.0
#34 0x0000003176d359cf in WebCore::FrameLoader::finishedParsing() () from /lib64/libwebkitgtk-3.0.so.0
#35 0x00000031769691c6 in WebCore::Document::finishedParsing() () from /lib64/libwebkitgtk-3.0.so.0
#36 0x0000003176bb571e in WebCore::HTMLDocumentParser::prepareToStopParsing() () from /lib64/libwebkitgtk-3.0.so.0
#37 0x0000003176bb1d1a in WebCore::HTMLDocumentParser::finish() () from /lib64/libwebkitgtk-3.0.so.0
#38 0x0000003176d29dd1 in WebCore::DocumentWriter::end() () from /lib64/libwebkitgtk-3.0.so.0
#39 0x0000003176d1edb8 in WebCore::DocumentLoader::finishedLoading(double) () from /lib64/libwebkitgtk-3.0.so.0
#40 0x0000003176d1f0d5 in WebCore::DocumentLoader::continueAfterContentPolicy(WebCore::PolicyAction) () from /lib64/libwebkitgtk-3.0.so.0
#41 0x0000003176d23285 in WebCore::DocumentLoader::responseReceived(WebCore::CachedResource*, WebCore::ResourceResponse const&) () from /lib64/libwebkitgtk-3.0.so.0
#42 0x0000003176d1bfde in WebCore::DocumentLoader::handleSubstituteDataLoadNow(WebCore::Timer<WebCore::DocumentLoader>*) () from /lib64/libwebkitgtk-3.0.so.0
#43 0x000000317671f1c9 in WebCore::ThreadTimers::sharedTimerFiredInternal() () from /lib64/libwebkitgtk-3.0.so.0
#44 0x0000003176733ff2 in WebCore::timeout_cb(void*) () from /lib64/libwebkitgtk-3.0.so.0
#45 0x00000033e4249e43 in g_timeout_dispatch () from /lib64/libglib-2.0.so.0
#46 0x00000033e42492a6 in g_main_context_dispatch () from /lib64/libglib-2.0.so.0
#47 0x00000033e4249628 in g_main_context_iterate.isra.24 () from /lib64/libglib-2.0.so.0
#48 0x00000033e4249a3a in g_main_loop_run () from /lib64/libglib-2.0.so.0
#49 0x00000035b7daa225 in gtk_main () from /lib64/libgtk-3.so.0
#50 0x000000000040498b in main (argc=1, argv=0x7fff7ded1ab8) at main.c:681

Comment 7 Milan Crha 2014-04-29 15:07:32 UTC
I see it's cycling on WebKitDOMHTMLFontElement elements, indefinitely.

Tomas, could you look on it, please?

It tries to replace image sources only, which might be fairly easy with WebKit selectors, especially if they traverse the hierarchy into iframes too.

Comment 8 Tomas Popela 2014-04-30 12:47:12 UTC
Fixed in upstream with https://bugzilla.gnome.org/show_bug.cgi?id=729256


Note You need to log in before you can comment on or make changes to this bug.