After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 683538 - can't start epiphany after recent libgnome-desktop upgrade
can't start epiphany after recent libgnome-desktop upgrade
Status: RESOLVED FIXED
Product: epiphany
Classification: Core
Component: General
git master
Other Linux
: Immediate blocker
: ---
Assigned To: Epiphany Maintainers
Epiphany Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-09-06 21:40 UTC by Stefano Facchini
Modified: 2012-09-29 09:12 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
ephy-profile-utils: don't replace environment when spwaning ephy-profile-migrator (1.42 KB, patch)
2012-09-06 21:41 UTC, Stefano Facchini
committed Details | Review
ephy-profile-utils: don't replace environment when spwaning ephy-profile-migrator (1.52 KB, patch)
2012-09-13 19:13 UTC, Stefano Facchini
committed Details | Review

Description Stefano Facchini 2012-09-06 21:40:40 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.
Comment 1 Stefano Facchini 2012-09-06 21:41:03 UTC
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.
Comment 2 Xan Lopez 2012-09-06 22:25:47 UTC
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?
Comment 3 Xan Lopez 2012-09-06 22:34:13 UTC
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.
Comment 4 Stefano Facchini 2012-09-07 08:04:48 UTC
Attachment 223715 [details] pushed as adfecc2 - ephy-profile-utils: don't replace environment when spwaning ephy-profile-migrator
Comment 5 Xan Lopez 2012-09-07 21:35:57 UTC
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.
Comment 6 Stefano Facchini 2012-09-13 19:13:34 UTC
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.
Comment 7 Jürg Billeter 2012-09-28 21:44:21 UTC
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.
Comment 8 Xan Lopez 2012-09-29 00:16:20 UTC
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 9 Xan Lopez 2012-09-29 00:16:47 UTC
Comment on attachment 224260 [details] [review]
ephy-profile-utils: don't replace environment when spwaning ephy-profile-migrator

Setting the right flag...
Comment 10 Stefano Facchini 2012-09-29 09:12:31 UTC
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