Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 76356 - net-misc/nxclient configuration can break almost every X11 application when nx-x11 is improperly upgraded.
Summary: net-misc/nxclient configuration can break almost every X11 application when n...
Status: RESOLVED TEST-REQUEST
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High critical (vote)
Assignee: Gentoo NX Server project
URL:
Whiteboard:
Keywords:
: 70927 81014 91157 (view as bug list)
Depends on:
Blocks: 82330
  Show dependency tree
 
Reported: 2005-01-01 16:48 UTC by Daniel Holth
Modified: 2006-11-04 17:35 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
xorg env.d file (10xorg,170 bytes, text/plain)
2005-01-02 08:58 UTC, Daniel Holth
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Holth 2005-01-01 16:48:58 UTC
I reemerged nx-x11 and most of my X11 applications would not work, e.g. unable to login to X at all.

Turns out the problem is that all my dynamically linked X apps began to look for NX libraries before X11 libraries. NX breaks == no X11 for you.

Reproducible: Always
Steps to Reproduce:
1. reemerge nx-x11 after using older version
2. notice X becomes completely unusable
3. whoops, it is because lots of X applications try to link dynamically to missing X11 libraries in /usr/NX/lib
Actual Results:  
almost every X application was unusable

Expected Results:  
I didn't expect NX's libraries to come ahead of standard libraries for every
user. If /usr/lib came before /usr/NX/lib in /etc/ld.so.conf normal Xorg.x11
would not break. nxclient also still works when /usr/NX/lib is not present at
all in ld.so.conf and ldconfig has been run.

This is related to bug 36170 : http://bugs.gentoo.org/show_bug.cgi?id=36270 .
There is obviously a missing dependency for nxcomp == x.y.z somewhere. Those
missing libraries brought my GUI system down.

Portage 2.0.51-r3 (gcc34-x86-2004.2, gcc-3.4.3, glibc-2.3.4.20040808-r1,
2.6.10-gentoo-r1 i686)
=================================================================
System uname: 2.6.10-gentoo-r1 i686 AMD Athlon(TM) XP 1600+
Gentoo Base System version 1.5.3
distcc 2.13 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632)
[disabled]ccache version 2.3 [enabled]
Autoconf: sys-devel/autoconf-2.59-r5
Automake: sys-devel/automake-1.8.5-r1
Binutils: sys-devel/binutils-2.15.90.0.1.1-r3
Headers:  sys-kernel/linux26-headers-2.6.8.1-r1
Libtools: sys-devel/libtool-1.5.10-r1
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-O2 -march=athlon-xp -fomit-frame-pointer -pipe"
CHOST="i686-pc-linux-gnu"
COMPILER=""
CONFIG_PROTECT="/etc /usr/NX/etc /usr/kde/2/share/config
/usr/kde/3.2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config
/usr/kde/3.3/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb
/usr/lib/mozilla/defaults/pref /usr/share/config
/usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/
/usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/
/usr/share/texmf/xdvi/ /var/bind /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -march=athlon-xp -fomit-frame-pointer -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache distlocks"
GENTOO_MIRRORS="http://gentoo.osuosl.org
http://distro.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage /usr/local/overlays/bmg-main
/usr/local/overlays/deltup"
SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage"
USE="X aalib alsa apache2 apm arts avi berkdb bitmap-fonts blender-game
bluetooth bonobo c cairo caps cdr crypt cups dvd encode esd f77 flac foomaticdb
fortran gcj gdbm gif gimp gimpprint gnome gphoto2 gpm gtk gtk2 gtkhtml guile
imlib ipv6 jabber jack java javascript jikes joystick jpeg kde ldap libg++
libwww mad mikmod mmx mng motif mozilla mozsvg mpeg ncurses network nls nptl
objc ofx oggvorbis opengl oss pam pda pdflib perl pic png postgres ppds python
qt quicktime readline ruby sdl slang snmp speex spell sse ssl svg tcltk tcpd
tetex theora threads tiff truetype usb v4l v4l2 x86 xinerama xml2 xmms xprint xv
zlib zvbi"
Comment 1 Stuart Herbert (RETIRED) gentoo-dev 2005-01-02 00:38:06 UTC

*** This bug has been marked as a duplicate of 44028 ***
Comment 2 Daniel Holth 2005-01-02 08:41:34 UTC
This is not a sorting problem. This is an issue where the Xorg X11 libraries (in /usr/lib) are not mentioned at all, and so are implied as coming after, all the entries including /usr/NX/lib in ld.so.conf

Removing /usr/NX/lib from ld.so.conf fixes this perfectly, and NX still functions.
Comment 3 Stuart Herbert (RETIRED) gentoo-dev 2005-01-02 08:48:17 UTC
Hrm.  My Gentoo system has the Xorg libraries in /usr/X11R6/lib, not /usr/lib, *and* they are correctly listed first in /etc/ld.so.conf.

Please paste the contents of /etc/env.d/10xorg.

Best regards,
Stu
Comment 4 Daniel Holth 2005-01-02 08:58:10 UTC
Created attachment 47384 [details]
xorg env.d file

I'm using xorg-x11 version 6.8.0-r4. For some reason this version of xorg-x11
installs all its libraries in /usr/lib and symlinks /usr/X11R6/lib to /usr/lib.
No LDPATH in env.d
Comment 5 Daniel Holth 2005-01-02 09:15:51 UTC
Putting /usr/NX/lib in ld.so.conf breaks things. Does it fix anything?

A better solution would be to twiddle some elf option in the nx binaries so that only those specific binaries look for /usr/NX/lib first. The nxserver components set LD_LIBRARY_PATH appropriately so they still work with no /usr/NX/lib in the search path. It's brain damaged to have a binary that really needs NX libraries linking partially with standard X11 libs.

Example: nxviewer

dholth@bluefish /usr/NX/bin $ export LD_LIBRARY_PATH=/usr/lib:/usr/NX/lib
dholth@bluefish /usr/NX/bin $ ./nxviewer
./nxviewer: symbol lookup error: /usr/NX/lib/libXcompext.so.1: undefined symbol: _NXEnableCleanGet

dholth@bluefish /usr/NX/bin $ export LD_LIBRARY_PATH=/usr/NX/lib:/usr/lib
dholth@bluefish /usr/NX/bin $ ./nxviewer
NXTightVNC viewer version 1.2.4 (based on VNC 3.3.3r2)
Comment 6 Daniel Holth 2005-01-02 09:29:52 UTC
The NX binaries should be linked with the option -R/usr/NX/lib so that they search for shared libraries in that directory. That way NX programs link with NX libraries, regular programs link with standard libraries, and no ld.so.conf madness is necessary.
Comment 7 Stuart Herbert (RETIRED) gentoo-dev 2005-01-02 10:51:34 UTC
How do you propose we add the -R option to the binaries that we don't have source code for? :)  If there's something that can be done, I'm happy to do it.

I'll have a chat with the maintainer of xorg-x11-6.8.0-r4, and find out more about the changes there.

Best regards,
Stu
Comment 8 Donnie Berkholz (RETIRED) gentoo-dev 2005-01-08 17:19:20 UTC
Stuart and I have discussed a fix, adding LDPATH="/usr/lib" to /etc/env.d/10xorg. Can anyone confirm that this in fact fixes the problem by making that addition, then running env-update and trying some nx app?

Reassigning to us until this gets fixed, because we need to do it.
Comment 9 Daniel Holth 2005-01-10 20:07:20 UTC
X11 libs in /usr/lib with a symlink from /usr/X11R6/lib to /usr/lib is naughty and so is having to include /usr/lib in LDPATH (it is in there by default, but after manually specified directories).

If xorg must provide LDPATH, set it to /usr/X11R6/lib/ ; this way, the LDPATH workaround will still work when xorg becomes sane and re-segregates its libraries.
Comment 10 Donnie Berkholz (RETIRED) gentoo-dev 2005-01-10 20:48:03 UTC
X is moving _toward_ sanity. You'll see /usr/X11R6/lib disappearing over time, along with everything else in the /usr/X11R6 monstrosity that exists for no good reason. (Is there /usr/gnome? /usr/xfce? /usr/kde? ... I could go on forever.)

If you want to complain about something broken, complain about how nomachine provides its own copy of libX11, which breaks other apps, instead of a real lib that doesn't conflict with one that X has provided for ages.

Incidentally, I'd enjoy a report of whether this works in addition to your opinion.
Comment 11 Daniel Holth 2005-01-11 15:40:47 UTC
sorry not to mention it before, it's old news to me that putting wherever the X11 libs are BEFORE wherever the NX libs are in the library path does work.

I am very pleased that there is a separate directory for each version of KDE. It makes it very easy to answer the question "which kde programs do I have?". Unlike NX, the KDE folks are kind enough to understand linker options so their programs will work without ld.so.conf entries. Most of the NX programs work without an entry in ld.so.conf and that is my solution right now.

My long term solution for open source NX is to fix the linker option so that their library search path is built in to the binaries.

Summary: xorg used to put /usr/X11R6/lib before NX libraries. Then xorg changed, not mentioning its libraries at all. If it puts /usr/lib before NX's listing, things will work. But ld.so.conf is evil.
Comment 12 Daniel Holth 2005-01-11 15:46:11 UTC
The really non-intrusive, best solution is to replace all the NX binaries with wrapper scripts that say approximately:

#!/bin/sh
LDPATH=/usr/NX/lib:$LDPATH
/usr/NX/bin/nx-binary-program

a la mozilla.

and to ban NX's ld.so.conf entry, and omit xorg's as well.
Comment 13 Donnie Berkholz (RETIRED) gentoo-dev 2005-01-20 11:18:09 UTC
Added this to 6.8.1.902 yesterday, plan to add to 6.8.0-r4 today. Maybe a fancier solution can come later.
Comment 14 Donnie Berkholz (RETIRED) gentoo-dev 2005-01-20 23:56:41 UTC
Added to 6.8.0-r4, fixed in 6.8.1.902. Reassigning to Stuart, removing X11 because our part is done for now.

If another working solution gets decided upon that requires action on our part, just re-add us.
Comment 15 Daniel Holth 2005-01-21 21:48:39 UTC
By the way, I checked it out and, in the absence of any ld.so.conf entries:

nxagent nxdesktop nxproxy nxviewer

do not work. Everything else works fine. So these are the only binaries that might benefit from a wrapper.

- Daniel Holth
Comment 16 Donnie Berkholz (RETIRED) gentoo-dev 2005-02-06 16:21:04 UTC
*** Bug 81014 has been marked as a duplicate of this bug. ***
Comment 17 Stuart Herbert (RETIRED) gentoo-dev 2005-02-17 02:28:09 UTC
*** Bug 70927 has been marked as a duplicate of this bug. ***
Comment 18 Stuart Herbert (RETIRED) gentoo-dev 2005-02-19 02:23:20 UTC
Daniel,

I've just added nx-x11-1.4.0-r4 into Portage.  Do you want to give that a go, and see if upstream have addressed this?

W/ Donnie's changes having been made, I'm happy to close this bug.

Best regards,
Stu
Comment 19 STefan 2005-03-14 13:03:44 UTC
I think this bug is fixed with the latest ebuilds.
Comment 20 Donnie Berkholz (RETIRED) gentoo-dev 2005-05-02 10:02:23 UTC
*** Bug 91157 has been marked as a duplicate of this bug. ***
Comment 21 Stuart Herbert (RETIRED) gentoo-dev 2005-05-23 12:21:05 UTC
Closing bug, as there's been no reply to the request for testing.
Comment 22 SpanKY gentoo-dev 2006-08-09 08:46:08 UTC
if this LDPATH is no longer needed, then we should punt it

if nx still sucks, then the nx ebuilds should inherit this bloat ... punishing the rest of the world for nx's problems is the opposite of what should happen
Comment 23 Stuart Herbert (RETIRED) gentoo-dev 2006-11-04 17:35:46 UTC
Hi,

Give the new packages in the NX overlay a try.  They should hopefully fix this problem.

Best regards,
Stu