Skip to content
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

libcinnamon-js.so still not loaded. #4500

Closed
marguerite opened this issue Aug 10, 2015 · 19 comments
Closed

libcinnamon-js.so still not loaded. #4500

marguerite opened this issue Aug 10, 2015 · 19 comments

Comments

@marguerite
Copy link
Contributor

I‘m using openSUSE and I maintain Cinnamon. Everything updated to the latest version.

In my ~/.xsession-errors-:0:

Window manager warning: Log level 16: Failed to load shared library 'libcinnamon-js.so' referenced by the typelib: libcinnamon-js.so: Can not open shared object file: No such file or directory

As I noticed we have had the ugly hacky patch to link /usr/lib64/cinnamon/libcinnamon-js.so to /usr/bin/cinnamon so that we packagers no longer need to "chrpath" or "patchelf" things (by the way, patchelf has a serious bug for almost a year, don't use it).

My cinnamon's runpath:

/usr/bin/cinnamon: RUNPATH=/usr/lib64/cinnamon

But during start, all js applets still can't be loaded.

Using strace, I got:

open("/usr/lib64/cinnamon/libcinnamon.so", O_RDONLY|O_CLOEXEC) = 3

which indicates that runpath is recognized, but:

open("/usr/lib64/libcinnamon-js.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)

/usr/bin/cinnamon doesn't even try to open "/usr/lib64/cinnamon/libcinnamon-js.so" :-(

please help me to debug this?

Marguerite

@leigh123linux
Copy link
Contributor

Check the rpath

chrpath -l /usr/bin/cinnamon

it should return

$ chrpath -l /usr/bin/cinnamon
/usr/bin/cinnamon: RPATH=/usr/lib64/cinnamon

If it has the wrong path set run

chrpath -r /usr/lib64/cinnamon /usr/bin/cinnamon

If it doesn't have any rpath set you will need to run

patchelf --set-rpath /usr/lib64/cinnamon /usr/bin/cinnamon

@leigh123linux
Copy link
Contributor

Try this in your spec file instead

# fix rpath for CinnamonJS
chrpath -r %{_libdir}/cinnamon %{buildroot}%{_bindir}/cinnamon
chrpath -l %{buildroot}%{_bindir}/cinnamon

@marguerite
Copy link
Contributor Author

NixOS/patchelf#10

I can't use patchelf, cinnamon will segfault with GLIBC_2.2.5 symbol not found in libc.so.6 when it actually has. Because the above bug.

And the/usr/bin/cinnamon RUNPATH=/usr/lib64/cinnamon is the output from chrpath -l. Still the same after running -r.

Seems I can have the RPATH you mentioned but RUNPATCH

@leigh123linux
Copy link
Contributor

I have no RUNPATH here only RPATH

$ readelf --dynamic /usr/bin/cinnamon | grep PATH
 0x000000000000000f (RPATH)              Library rpath: [/usr/lib64/cinnamon]

@leigh123linux
Copy link
Contributor

I note in you spec file you dont disable rpath in configure

%build
NOCONFIGURE=1 ./autogen.sh
%configure                          \
   --disable-schemas-compile        \
   --enable-compile-warnings=yes       \
   --with-ca-certificates=%{_sysconfdir}/ssl/ca-bundle.pem
make %{?_smp_mflags}

I use this in fedora

NOCONFIGURE=1 ./autogen.sh

%build
%configure \
 --disable-static \
 --disable-rpath \
 --disable-schemas-compile \
 --enable-introspection=yes \
 --enable-compile-warnings=no

sed -i -e 's! -shared ! -Wl,--as-needed\0!g' libtool

make %{?_smp_mflags} V=1

%install

@marguerite
Copy link
Contributor Author

I'll test if disable rpath works...and why did you disable as-needed? If the absorbed hacky patch works:

  1. chrpath/patchelf won't be needed...(I doubt that)
  2. the linking to libcinnamon-js.so should survive through as-needed...

because it was what the patch meaned to be, see

http://lists.opensuse.org/opensuse-commit/2012-05/msg00780.html

@leigh123linux
Copy link
Contributor

The as-needed was probably a leftover from some test and I will remove it

http://pkgs.fedoraproject.org/cgit/cinnamon.git/commit/?id=4f0f616eddf4694781263a61871a08396adff39f

The options that might be useful to you are

--disable-rpath

and

--disable-static

@marguerite
Copy link
Contributor Author

Hi, I added "--disable-rpath" and "--disable-static".

chrpath -l /home/abuild/rpmbuild/BUILDROOT/cinnamon-2.6.13-3.2.x86_64/usr/bin/cinnamon
/home/abuild/rpmbuild/BUILDROOT/cinnamon-2.6.13-3.2.x86_64/usr/bin/cinnamon: RUNPATH=/usr/lib64/cinnamon

still RUNPATH not RPATH

https://build.opensuse.org/build/home:MargueriteSu:branches:X11:Cinnamon:Factory/openSUSE_Tumbleweed/x86_64/cinnamon/_log

@marguerite
Copy link
Contributor Author

I found my old changelog, seems I researched on this issue before:

- fix boo#904414: Cinnamon 2.4 Applets fail to load
  * /usr/bin/cinnamon has RUNPATH by default, but only
    RPATH can find /usr/lib(64)/cinnamon/libcinnamon-js.so
    have to explicitly set RPATH=/usr/lib(64)/cinnamon  
  * we use chrpath/patchelf to delete RUNPATH and force
    set RPATH. As RUNPATH will "hide" RPATH and OBS may
    have DT_RUNPATH for all builds, we can never set
    RPATH by patch (the RPATH in Makefiles will end up
    to be RUNPATH anyway)

And since patchelf has a serious bug, this method is no longer available.

Maybe upstream should implement a --disable-runpath configure option.

Kind Remind: the hacky patch won't work if DT_RUNPATH is set, because it only affects RPATH, which will be always hidden in that case.

@leigh123linux
Copy link
Contributor

I'm not convinced this is a cinnamon issue

http://trac.kodi.tv/ticket/15497

https://bugzilla.opensuse.org/show_bug.cgi?id=902421

from your buildlog, so it looks like that you have two build dep packages with broken .pc files

-Wl,-rpath -Wl,/usr/lib64 -Wl,-rpath -Wl,/usr/lib64

This rpath doesn't exist in my build

https://kojipkgs.fedoraproject.org//packages/cinnamon/2.6.13/5.fc22/data/logs/x86_64/build.log

@marguerite
Copy link
Contributor Author

@leigh123linux thanks, I'll fix those pkgconfig files first.

@marguerite
Copy link
Contributor Author

$ cd /usr/lib64/pkgconfig
$ grep -r "Wl" .
./libcrypto.pc:Libs.private: -Wl,-z,relro,-z,now -ldl -lz
./libssl.pc:Libs.private: -Wl,-z,relro,-z,now -ldl -lz
./gmodule-2.0.pc:Libs: -L${libdir} -Wl,--export-dynamic -lgmodule-2.0 -pthread
./gmodule-export-2.0.pc:Libs: -L${libdir} -Wl,--export-dynamic -lgmodule-2.0 -pthread

Here all I can get...should I remove -L${libdir} from gmodule-*.pc?

@marguerite
Copy link
Contributor Author

It's weird, seems i586 wasn't affected

-Wl,-rpath -Wl,/usr/lib -Wl,-rpath -Wl,/usr/lib

doesn't exist, such strings only appears on x86_64

@two-dogs
Copy link

seeing the error "Window manager warning: Log level 16: Failed to load shared library 'libcinnamon-js.so' referenced by the typelib: libcinnamon-js.so: cannot open shared object file: No such file or directory
failed to create drawable" as of last opensuse-cinn-factory-tw upgrade, 10 sep-15, i dont see applets on panel, as described by https://github.com/marguerite previously, i am guessing i can symlink for the time being, and will try same, my xsessions log is here http://git.io/vZldT

System: Host: linux-gumo Kernel: 4.1.6-3-desktop x86_64 (64 bit gcc: 5.1.1) Desktop: KDE Plasma 5.4.0 (Qt 5.4.2) Distro: openSUSE 20150903 (Tumbleweed)

i symlinked the missing libcinnamon-js.so from /usr/lib64/cinnamon/ to /usr/lib64/ , logged in no issue, applets present, working fine.

@leigh123linux
Copy link
Contributor

I wonder if this would fix the runpath packaging issue

./configure --disable-static --prefix=/usr
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool

taken from

https://fedoraproject.org/wiki/Packaging:Guidelines#Removing_Rpath

@marguerite
Copy link
Contributor Author

@leigh123linux

Sorry for the late reply, the last "-rpath /usr/lib64 -rpath /usr/lib64" error was coming from openSUSE's gettext-tools. So I spent the last whole month to push the fix.

Yes the method you mentioned will remove the runpath, but there will be no runpath/rpath applied at all. Neither right ones nor wrong ones.

As we discussed before, it is not needed to manually manipulate rpath/runpath now because libcinnamon-js.so is now linked by /usr/bin/cinnamon.

The fixes I did were to make cinnamon being built as upstream' codes intend it to be.

But now the problem is back to what I reported before: cinnamon doesn't behave like what it's coded to be, that is, no rpath on /usr/bin/cinnamon and can find libcinnamon-js.so

@ghost
Copy link

ghost commented Sep 27, 2015

Hello,

I'm using opensuse 13.1 64bits whith cinnamon from this repo:
http://download.opensuse.org/repositories/X11:/Cinnamon:/Factory/openSUSE_13.1/

I had the same issue (failed to load shared library 'libcinnamon-js.so') and solved it by creating a new file "/etc/ld.so.conf.d/cinnamon.conf" containing "/usr/lib64/cinnamon". After running "ldconfig" and restarting, the problem was solved.

@leigh123linux
Copy link
Contributor

@marguerite Is this still an issue with cinnamon-3.2.x?

@leigh123linux
Copy link
Contributor

Duplicate of #3843

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants