GNOME Bugzilla – Bug 750163
Crash in sqlite3_initialize (deep in WebKit)
Last modified: 2015-06-02 18:05:23 UTC
GNOME Builder occasionally crashes deep in WebKit: Truncated backtrace: Thread no. 1 (10 frames) #1 sqlite3_initialize at sqlite3.c:127696 #2 openDatabase at sqlite3.c:130186 #3 WebCore::SQLiteFileSystem::openDatabase at /usr/src/debug/webkitgtk-2.8.1/Source/WebCore/platform/sql/SQLiteFileSystem.cpp:53 #4 WebCore::SQLiteDatabase::open at /usr/src/debug/webkitgtk-2.8.1/Source/WebCore/platform/sql/SQLiteDatabase.cpp:75 #5 WebKit::LocalStorageDatabaseTracker::openTrackerDatabase at /usr/src/debug/webkitgtk-2.8.1/Source/WebKit2/UIProcess/Storage/LocalStorageDatabaseTracker.cpp:224 #6 WebKit::LocalStorageDatabaseTracker::importOriginIdentifiers at /usr/src/debug/webkitgtk-2.8.1/Source/WebKit2/UIProcess/Storage/LocalStorageDatabaseTracker.cpp:242 #7 operator() at /usr/include/c++/5.0.0/functional:2271 #8 WTF::GMainLoopSource::voidCallback at /usr/src/debug/webkitgtk-2.8.1/Source/WTF/wtf/gobject/GMainLoopSource.cpp:365 #9 WTF::GMainLoopSource::voidSourceCallback at /usr/src/debug/webkitgtk-2.8.1/Source/WTF/wtf/gobject/GMainLoopSource.cpp:456 #14 operator() at /usr/include/c++/5.0.0/functional:2271 It's crashing when opening the HTML5 local storage database. I'm not really sure why that's handled by the UI process instead of the web process or the database process, but whatever. I think Builder should just disable local storage, plus a few more things you don't need for showing static HTML files, as we've done in devhelp. The list of settings I'd disable is: enable-html5-database enable-html5-local-storage enable-javascript enable-plugins For example, see this devhelp commit: https://git.gnome.org/browse/devhelp/commit/?id=55e425cbd224e10dd586518863e81281b2de5690 Check the See Also field for the full backtrace in the Red Hat bug.
Created attachment 304321 [details] [review] webkit: disable unneeded WebKit features This is partially a workaround for WebKit bug #143245, where the inspector process pool and default process pool (the default web context) access the HTML5 local storage database at the same time from different threads. In theory, that's an SQLite bug, but it doesn't really matter because GNOME Builder is not a web browser and it doesn't need HTML5 local storage. Let's avoid the issue altogether by disabling it entirelly, as well as some other features we probably don't need, like Javascript and NPAPI plugins. This probably won't stop Builder from accessing the local storage database altogether, because it won't affect the inspector web context, but now it should only happen from one thread at a time. WebKit master is smart enough to not create the inspector web context unless it's actually needed, so going forward that shouldn't be an issue anymore (since Builder does not enable the web inspector). Note: it would probably be a bit better to disable these settings before creating the web view, rather than after. But I'm not sure how to do that with the web views living in .ui files, and they seem happy there. There might be a teensy race left open, but it's a WebKit or SQLite bug rather than a Builder bug, and nobody will ever hit it, knock on wood.
Created attachment 304322 [details] [review] webkit: disable unneeded WebKit features Somehow tricked myself into thinking that GbHtmlView has only one web view....
Review of attachment 304322 [details] [review]: LGTM once we've clarified the JS situation. ::: src/util/gb-webkit.c @@ +26,3 @@ + "enable-html5-database", FALSE, + "enable-html5-local-storage", FALSE, + "enable-javascript", FALSE, I'm not sure we can disable javascript. We do use that for the markdown editor pretty heavily. Other than that, looks good. Long term though, we will probably need this fixed. As we get "real" HTML editing facilities, people will want to be able to test things.
Sure, no harm in leaving js enabled, I just incorrectly assumed it was not used. (In reply to Christian Hergert from comment #3) > Long term though, we will probably need this fixed. As we get "real" HTML > editing facilities, people will want to be able to test things. Ah, so you want to be able to prototype a complex web sites within Builder? I hadn't considered that; I was assuming these were features that you would never want. In that case, perhaps we should disable only local storage and only temporarily, with a FIXME to remove the code once the WebKit/SQLite bug is fixed?
That sounds good to me.
Created attachment 304338 [details] [review] webkit: disable unneeded WebKit features This is partially a workaround for WebKit bug #143245, where the inspector process pool and default process pool (the default web context) access the HTML5 local storage database at the same time from different threads. In theory, that's an SQLite bug, but it doesn't really matter because GNOME Builder is not a web browser and it doesn't need HTML5 local storage. Let's avoid the issue altogether by disabling it. This probably won't stop Builder from accessing the local storage database altogether, because it won't affect the inspector web context, but now it should only happen from one thread at a time. WebKit master is smart enough to not create the inspector web context unless it's actually needed, so going forward that shouldn't be an issue anymore (since Builder does not enable the web inspector). Note: it would probably be a bit better to disable these settings before creating the web view, rather than after. But I'm not sure how to do that with the web views living in .ui files, and they seem happy there. There might be a teensy race left open, but it's a WebKit or SQLite bug rather than a Builder bug, and nobody will ever hit it, knock on wood.
Review of attachment 304338 [details] [review]: LGTM
Attachment 304338 [details] pushed as 0067e07 - webkit: disable unneeded WebKit features
Hm, I hit this today even with local storage turned off... wonderful.