[Webkit-unassigned] [Bug 168126] [GTK] WebProcess should run cleanup on quit to release resources

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Feb 13 10:29:12 PST 2017


https://bugs.webkit.org/show_bug.cgi?id=168126

--- Comment #8 from Michael Catanzaro <mcatanzaro at igalia.com> ---
As a rule, I'm opposed to adding workarounds to WebKit for bugs in crap proprietary software. But in this case it seems like the WebKit behavior should be improved regardless. Our secondary processes should probably behave similarly to how I decided to handle this in Epiphany:

 * First time a shutdown signal (SIGINT or SIGTERM) is received, attempt to quit normally, the same way we would if attempting to close the graphical window. It may fail.
 * Second time a shutdown signal is received, quit immediately. Useful in case something goes wrong in step one.

Note: I think it's important for GLib ports to catch the shutdown signals using g_unix_signal_add() rather than the low-level POSIX APIs, in order to avoid the massive amount of problems and races with UNIX signal handling and async signal safety. In Epiphany, I implemented the above by connecting the signal source once and always disconnecting it when received, so that receiving the signal subsequently would trigger the default killer handler. Note that it doesn't always work because sometimes the signal source handler gets stuck running forever; I never figured out why.

Note: In any case, *always* end with re-raising the caught signal, so that the process exit status indicates the signal that was received.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20170213/6bbd267a/attachment.html>


More information about the webkit-unassigned mailing list