GNOME Bugzilla – Bug 776287
ephy doesn't clean up sqlite temporary files on exit
Last modified: 2017-06-30 00:46:14 UTC
sqlite creates the cookies.sqlite-shm and cookies.sqlite-wal temporary files when the database is open. Normally, these should be cleaned up on exit, but they are being left in the epiphany profile directory. Internally, (I think) ephy is having WebKit use the 'db' cookiejar implementation in libsoup. As a trivial test, doing this: >>> from gi.repository import Soup >>> Soup.CookieJarDB.new('cookies.sqlite', False) # drop return value >>> quit() is enough to clean up those files, so libsoup is clearly doing the correct thing when the object is finalized.
Thanks for the bug report. (In reply to Allison Lortie (desrt) from comment #0) > sqlite creates the cookies.sqlite-shm and cookies.sqlite-wal temporary files > when the database is open. Normally, these should be cleaned up on exit, > but they are being left in the epiphany profile directory. > > Internally, (I think) ephy is having WebKit use the 'db' cookiejar > implementation in libsoup. Yup. > As a trivial test, doing this: > > >>> from gi.repository import Soup > >>> Soup.CookieJarDB.new('cookies.sqlite', False) # drop return value > >>> quit() > > is enough to clean up those files, so libsoup is clearly doing the correct > thing when the object is finalized. Hm. The WebKitCookieManager is a property of the WebKitWebContext, and the default WebKitWebContext is always leaked by WebKit, so for most applications the WebKitCookieManager is guaranteed to never be finalized. That's surely a WebKit bug. However, Epiphany uses its own WebKitWebContext and does take care to free it in ephy_embed_shell_dispose. But the EphyShell/EphyEmbedShell instance itself is guaranteed to never be finalized, because it's a global singleton. I guess we have to try deleting it with a GCC destructor. So I'm going to leave this open because there is an Epiphany bug here, but there is also a WebKit bug. Would you mind reporting it? Canned reply: Thanks for taking the time to report this. This issue is most likely a bug in WebKit. Please report the bug to https://bugs.webkit.org/ including a link to this bug report and noting the version of WebKitGTK+ that you have installed. When reporting the WebKit bug, be sure to include the prefix '[GTK]' in the bug summary and select the 'WebKit Gtk' component.
(In reply to Michael Catanzaro from comment #1) > However, Epiphany uses its own WebKitWebContext and does take care to free > it in ephy_embed_shell_dispose. But the EphyShell/EphyEmbedShell instance > itself is guaranteed to never be finalized, because it's a global singleton. > I guess we have to try deleting it with a GCC destructor. I decided to instead do the more obvious thing and delete it in main, and saw that I was wrong, it's already unreffed in main, that will cause the web context to be destroyed and that in turn should finalize the cookie jar. So I don't see anything wrong in Epiphany after all. We'll have to sort this out in the WebKit bug; thanks for filing that.
Some of us would like to do operations on a closed cookies.sqlite. For instance, we are retiring our old browser, and would like to move our cookies into ephy. However faced with this half written state, we can't do any of it! OK I am working on some solutions for how one might operate on the three files, I put them on to https://bugs.webkit.org/show_bug.cgi?id=166029 .