Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 702178 - net-fs/samba-4.10.10 : not found ldd errors in /usr/lib64/samba
Summary: net-fs/samba-4.10.10 : not found ldd errors in /usr/lib64/samba
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's SAMBA Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-12-06 17:18 UTC by Joakim Tjernlund
Modified: 2022-08-17 20:07 UTC (History)
5 users (show)

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


Attachments
user patch to remove all of my not found libs under /usr/lib64/samba (file_702178.txt,2.35 KB, patch)
2020-05-25 11:52 UTC, razamatan
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joakim Tjernlund 2019-12-06 17:18:26 UTC
cd /usr/lib64/samba
ldd *.so | grep found
	libsmbd-shim-samba4.so => not found
	libsmbd-shim-samba4.so => not found
	libsamba-debug-samba4.so => not found
	libsamba-debug-samba4.so => not found
	libsmbd-shim-samba4.so => not found

Some libs are not found, especially after upgrade from samba 4.9.x
rebuilding samba 4.10.11 might fix the problem, I have experienced
both.
Comment 1 Joakim Tjernlund 2019-12-06 17:27:22 UTC
just rebuilt samba again and now:
ldd *.so | grep found
	libsmbd-shim-samba4.so => not found
	libsmbd-shim-samba4.so => not found
	libsmbd-shim-samba4.so => not found
	libsamba-debug-samba4.so => not found
	libsamba-debug-samba4.so => not found
	libsmbd-shim-samba4.so => not found
	libreplace-samba4.so => not found

It gets worse ..
Comment 2 Alexander Tsoy 2019-12-06 20:30:31 UTC
Are you sure these libraries really needs RUNPATHs?
Comment 3 Alexander Tsoy 2019-12-06 21:54:28 UTC
That's what I mean. Libraries without RUNPATH (ldd shows "not found"):

 /usr/lib64/samba $ for i in ./*.so ; do ldd "$i" | grep -q found && echo $i ; done
./libaddns-samba4.so
./libcli-ldap-samba4.so
./libsamba-modules-samba4.so

And all binaries that links with these libraries have correct RUNPATHs, so there shouldn't be runtime issues:

 $ for i in $(qlist net-fs/samba) ; do readelf -Wd "$i" 2>/dev/null | egrep -q 'NEEDED.*(libaddns-samba4.so|libcli-ldap-samba4.so|libsamba-modules-samba4.so)' && { echo $i ; LANG=C readelf -Wd "$i" | grep RUNPATH ; } ; done 
/usr/bin/nmblookup
 0x000000000000001d (RUNPATH)            Library runpath: [/usr/lib64/samba:/usr/lib64]
/usr/bin/cifsdd
 0x000000000000001d (RUNPATH)            Library runpath: [/usr/lib64/samba:/usr/lib64]
/usr/bin/locktest
 0x000000000000001d (RUNPATH)            Library runpath: [/usr/lib64/samba:/usr/lib64]
/usr/bin/masktest
 0x000000000000001d (RUNPATH)            Library runpath: [/usr/lib64/samba:/usr/lib64]
/usr/bin/gentest
 0x000000000000001d (RUNPATH)            Library runpath: [/usr/lib64/samba:/usr/lib64]
/usr/bin/smbtorture
 0x000000000000001d (RUNPATH)            Library runpath: [/usr/lib64/samba:/usr/lib64]
/usr/lib64/libsamba-policy.so
 0x000000000000001d (RUNPATH)            Library runpath: [/usr/lib64/samba:/usr/lib64]
/usr/lib64/libsamba-policy.so.0
 0x000000000000001d (RUNPATH)            Library runpath: [/usr/lib64/samba:/usr/lib64]
/usr/lib64/libsamba-policy.so.0.0.1
 0x000000000000001d (RUNPATH)            Library runpath: [/usr/lib64/samba:/usr/lib64]
/usr/lib64/libsamba-passdb.so
 0x000000000000001d (RUNPATH)            Library runpath: [/usr/lib64/samba:/usr/lib64]
/usr/lib64/libsamba-passdb.so.0
 0x000000000000001d (RUNPATH)            Library runpath: [/usr/lib64/samba:/usr/lib64]
/usr/lib64/libsamba-passdb.so.0.27.0
 0x000000000000001d (RUNPATH)            Library runpath: [/usr/lib64/samba:/usr/lib64]
/usr/lib64/libdcerpc.so
 0x000000000000001d (RUNPATH)            Library runpath: [/usr/lib64/samba:/usr/lib64]
/usr/lib64/libdcerpc.so.0
 0x000000000000001d (RUNPATH)            Library runpath: [/usr/lib64/samba:/usr/lib64]
/usr/lib64/libdcerpc.so.0.0.1
 0x000000000000001d (RUNPATH)            Library runpath: [/usr/lib64/samba:/usr/lib64]
/usr/lib64/python2.7/site-packages/samba/smb.so
 0x000000000000001d (RUNPATH)            Library runpath: [/usr/lib64/samba:/usr/lib64]
/usr/lib64/python2.7/site-packages/samba/net.so
 0x000000000000001d (RUNPATH)            Library runpath: [/usr/lib64/samba:/usr/lib64]
/usr/lib64/samba/libnss-info-samba4.so
 0x000000000000001d (RUNPATH)            Library runpath: [/usr/lib64/samba:/usr/lib64]
/usr/lib64/samba/libidmap-samba4.so
 0x000000000000001d (RUNPATH)            Library runpath: [/usr/lib64/samba:/usr/lib64]
/usr/lib64/samba/libsmbd-base-samba4.so
 0x000000000000001d (RUNPATH)            Library runpath: [/usr/lib64/samba:/usr/lib64]
/usr/lib64/samba/libauth-samba4.so
 0x000000000000001d (RUNPATH)            Library runpath: [/usr/lib64/samba:/usr/lib64]
/usr/lib64/samba/libgse-samba4.so
 0x000000000000001d (RUNPATH)            Library runpath: [/usr/lib64/samba:/usr/lib64]
/usr/lib64/samba/libads-samba4.so
 0x000000000000001d (RUNPATH)            Library runpath: [/usr/lib64/samba:/usr/lib64]
/usr/lib64/samba/libgpext-samba4.so
 0x000000000000001d (RUNPATH)            Library runpath: [/usr/lib64/samba:/usr/lib64]
/usr/lib64/samba/ldb/ildap.so
 0x000000000000001d (RUNPATH)            Library runpath: [/usr/lib64/samba:/usr/lib64]
/usr/lib64/samba/libauth4-samba4.so
 0x000000000000001d (RUNPATH)            Library runpath: [/usr/lib64/samba:/usr/lib64]
/usr/lib64/samba/libsamba-net-samba4.so
 0x000000000000001d (RUNPATH)            Library runpath: [/usr/lib64/samba:/usr/lib64]
/usr/lib64/samba/libshares-samba4.so
 0x000000000000001d (RUNPATH)            Library runpath: [/usr/lib64/samba:/usr/lib64]
/usr/lib64/samba/libcli-ldap-samba4.so
 0x000000000000001d (RUNPATH)            Library runpath: [/usr/lib64/samba:/usr/lib64]
/usr/lib64/samba/libgensec-samba4.so
 0x000000000000001d (RUNPATH)            Library runpath: [/usr/lib64/samba:/usr/lib64]
Comment 4 Jeroen Roovers (RETIRED) gentoo-dev 2019-12-07 09:00:07 UTC
ldd is ancient and deprecated.
lddtree finds the libraries just fine.

What problem are you trying to solve?
Comment 5 Joakim Tjernlund 2019-12-07 14:19:47 UTC
It started with a sssd build problem in
 https://bugs.gentoo.org/692800
which I think is a samba problem rather than a sssd problem.
Have a look and see if you can make anything out of it
Comment 6 Joakim Tjernlund 2020-04-14 15:51:25 UTC
https://bugs.gentoo.org/692800 has some updates w.r.t samba, some deps missing
Comment 7 Joakim Tjernlund 2020-04-14 15:52:57 UTC
see  https://692800.bugs.gentoo.org/attachment.cgi?id=629606
Comment 8 razamatan 2020-05-25 11:26:22 UTC
(In reply to Joakim Tjernlund from comment #7)
> see  https://692800.bugs.gentoo.org/attachment.cgi?id=629606

just confirmed that this fixes the sssd idmap conftest in its configure stage fine as a user patch for samba.
Comment 9 razamatan 2020-05-25 11:52:24 UTC
Created attachment 641710 [details, diff]
user patch to remove all of my not found libs under /usr/lib64/samba

my user patch to remove all of my "not found" lib linking issues under /usr/lib64/samba.

not really sure how to make it generalized to other samba config option mixes.
Comment 10 Joakim Tjernlund 2020-06-12 12:52:26 UTC
(In reply to razamatan from comment #9)
> Created attachment 641710 [details, diff] [details, diff]
> user patch to remove all of my not found libs under /usr/lib64/samba
> 
> my user patch to remove all of my "not found" lib linking issues under
> /usr/lib64/samba.
> 
> not really sure how to make it generalized to other samba config option
> mixes.

I think you should report this upstream to Samba. It seems unlikely
that Gentoo Samba maintainers will adopt this locally.
Comment 11 Joakim Tjernlund 2020-06-17 09:08:48 UTC
(In reply to Alexander Tsoy from comment #2)
> Are you sure these libraries really needs RUNPATHs?

It is not about RUN_PATH really. A lib needs to link with all libs it
depends on. If one of its dependants libs is in /usr/lib64/samba it
will also get an RUN_PATH to that location.
Comment 12 razamatan 2021-03-01 07:12:52 UTC
FYI, i went to check things since it's been awhile, and compiling 4.12.9-r1 succeeds for me.
Comment 13 Joakim Tjernlund 2021-03-01 07:54:59 UTC
(In reply to razamatan from comment #12)
> FYI, i went to check things since it's been awhile, and compiling 4.12.9-r1
> succeeds for me.

Yes, it seems recent samba-4.12.x has silently fixed this problem.
  cd /use/lib64/samba
  for i in ./*.so ; do ldd "$i" | grep -q found && echo $i ; done

Above does not report anything.
Comment 14 Joakim Tjernlund 2021-03-01 08:18:33 UTC
I just noticed I carry this samba patch in /etc/portage/patches:
diff -ruN samba-4.11.8.orig/lib/util/wscript_build samba-4.11.8/lib/util/wscript_build                         [14/9084]
--- samba-4.11.8.orig/lib/util/wscript_build    2020-05-25 04:38:53.418458704 -0700
+++ samba-4.11.8/lib/util/wscript_build 2020-05-25 04:39:17.999365214 -0700
@@ -170,6 +170,6 @@

     bld.SAMBA_LIBRARY('samba-modules',
                       source='modules.c',
-                      deps='samba-errors samba-util',
+                      deps='samba-errors samba-util samba-debug',
                       local_include=False,
                       private_library=True)

diff -ruN samba-4.11.8.orig/nsswitch/wscript_build samba-4.11.8/nsswitch/wscript_build
--- samba-4.11.8.orig/nsswitch/wscript_build    2020-05-25 04:40:26.691104424 -0700
+++ samba-4.11.8/nsswitch/wscript_build 2020-05-25 04:40:41.912046715 -0700
@@ -108,7 +108,7 @@
 if bld.CONFIG_SET('HAVE_KRB5_LOCATE_PLUGIN_H'):
     bld.SAMBA_LIBRARY('winbind_krb5_locator',
                       source='krb5_plugin/winbind_krb5_locator.c',
-                      deps='wbclient krb5 com_err',
+                      deps='wbclient krb5 com_err replace',
                       realname='winbind_krb5_locator.so',
                       install_path='${MODULESDIR}/krb5')

diff -ruN samba-4.11.8.orig/source3/wscript_build samba-4.11.8/source3/wscript_build
--- samba-4.11.8.orig/source3/wscript_build     2020-05-25 04:35:20.930280265 -0700
+++ samba-4.11.8/source3/wscript_build  2020-05-25 04:36:19.294046850 -0700
@@ -267,7 +267,7 @@

 bld.SAMBA3_LIBRARY('popt_samba3',
                    source='lib/popt_common.c',
-                   deps='popt samba-util smbconf',
+                   deps='popt samba-util smbconf samba-debug',
                    private_library=True)

 bld.SAMBA3_LIBRARY('popt_samba3_cmdline',
@@ -508,7 +508,7 @@

 bld.SAMBA3_LIBRARY('smbldap',
                     source='lib/smbldap.c',
-                    deps='ldap lber samba-util smbconf',
+                    deps='ldap lber samba-util smbconf samba-debug replace smbd_shim samba-security',
                     enabled=bld.CONFIG_SET("HAVE_LDAP"),
                     private_library=False,
                     abi_directory='lib/ABI',


That is why I got no errors. Razamatan, you don't have any extra patches?
Comment 15 razamatan 2021-03-01 09:10:21 UTC
try deleting that patch (iirc, it's attached to this bug, so you can download it later), and then reinstall samba.  should work w/o the patch.  at least it did for me.
Comment 16 Joakim Tjernlund 2021-03-01 09:35:55 UTC
(In reply to razamatan from comment #15)
> try deleting that patch (iirc, it's attached to this bug, so you can
> download it later), and then reinstall samba.  should work w/o the patch. 
> at least it did for me.

Ok, just to make sure i removed that patch and now I still get the error:

ldd *.so | grep -i not
	libsmbd-shim-samba4.so => not found
	libsmbd-shim-samba4.so => not found
	libsamba-debug-samba4.so => not found
	libsamba-debug-samba4.so => not found
	libsmbd-shim-samba4.so => not found

Reopening
Comment 17 MeliaMarner 2021-08-16 03:49:14 UTC Comment hidden (spam)
Comment 18 Joakim Tjernlund 2022-04-17 14:34:56 UTC
I think samba 4.15 has fixed this, needs to be tested/confirmed though.
Comment 19 Joakim Tjernlund 2022-08-17 20:07:34 UTC
(In reply to Joakim Tjernlund from comment #18)
> I think samba 4.15 has fixed this, needs to be tested/confirmed though.

Works for me with samba 4.15.x, closing.