-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
libproxy crashes gjs applications when run outside GNOME with mozjs backend enabled, probably also crashes WebKit-based applications if WebKit backend is enabled #81
Comments
@DimStar77 any thoughts on this? It seems clear that we need to get mozjs out-of-process somehow. I thought using D-Bus was as good a solution as any.... |
Apparently I have a long chain of comments on this in #68 (comment) from two years ago, but there's no real conclusion there on what to do. |
Oh here's another thing we could do: we could invert the logic libmodman uses to attempt to use the pacrunner backend matching a JS library that the application is already using. libmodman is basically self-sabotage here. :D It would be better to use mozjs backend if and only if the application is NOT linked to mozjs, or use WebKit only if the application is NOT linked to WebKit, but libproxy is doing the exact opposite in pursuit of the misguided goal of reducing the number of JS engines loaded in-process. |
I've been thinking about this, and I'm leaning towards: never use libproxy in-process. Instead of linking directly to libproxy, I could change GLibproxyResolver to instead call some helper binary that would run libproxy, similar to how glib-pacrunner executes in a subprocess. |
AFAICT, that makes using libproxy substantially harder and more complex and won't help with existing users. It might be possible to convert libproxy.so into that helper binary and then create a new libproxy.so which then calls that binary. |
Yeah, to solve this we need a process boundary between the process using libproxy and the JS engine evaluating the pacrunner. That's the only way it can really be solved. Only details to figure out are "what would it look like?" |
The libproxy API is practically just one single function: |
Reviving https://github.com/libproxy/libproxy/tree/dbusify will be the way to go imho |
This is now mitigated by #139. But ultimately the mozjs backend needs to either use IPC (dbusify) or go away. Of course, while gjs apps should be good now, we probably transferred the problem to apps that use WebKit. I would be pretty unsurprised if it crashes for apps that use QtWebKit, for example. It's probably also a disaster for apps that use GTK 4 (since libproxy links to the GTK 3 version of WebKitGTK). |
Since distributions now need multiple versions of WebKitGTK (and since QtWebKit is a thing that exists), that backend is no longer safe either. If there's no hope of #157 landing anytime soon, I think these backends should both be removed. duktape seems like the better option. |
Closing as obsolete, we only support duktape. |
See https://bugzilla.redhat.com/show_bug.cgi?id=1524507. User reports that GNOME Weather crashes on startup if libproxy-mozjs is installed. libproxy gets dlopened by glib-networking when running outside GNOME, then libproxy dlopens mozjs38, and meanwhile gjs of course links to mozjs52. That makes applications explode.
I think the only reason this is not reported more often is that people don't often run gjs applications outside GNOME (in which case GProxyResolverGnome is used instead of GLibproxyResolver, so libproxy is not dlopened at all).
DimStar's dbusify branch would avoid this problem.
The text was updated successfully, but these errors were encountered: