SHARED MODULES BROKEN pdb: Increase version number to fix ABI

Alexander Bokovoy ab at samba.org
Thu Dec 11 13:28:12 MST 2014


On Thu, Dec 11, 2014 at 8:25 PM, Andrew Bartlett <abartlet at samba.org> wrote:
> On Thu, 2014-12-11 at 13:18 +0200, Alexander Bokovoy wrote:
>
>> NACK to Garming's patch. The problem with it is that it doesn't solve
>> the problem, it only makes it worse.
>
> How so?
Somehow I used wrong patch, my apologies. :(
With the patch that changes to grouping library I'm getting the same
output as with my patch:
       bin/default/examples/pdb/libpdb-test.so                    U
smb_register_passdb@@SAMBA_PASSDB_0.2.0
             bin/default/examples/pdb/test_1.o                    U
smb_register_passdb
   bin/default/source3/passdb/libpdb-tdbsam.so                    U
smb_register_passdb@@SAMBA_PASSDB_0.2.0
        bin/default/source3/passdb/pdb_tdb_1.o                    U
smb_register_passdb
 bin/default/source3/passdb/pdb_samba_dsdb_9.o                    U
smb_register_passdb
        bin/default/source3/passdb/pdb_nds_3.o                    U
smb_register_passdb
    bin/default/source3/passdb/pdb_wbc_sam_7.o                    U
smb_register_passdb
       bin/default/source3/passdb/pdb_ldap_3.o                    U
smb_register_passdb
  bin/default/source3/passdb/libpdb-wbc-sam.so                    U
smb_register_passdb@@SAMBA_PASSDB_0.2.0
bin/default/source3/passdb/libpdb-smbpasswd.so                    U
smb_register_passdb@@SAMBA_PASSDB_0.2.0
  bin/default/source3/passdb/libpdb-ldapsam.so                    U
smb_register_passdb@@SAMBA_PASSDB_0.2.0
 bin/default/source3/passdb/pdb_interface_28.o   000000000000001f T
smb_register_passdb
  bin/default/source3/passdb/pdb_smbpasswd_5.o                    U
smb_register_passdb
        bin/default/source3/passdb/pdb_ipa_3.o                    U
smb_register_passdb
        bin/default/source3/libsamba-passdb.so   0000000000028c8c T
smb_register_passdb
                       bin/modules/pdb/test.so                    U
smb_register_passdb@@SAMBA_PASSDB_0.2.0
                    bin/modules/pdb/ldapsam.so                    U
smb_register_passdb@@SAMBA_PASSDB_0.2.0
                     bin/modules/pdb/tdbsam.so                    U
smb_register_passdb@@SAMBA_PASSDB_0.2.0
                  bin/modules/pdb/smbpasswd.so                    U
smb_register_passdb@@SAMBA_PASSDB_0.2.0
                    bin/modules/pdb/wbc_sam.so                    U
smb_register_passdb@@SAMBA_PASSDB_0.2.0

>> When you turn pdb into a grouping subsystem instead of linking
>> everything against a proper dynamic library, you get 'backends' static
>> variable duplicated multiple times in each compilation unit that
>> references it. Unfortunately, nothing will help you here to check that
>> there are duplicates of 'backends' variable because it is static. We
>> also have some subsystems that depend on 'pdb' subsystem and they then
>> get loaded into the same process.
>
> Given that is the very definition of a grouping library, I'm concerned,
> because that implies we need to look back at grouping libraries and work
> out why they are not doing that.
No, it is working, I was looking at a wrong patch. It would still be
better to unify subsystem/library name.

>> As you can see, there are 24 shared modules where smb_register_passdb
>> function is defined which means there are 24 places with 'backends'
>> static linked list. This is calling for a disaster.
>
> Indeed, and we saw that (looking at the behaviour, thanks for the nm
> commands).  What did you get with the patch on this thread BTW?
Lost it (or rather lost myself in number of parallel discussions).

>> As you can see, there is one place where the unit with
>> smb_register_passdb is defined (pdb_interface_28.o) and it is linked
>> into libsamba-passdb.so which is then used by all other code.
>
> Does your approach change the on-disk layout or affect the runtime init
> code?  I would have loved to just do the global rename - and if we do,
> please drop the 'pdb' subsystem entirely - but when I first looked into
> this back at the time the original bug was filed, it seemed that the
> "subsystem" argument was being used for more than just linking rules.
No, on-disk layout doesn't change with regards to the code use between
the last Garming's patch and mine.

It just that everything should come back to the same subsystem in the
end due to need to have static modules initializers linked to the
linking object pdb_interface_*.o in order to have the compiled-in
modules working in the first place. To do so we either rename
everything to a single subsystem or make a grouping subsystem folded
into the shared library subsystem.

> Perhaps some of that is easier now we just have waf, or doesn't actually
> matter?
Having a single subsystem is clearer from the point of view of
analyzing things next time something is unclear.

-- 
/ Alexander Bokovoy


More information about the samba-technical mailing list