Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Sep 2018 00:03:32 +0200
From:      Andreas Longwitz <longwitz@incore.de>
To:        Konstantin Belousov <kostikbel@gmail.com>
Cc:        freebsd-stable@freebsd.org
Subject:   Re: Constraints in libmap(32).conf do not work as expected, possible bug in rtld-elf
Message-ID:  <5BA95F34.9070300@incore.de>
In-Reply-To: <20180921134833.GU3161@kib.kiev.ua>
References:  <5B89C1E7.4090002@incore.de> <20180902120603.GI2340@kib.kiev.ua> <5B9829FE.10700@incore.de> <20180921134833.GU3161@kib.kiev.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
> 
> Can you try this instead ?
> 
Yes I did on a server running FreeBSD 12.0-CURRENT (GENERIC) #0 r337452
and - after a trivial adaptation of your patch - on FreeBSD 10.4-STABLE
#0 r337823 and everything works correct.

My simple libmap32.conf now is:

## php52
[/usr/local/php52/]
/usr/local/lib          /usr/local/lib32
/usr/local/lib/mysql    /usr/local/lib32/mysql

[libc-client4.so.9]
libssl.so.8             libssl.so.6
libcrypto.so.8          libcrypto.so.6

My test command "/usr/local/php52/bin/php -i" loads also all the shared
objects in /usr/local/php52/lib/php/20060613: gettext.so iconv.so
imap.so mbstring.so mcrypt.so mysql.so pcre.so session.so xml.so.
Further ldd gives correct output for every mentioned file.

I like to mention one thing concerning the source libmap.c. With the
patch (yours or mine) and the libmap32.conf given above I see the
following lmp_list when lm_fini() is called:

    lm_fini("1, $DEFAULT$" lml-Adresse 0x2826c208)
        lm_fini("f=/usr/local/lib, t=/usr/local/lib32")
        lm_fini("f=/usr/local/lib, t=/usr/local/lib32")
        lm_fini("f=/usr/local/lib, t=/usr/local/lib32")
        lm_fini("f=/usr/local/lib, t=/usr/local/lib32")
        lm_fini("f=/usr/local/lib, t=/usr/local/lib32")
        lm_fini("f=/usr/local/lib, t=/usr/local/lib32")
        lm_fini("f=/usr/local/lib/mysql, t=/usr/local/lib32/mysql")
        lm_fini("f=/usr/local/lib, t=/usr/local/lib32")
        lm_fini("f=libcrypto.so.8, t=libcrypto.so.6")
        lm_fini("f=libssl.so.8, t=libssl.so.6")
        lm_fini("f=/usr/local/lib, t=/usr/local/lib32")
        lm_fini("f=/usr/local/lib, t=/usr/local/lib32")
        lm_fini("f=/usr/local/lib, t=/usr/local/lib32")
        lm_fini("f=/usr/local/lib, t=/usr/local/lib32")
        lm_fini("f=/usr/local/lib, t=/usr/local/lib32")
        lm_fini("f=/usr/local/lib, t=/usr/local/lib32")
        lm_fini("f=/usr/local/lib, t=/usr/local/lib32")
        lm_fini("f=/usr/local/lib, t=/usr/local/lib32")
        lm_fini("f=/usr/local/lib, t=/usr/local/lib32")
        lm_fini("f=/usr/local/lib, t=/usr/local/lib32")
        lm_fini("f=/usr/local/lib, t=/usr/local/lib32")
        lm_fini("f=/usr/local/lib, t=/usr/local/lib32")
        lm_fini("f=/usr/local/lib, t=/usr/local/lib32")
        lm_fini("f=/usr/local/lib, t=/usr/local/lib32")
        lm_fini("f=/usr/local/lib, t=/usr/local/lib32")
        lm_fini("f=/usr/local/lib, t=/usr/local/lib32")
     lm_fini("1, libc-client4.so.9" lml-Adresse 0x2826c168)
        lm_fini("f=libcrypto.so.8, t=libcrypto.so.6")
        lm_fini("f=libssl.so.8, t=libssl.so.6")
     lm_fini("2, /usr/local/php52/" lml-Adresse 0x2826c068)
        lm_fini("f=/usr/local/lib/mysql, t=/usr/local/lib32/mysql")
        lm_fini("f=/usr/local/lib, t=/usr/local/lib32")

So for $DEFAULTS we have a lot of identical entries. This comes from the
TAILQ_INSERT_HEAD statement in lm_add(). I am not sure if this can be
accepted or a check to avoid double entries in the list is better.

One annotation to the script /etc/rc.d/ldconfig: I had expected that
this script during boot creates clean files ld-elf(32).so.hints in
/var/run. For 64 bit this is true, but for 32 bit not because ldconfig
with flag -32 also has flag -m. Is this intended behaviour ?


Andreas Longwitz








Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5BA95F34.9070300>