Bug 175527 - [GTK][WPE] Crash in IconDatabase::IconRecord::setImageData()
Summary: [GTK][WPE] Crash in IconDatabase::IconRecord::setImageData()
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
Keywords: Gtk
Depends on:
Reported: 2017-08-14 03:56 PDT by Carlos Garcia Campos
Modified: 2017-08-17 06:41 PDT (History)
7 users (show)

See Also:

Patch (1.44 KB, patch)
2017-08-14 03:58 PDT, Carlos Garcia Campos
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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]
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>