Bug 175527

Summary: [GTK][WPE] Crash in IconDatabase::IconRecord::setImageData()
Product: WebKit Reporter: Carlos Garcia Campos <cgarcia>
Component: WebKitGTKAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: berto, bugs-noreply, buildbot, calvaris, gustavo, mcatanzaro, zan
Priority: P2 Keywords: Gtk
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Carlos Garcia Campos 2017-08-14 03:56:29 PDT
I'm still getting crashes there. The problem is that when setImageData() is called from IconDatabase::readFromDatabase() the shared buffer might be nullptr, because getImageDataForIconURLFromSQLDatabase() returns nullptr if the icon data is not in the database.

#0  0x00007f186d4da26e in WebKit::IconDatabase::IconRecord::setImageData(WTF::RefPtr<WebCore::SharedBuffer>&&) ()
   from /home/cgarcia/src/git/gnome/WebKit/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#1  0x00007f186d4dab08 in WebKit::IconDatabase::readFromDatabase() () from /home/cgarcia/src/git/gnome/WebKit/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#2  0x00007f186d4db112 in WebKit::IconDatabase::syncThreadMainLoop() () from /home/cgarcia/src/git/gnome/WebKit/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#3  0x00007f186d4db438 in WebKit::IconDatabase::iconDatabaseSyncThread() () from /home/cgarcia/src/git/gnome/WebKit/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#4  0x00007f186946cb0b in WTF::Thread::entryPoint(WTF::Thread::NewThreadContext*) () from /home/cgarcia/src/git/gnome/WebKit/WebKitBuild/Release/lib/libjavascriptcoregtk-4.0.so.18
#5  0x00007f186949fa39 in WTF::wtfThreadEntryPoint(void*) () from /home/cgarcia/src/git/gnome/WebKit/WebKitBuild/Release/lib/libjavascriptcoregtk-4.0.so.18
#6  0x00007f1861288494 in start_thread (arg=0x7f18548fc700) at pthread_create.c:333
#7  0x00007f185fef0a8f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
Comment 1 Carlos Garcia Campos 2017-08-14 03:58:19 PDT
Created attachment 318028 [details]
Patch
Comment 2 Build Bot 2017-08-14 04:00:05 PDT
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See http://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Comment 3 Carlos Garcia Campos 2017-08-14 04:12:34 PDT
Committed r220677: <http://trac.webkit.org/changeset/220677>