[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: LSB wrapper library



Matt Wilson <msw@redhat.com> writes:

> On Tue, Apr 03, 2001 at 02:19:04PM +0200, Andreas Jaeger wrote:
> >
> > This glibc setup should work in case that we fork.  But if we fork we
> > do need to fork *all* LSB libraries.
> 
> I don't have a clear picture on why it is necessary to for all
> libraries if we fork one.

See below.


> > IMO ld-lsb.so.1 should *not* look into /lib and /usr/lib, no library
> > should live there. We should keep the namespaces really separate.  
> 
> I think it ld-lsb.so.1 should look into /lib and /usr/lib and the
> distribution only needs to place libraries engineered to be compatible
> with lsb applications in /lib/lsb in case of ABI breakage...

This will not work in a reliable way.

If you only fork e.g. libc.so.6 and leave the rest you get the problem
that two dynamic linkers are loaded since all non-forked libs, like
libreadline in my example below, are linked against ld-linux.so.2.  We
shouldn't load two different versions of the linker.

Ok, let's do some hacks to show what will happen:

$ LD_LIBRARY_PATH=/lib:/usr/lib LD_PRELOAD=libreadline.so:libncurses.so LD_DEBUG=libs /lib/lsb/ld-lsb.so.1 /bin/cat
13868:  find library=libreadline.so; searching
13868:   search path=/lib/i686/mmx:/lib/i686:/lib/mmx:/lib:/usr/lib/i686/mmx:/usr/lib/i686:/usr/lib/mmx:/usr/lib                (LD_LIBRARY_PATH)
13868:    trying file=/lib/i686/mmx/libreadline.so
13868:    trying file=/lib/i686/libreadline.so
13868:    trying file=/lib/mmx/libreadline.so
13868:    trying file=/lib/libreadline.so
13868:    trying file=/usr/lib/i686/mmx/libreadline.so
13868:    trying file=/usr/lib/i686/libreadline.so
13868:    trying file=/usr/lib/mmx/libreadline.so
13868:    trying file=/usr/lib/libreadline.so
13868:
13868:  find library=libncurses.so; searching
13868:   search path=/lib:/usr/lib              (LD_LIBRARY_PATH)
13868:    trying file=/lib/libncurses.so
13868:    trying file=/usr/lib/libncurses.so
13868:
13868:  find library=libc.so.6; searching
13868:   search path=/lib:/usr/lib              (LD_LIBRARY_PATH)
13868:    trying file=/lib/libc.so.6
13868:
13868:  find library=ld-linux.so.2; searching
13868:   search path=/lib:/usr/lib              (LD_LIBRARY_PATH)
13868:    trying file=/lib/ld-linux.so.2
13868:
13868:
13868:  calling init: /lib/libc.so.6
13868:
13868:
13868:  calling init: /usr/lib/libncurses.so
13868:
13868:
13868:  calling init: /usr/lib/libreadline.so


$ cat /proc/13868/maps 
08048000-0804b000 r-xp 0000000000000000 08:03 240051     /bin/cat
0804b000-0804c000 rw-p 0000000000002000 08:03 240051     /bin/cat
0804c000-0804d000 rw-p 0000000000000000 00:00 0
40000000-40001000 rw-p 0000000000000000 00:00 0
40001000-40022000 r-xp 0000000000000000 08:03 304019     /lib/libreadline.so.4.1
40022000-40023000 ---p 0000000000021000 08:03 304019     /lib/libreadline.so.4.1
40023000-40027000 rw-p 0000000000021000 08:03 304019     /lib/libreadline.so.4.1
40027000-40028000 rw-p 0000000000000000 00:00 0
40028000-40064000 r-xp 0000000000000000 08:03 312325     /lib/libncurses.so.5.2
40064000-4006f000 rw-p 000000000003b000 08:03 312325     /lib/libncurses.so.5.2
4006f000-40072000 rw-p 0000000000000000 00:00 0
40072000-40185000 r-xp 0000000000000000 08:03 304802     /lib/libc.so.6
40185000-4018b000 rw-p 0000000000112000 08:03 304802     /lib/libc.so.6
4018b000-4018f000 rw-p 0000000000000000 00:00 0
4018f000-401a4000 r-xp 0000000000000000 08:03 304798     /lib/ld-2.2.2.so
401a4000-401a6000 rw-p 0000000000014000 08:03 304798     /lib/ld-2.2.2.so
401a6000-401c8000 r--p 0000000000000000 08:03 113590     /usr/lib/locale/de_DE/LC_CTYPE
80000000-80017000 r-xp 0000000000000000 08:03 599672     /lib/lsb/ld-2.2.3.so
80017000-80018000 rw-p 0000000000016000 08:03 599672     /lib/lsb/ld-2.2.3.so
80018000-8001a000 rwxp 0000000000000000 00:00 0
bfffa000-c0000000 rwxp ffffffffffffb000 00:00 0

Andreas
-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.inka.de
    http://www.suse.de/~aj



Reply to: