Bug 87261 - [soup] Hang while synchronously loading resources in Facebook
Summary: [soup] Hang while synchronously loading resources in Facebook
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: Gtk
Depends on:
Blocks:
 
Reported: 2012-05-23 06:56 PDT by Mario Sanchez Prada
Modified: 2017-03-11 10:52 PST (History)
10 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mario Sanchez Prada 2012-05-23 06:56:05 PDT
STEPS TO REPRODUCE:

 1. Open facebook.com in GtkLauncher and log in.
 2. Type the name of some friend in the 'Search' text entry on top.
 3. Once some results appear in the dropdown list, click on one of them.

EXPECTED OUTCOME:

GtkLauncher should navigate to the profile selected in the dropdown list.

ACTUAL OUTCOME:

GtkLauncher hangs, and the backtrace in gdb shows something like this at that point:

#0  0x00000034502e8eef in poll () from /lib64/libc.so.6
#1  0x00007fffeee82a17 in g_poll (fds=0x3ab8020, nfds=1, timeout=-1) at gpoll.c:132
#2  0x00007fffeee72471 in g_main_context_poll (context=0x3ab7780, timeout=-1, priority=2147483647, fds=0x3ab8020, n_fds=1) at gmain.c:3440
#3  0x00007fffeee71dfa in g_main_context_iterate (context=0x3ab7780, block=1, dispatch=1, self=0x6e7cc0) at gmain.c:3141
#4  0x00007fffeee72255 in g_main_loop_run (loop=0x3a83d80) at gmain.c:3340
#5  0x00007ffff43f6799 in WebCore::WebCoreSynchronousLoader::run (this=0x7fffffff9c60) at ../../Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp:150
#6  0x00007ffff43f5a72 in WebCore::ResourceHandle::loadResourceSynchronously (context=0x78ec20, request=..., error=..., response=..., data=WTF::Vector of length 0, capacity 0)
    at ../../Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp:816
#7  0x00007ffff420f5c8 in WebCore::FrameLoader::loadResourceSynchronously (this=0x779c98, request=..., storedCredentials=WebCore::AllowStoredCredentials, error=..., response=..., data=WTF::Vector of length 0, capacity 0)
    at ../../Source/WebCore/loader/FrameLoader.cpp:2521
#8  0x00007ffff41ff22f in WebCore::DocumentThreadableLoader::loadRequest (this=0x3ab6970, request=..., securityCheck=WebCore::DoSecurityCheck) at ../../Source/WebCore/loader/DocumentThreadableLoader.cpp:393
#9  0x00007ffff41fd186 in WebCore::DocumentThreadableLoader::DocumentThreadableLoader (this=0x3ab6970, document=0x1669050, client=0x3ab4278, blockingBehavior=WebCore::DocumentThreadableLoader::LoadSynchronously, request=..., 
    options=...) at ../../Source/WebCore/loader/DocumentThreadableLoader.cpp:89
#10 0x00007ffff41fcd8a in WebCore::DocumentThreadableLoader::loadResourceSynchronously (document=0x1669050, request=..., client=..., options=...) at ../../Source/WebCore/loader/DocumentThreadableLoader.cpp:60
#11 0x00007ffff425b421 in WebCore::ThreadableLoader::loadResourceSynchronously (context=0x1669180, request=..., client=..., options=...) at ../../Source/WebCore/loader/ThreadableLoader.cpp:69
#12 0x00007ffff48127f8 in WebCore::XMLHttpRequest::createRequest (this=0x3ab4250, ec=@0x7fffffffa66c: 0) at ../../Source/WebCore/xml/XMLHttpRequest.cpp:737
#13 0x00007ffff4811ca6 in WebCore::XMLHttpRequest::send (this=0x3ab4250, 
    body="stats[sid]=0.6403730453457683&stats[session_start_time]=1337780616263&stats[bootstrap_cachemisses]=2&stats[first_query_time]=1337780619078&stats[num_queries]=6&stats[first_result_time]=1337780619178&s"..., 
    ec=@0x7fffffffa66c: 0) at ../../Source/WebCore/xml/XMLHttpRequest.cpp:606
#14 0x00007ffff3c0080a in WebCore::JSXMLHttpRequest::send (this=0x7fff6c3a7d20, exec=0x7fff9e1f64a8) at ../../Source/WebCore/bindings/js/JSXMLHttpRequestCustom.cpp:132
#15 0x00007ffff4be4226 in WebCore::jsXMLHttpRequestPrototypeFunctionSend (exec=0x7fff9e1f64a8) at DerivedSources/WebCore/JSXMLHttpRequest.cpp:617


Side Note: I can reproduce this consistently both in epiphany and in GtkLauncher with a debug build of wkgtk. However, I can't reproduce it consistently in GtkLauncher with a release build.

I think this might be an issue related to the gtk port only (soup implementation), but feel free to reassign it if you think it's a more cross platform thing.
Comment 1 Martin Robinson 2012-05-26 17:24:35 PDT
Dan, this appears to be a problem in libsoup with use-thread-context. I did a little testing locally and it appears that the request starts, but never finishes.
Comment 2 Thiago Marcos P. Santos 2012-07-25 00:30:19 PDT
I had recently a hang here at EFL MiniBrowser while running a internal test suite. The backtrace is identical.

We have a test harness that was using synchronous xhr (yes, should not be used, but not the point here) for loading test cases. When the test is done, it sends a new message to the webserver to prepare for a new test.

After exactly 6 tests, it was hanging. Also hangs on GTK, but after more test cases (but works on Chromium and Qt).

While trying to debug this for the test team, I found out that only replies without headers are hanging the browser. I did the following change at the webserver (they are using python's BaseHTTPServer) and it worked:

self.send_response(200)
+ self.send_header("foo", "bar")
+ self.end_headers()

The original message sent by the browser was:

$.ajax({
    async: false,
    type: "POST",
    url: svr,
    data: {suite:psuite, set:pset, testcase:current_page_uri}
});

It makes me think that it might have something to do with libsoup expectations from these messages.
Comment 3 Dan Winship 2012-07-25 04:41:39 PDT
Is this with libsoup 2.39.x ? If so, try the latest git master and see if that fixes it.
Comment 4 Thiago Marcos P. Santos 2012-07-25 05:14:37 PDT
(In reply to comment #3)
> Is this with libsoup 2.39.x ? If so, try the latest git master and see if that fixes it.

I tried with the latest from yesterday. No success.
Comment 5 Dominik Röttsches (drott) 2012-10-30 07:42:33 PDT
Any more comments on this, Dan? What should we do about this?
Comment 6 Dan Winship 2012-11-02 07:21:24 PDT
(In reply to comment #0)
> STEPS TO REPRODUCE:
> 
>  1. Open facebook.com in GtkLauncher and log in.
>  2. Type the name of some friend in the 'Search' text entry on top.
>  3. Once some results appear in the dropdown list, click on one of them.
> 
> EXPECTED OUTCOME:
> 
> GtkLauncher should navigate to the profile selected in the dropdown list.
> 
> ACTUAL OUTCOME:
> 
> GtkLauncher hangs, and the backtrace in gdb shows something like this at that point:

WORKSFORME in f18 (epiphany 3.6.1, libsoup 2.40.1, webkitgtk3 1.10.1)...
Comment 7 Oliver Gerlich 2013-06-24 14:44:32 PDT
Just FTR: this happened several times now for me with image pages on commons.wikimedia.org (example: http://commons.wikimedia.org/wiki/File:Zahnkranzpakete.jpg). Doesn't happen every time; when loading the same page a few times, sometimes it freezes and sometimes it works.

This is on Ubuntu 12.04, with libsoup 2.38.1.