GNOME Bugzilla – Bug 683538
can't start epiphany after recent libgnome-desktop upgrade
Last modified: 2012-09-29 09:12:35 UTC
After upgrading gnome-desktop to master in my jhbuild environment, epiphany refuses to start (after a successful building), giving this error: ephy-profile-migrator: error while loading shared libraries: libgnome-desktop-3.so.4: cannot open shared object file: No such file or directory Failed to run the migrator process, Web will now abort. I turned out that ephy-profile-migrator is spawned with a brand new environment instead of inheriting the one from the main process. In this way LD_LIBRARY_PATH is removed and ephy-profile-migrator can't find the required libraries. A patch is attached which fixes this issue by appending to the existing environment instead of replacing it.
Created attachment 223715 [details] [review] ephy-profile-utils: don't replace environment when spwaning ephy-profile-migrator Instead, just append the new variable to the existing environment.
Review of attachment 223715 [details] [review]: ::: lib/ephy-profile-utils.c @@ +213,3 @@ + envp = g_environ_setenv (g_get_environ (), + "EPHY_LOG_MODULES", "ephy-profile", + TRUE); Isn't this changing the *current* environment? I'd say you want to pass this to the spawn method, but not set it here, no?
Review of attachment 223715 [details] [review]: OK, nevermind, g_environ_setenv does not actually set anything anywhere, just changes the string. So this looks good to me.
Attachment 223715 [details] pushed as adfecc2 - ephy-profile-utils: don't replace environment when spwaning ephy-profile-migrator
Turns out this breaks the migrator tests for some reason, so I have reverted the patch for now. If you can have a loot at it that would be great, otherwise I'll try to figure it out when I can and re-commit.
Created attachment 224260 [details] [review] ephy-profile-utils: don't replace environment when spwaning ephy-profile-migrator Instead, just append the new variable to the existing environment. New patch which doesn't break test-ephy-migrator anymore.
There is actually a more severe issue in the code in 3.6/master. The new environment is not NULL-terminated, which means that random bytes get appended to the environment. This breaks epiphany startup completely here on a fresh installation of GNOME 3.6.0 (execve fails with EFAULT). Stefano's patch should fix this issue as well as g_environ_setenv returns a NULL-terminated array.
Review of attachment 224260 [details] [review]: This looks fine. We need to fix the re-entrancy bug that makes the workaround needed, but elsewhere. If you have commit rights please push to master and gnome-3-6. Thanks!
Comment on attachment 224260 [details] [review] ephy-profile-utils: don't replace environment when spwaning ephy-profile-migrator Setting the right flag...
Attachment 224260 [details] pushed as 892cab7 - ephy-profile-utils: don't replace environment when spwaning ephy-profile-migrator Pushed on master and gnome-3-6