Bug 9076 - Cannot run tests
Summary: Cannot run tests
Status: CLOSED DUPLICATE of bug 9046
Alias: None
Product: Samba 3.6
Classification: Unclassified
Component: Build environment (show other bugs)
Version: 3.6.6
Hardware: All All
: P5 normal
Target Milestone: ---
Assignee: Björn Jacke
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-03 11:58 UTC by Gordon Lack
Modified: 2012-08-07 17:15 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gordon Lack 2012-08-03 11:58:37 UTC
Building Samba 3.6.6 on RedHat 5.8.
When I try to run the tests (which I do *before* installing anything) it fails.

st/s3dc/logs/log.smbd contains:


[2012/08/03 12:09:06.502207,  0, pid=12794] param/loadparm.c:7885(lp_set_enum_parm)
  WARNING: Ignoring invalid value 'vlp' for parameter 'printing'
[2012/08/03 12:09:06.503316,  0, pid=12794] smbd/server.c:1109(main)
  standard input is not a socket, assuming -D option
./bin/smbd: symbol lookup error: ./bin/smbd: undefined symbol: wbcSidsToUnixIds


The "undefiend symbol" is because the smbd executable is trying to use the libwbclient.so.0 which is in place from a previous installation.  It's getting it via the RPATH setting in the binary.  (If that weren't set it wouldn't find the library at all).

But the test should be running with the version of that library which has just been built.  So the test need to set LD_LIBRARY_PATH to the appropriate value for that to happen, either globally for the test or by using a suitable smbd interlude script (would also be needed for nmbd, ....)

Thsi is similar to bug #8413 and bug #9046 (but the solution can't be to install anything).
Comment 1 Gordon Lack 2012-08-03 13:22:57 UTC
IMPORTANT UPDATE!!!

The issue is slightly different to that originally stated.

It appears that the test *do* set LD_LIBRARY_PATH (or achieve that end some other way).

The actual problem is that the RPATH setting in the binaries *cannot be overridden* by LD_LIBRARY_PATH!  Indeed, the ld.so manpage on Linux says that is is deprecated (in favour or RUNPATH), presumably as a result of this.

But gcc sets RPATH, not RUNPATH, so you are stuffed.

If you already have an earlier installation of Samba on your build system in the place where you wish to install the newer version (not an unreasonable state of affairs) then you cannot test the new version, as it will always use the libraries from the old one.

So, had it not been for the missing symbol I might have ended up running tests against old samba libraries with no indication of that fact.
Comment 2 Gordon Lack 2012-08-03 13:47:03 UTC
FYI: seems you need to use:

   --enable-new-dtags

in gcc/ld in order to get RUNPATH set (and hence get an LD_LIBRARY_PATH overridable setting).

   http://en.wikipedia.org/wiki/Rpath#The_role_of_GNU_ld
Comment 3 Björn Jacke 2012-08-03 19:23:07 UTC
eu-readelf -a /usr/sbin/smbd | grep RPATH

gives back nothing here (SerNet RPMs on SUSE) and actually we remove all rpath flags on standard paths in the samba 3.x build system that might come in via krb5-config etc. since a long time. So the rpath you see in your binaries, where do they come from? On a default installations like those you will find in most distribution RPMs you will not see that issue or your distributor might have placed an rpath there for whatever reason. In any case we will not make a change like RPATH->RUNPATH in the stable verions trees anyhow. If you test master (4.0) with the waf build system and you see issues there then we could discuss to change things there. Samba 4 actually *does* use rpath, so testing that would be very welcome!
Comment 4 Gordon Lack 2012-08-07 09:39:23 UTC
This is my own build (if I were using RPMs I wouldn't be running the test suite).

Configured by:

./configure \
   --enable-socket-wrapper \
   --enable-nss-wrapper \
   --disable-cups \
   --prefix=/local/samba

(The two enables are needed to run the tests, according to my notes).

It seems odd (to me) that on a system with dynamic libraries you would build static versions of daemons.  However, that's your choice.  It doesn't alter trhe fact that building a (default) shared version with a different version already in the configured destination means that you can't run the testes,.
Comment 5 Björn Jacke 2012-08-07 16:58:09 UTC

*** This bug has been marked as a duplicate of bug 9046 ***
Comment 6 Gordon Lack 2012-08-07 17:15:04 UTC
This is NOT a duplicate of bug 9046.

This is about the fact that you CANNOT RUN THE TESTS WHEN YOU BUILD SAMBA if you already have a different version of Samba installed in the installation location because the test runs will use the installed libraries, not the just-built ones.

But it seems that I cannot re-open this ticket.