Bug 6366 - The size of the installed samba could be cut a lot by using shared objects
Summary: The size of the installed samba could be cut a lot by using shared objects
Status: NEW
Alias: None
Product: Samba 3.6
Classification: Unclassified
Component: Build environment (show other bugs)
Version: unspecified
Hardware: Other Linux
: P3 enhancement
Target Milestone: ---
Assignee: Samba Bugzilla Account
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-05-15 18:35 UTC by Roberto Coba
Modified: 2011-08-25 05:42 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Roberto Coba 2009-05-15 18:35:04 UTC
+++ This bug was initially created as a clone of Bug #5995 +++

Right now the same objects are duplicated in many targets, causing huge duplication of code, causing symbols collision, and requiring a huge time to bind the libraries at runtime.

For instance, my collision detection script [1] outputs this:

Symbol pdb_default_getgrgid@@ (32-bit UNIX System V ABI Intel 80386) present 20 times
  /usr/sbin/smbd
  /usr/bin/smbcacls
  /usr/bin/pdbedit
  /lib/security/pam_smbpass.so
  /usr/lib/samba/libsmbclient.so
  /usr/lib/samba/libmsrpc.so
  /usr/lib/python2.5/site-packages/samba/samr.so
  /usr/lib/python2.5/site-packages/samba/lsa.so
  /usr/bin/smbcquotas
  /usr/bin/smbpasswd
  /usr/lib/python2.5/site-packages/samba/srvsvc.so
  /usr/lib/python2.5/site-packages/samba/tdb.so
  /usr/bin/smbget
  /usr/bin/rpcclient
  /usr/lib/python2.5/site-packages/samba/smb.so
  /usr/lib/python2.5/site-packages/samba/winbind.so
  /usr/bin/net
  /usr/lib/python2.5/site-packages/samba/winreg.so
  /usr/bin/ntlm_auth
  /usr/lib/python2.5/site-packages/samba/spoolss.so

It means that there are 20 copies of the RPC objects. There are many, many more objects that have the same problem. It's especially bad for the Python extensions, but it's just as bad for the rest.

Having a single libsambacore.so library where all these symbols would be defined would reduce a lot the memory used (since it could then be shared among, say, the desktop system as a client and the smbd daemon as server), and would reduce the startup time of all the utilities.

[1] http://blog.flameeyes.eu/2008/12/24/library-on-a-collision-course-on-the-screen
Comment 1 Karolin Seeger 2010-01-25 05:39:13 UTC
Too late for enhancements in 3.5. Raising version.
Comment 2 Todd Richmond 2011-08-25 05:42:44 UTC
OpenWRT and other router builds of Samba have a hack to merge smbd and nmbd for just this reason because size is critical. They are stuck on 3.0.24 because that seems to be the last time anyone finished a port. I'm working on OpenWRT w/ 3.6 now, but it would be great to have this as an official change