Bug 50083

Summary: [Gtk] ASSERT(d->m_response.isNull()) in contentSniffedCallback
Product: WebKit Reporter: Sergio Villar Senin <svillar>
Component: WebKitGTKAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, xan.lopez
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Linux   
Attachments:
Description Flags
Fix for the bug
xan.lopez: review-
Fix for the bug none

Description Sergio Villar Senin 2010-11-25 08:08:51 PST
We are easily reaching that assertion since 72695. The problem is located in soup-request-http.c. We're emitting the "content-sniffed" callback without even considering that the sniffing was not enabled for each particular message (see startHttp in ResourceHandleSoup.cpp)
Comment 1 Sergio Villar Senin 2010-11-25 08:14:19 PST
Created attachment 74881 [details]
Fix for the bug

This should be "the right thing". We should not emit the content-sniffed callback if it was disabled for that particular SoupMessage. The problem is that soup_message_disables_feature is not in the public API of SoupMessage.

My proposal would be to just apply the changes in ResourceHandleSoup.cpp (i.e. do not connect to the "content-sniffed" signal) because:
   * it's correct anyway
   * it'll fix the bug
   * the invalid signal emission is located in the soup imported code, and thus, when moved there the soup_message_disables_feature could be easily added then (we can add that code as a comment)
Comment 2 Sergio Villar Senin 2010-11-25 08:37:24 PST
Adding Mr. Lopez (a.k.a SoupCache bug hunter)
Comment 3 Xan Lopez 2010-11-26 06:12:48 PST
Comment on attachment 74881 [details]
Fix for the bug

View in context: https://bugs.webkit.org/attachment.cgi?id=74881&action=review

> WebCore/platform/network/soup/ResourceHandleSoup.cpp:591
>  

As discussed yesterday in person this is logically wrong, should go in an else block. Other than that the patch makes sense to me (let's get it in ASAP, it ASSERTs really frequently).
Comment 4 Sergio Villar Senin 2010-11-26 06:51:46 PST
Created attachment 74934 [details]
Fix for the bug

Final version of the patch:
   * connect to content-sniffed signal if handle->shouldContentSniff()
   * fixed an potential early finalization of an object
   * added comments with the "proper" fix inside the cache code to be migrated to libsoup
Comment 5 Xan Lopez 2010-11-26 07:16:01 PST
Comment on attachment 74934 [details]
Fix for the bug

r=me
Comment 6 WebKit Commit Bot 2010-11-26 07:52:50 PST
Comment on attachment 74934 [details]
Fix for the bug

Clearing flags on attachment: 74934

Committed r72762: <http://trac.webkit.org/changeset/72762>
Comment 7 WebKit Commit Bot 2010-11-26 07:52:55 PST
All reviewed patches have been landed.  Closing bug.