Bug 117392
Summary: | webkit2: plugins on page reload breaks on non-resident modules | ||
---|---|---|---|
Product: | WebKit | Reporter: | Alban Browaeys <prahal> |
Component: | WebKit2 | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED WONTFIX | ||
Severity: | Major | CC: | andersca, ap, bugzilla, cgarcia, mcatanzaro, prahal |
Priority: | P2 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
See Also: | https://bugzilla.gnome.org/show_bug.cgi?id=691686 |
Alban Browaeys
Sum up of the gnome-shell browser plugin bug report : https://bugzilla.gnome.org/show_bug.cgi?id=691686
"I applied this patch to webkit and now the issue is gone:
--------------------------------------------------------------------
diff -uNr webkitgtk-1.11.92/Source/WebKit2/PluginProcess/PluginProcess.cpp
webkitgtk-1.11.92_prahal/Source/WebKit2/PluginProcess/PluginProcess.cpp
--- webkitgtk-1.11.92/Source/WebKit2/PluginProcess/PluginProcess.cpp
2013-02-12 17:22:50.000000000 +0100
+++ webkitgtk-1.11.92_prahal/Source/WebKit2/PluginProcess/PluginProcess.cpp
2013-05-29 19:09:23.607126634 +0200
@@ -115,6 +115,9 @@
}
enableTermination();
+
+ if (shared().shouldTerminate())
+ shared().terminate();
}
NetscapePluginModule* PluginProcess::netscapePluginModule()
--------------------------------------------------------------------
that is webkit2 does terminate the plugin process only after a timeout (and
start terminating it when the page close). Also the timeout is 600.
As jasper pointer out on #gnome-shell irc:
"the plugin process should restart when the page loads" .
webkit2 does only if the time between the close and open of the new page is
more than 600 seconds. Which on reload never happens. So I made this patch that
trigger plain terminate on PluginProcess::removeWebProcessConnection and all is
fine)."
This might affect other plugins.
The crash triggers not only on page reload but also if one go to another page and back to a page that uses the gnome-shell browser plugins.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Michael Catanzaro
I've renamed "resident" to "non-resident" in the bug title; that looks like it was just a think-o.
(In reply to comment #0)
> "the plugin process should restart when the page loads"
Really? Is this behavior documented somewhere?
Michael Catanzaro
For the folks not following the GNOME bugs, the resolution there was to fix this in the plugin:
Bastien: "That's not a bug in epiphany or WebKit, you need to mark such libraries as resident if you don't want them to be unloaded. That's not WebKit's problem if your code relies on libraries/types that can't be unloaded.
FWIW, Totem's browser plugin has similar code. You can also use -Wl,-z,nodelete to make sure the plugin never gets unloaded."
Carlos: "This is fixed now, using -Wl,-z,nodelete."
Carlos Garcia Campos
(In reply to comment #1)
> I've renamed "resident" to "non-resident" in the bug title; that looks like
> it was just a think-o.
>
> (In reply to comment #0)
> > "the plugin process should restart when the page loads"
>
> Really? Is this behavior documented somewhere?
No, and of course not.
Carlos Garcia Campos
This is not a problem of WebKit, this is a specific issue with plugins that use GObject with types defined statically (which is the default). We unload the plugin module when no longer needed, and load it again when needed for the same execution of the plugin process. That not only happens when reloading, but just navigating, and for sure we are not going to kill and re-launch the plugin process for every navigation action. A possible workaround in WebKit would be to not unload the module, but we would be fixing an issue that is specific of some plugins. We could detect automatically if the module uses GObject and prevent the module from being unloaded, adding a plugin quirk for example, but I really think this should be fixed in the plugins.