Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 602952 - app-backup/bacula-7.4.3: revdep-rebuild wants to rebuilt it, revdep-rebuild.sh does not
Summary: app-backup/bacula-7.4.3: revdep-rebuild wants to rebuilt it, revdep-rebuild.s...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Tools (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Thomas Beierlein
URL:
Whiteboard:
Keywords:
: 606682 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-12-17 19:31 UTC by Torsten Kaiser
Modified: 2017-01-25 16:47 UTC (History)
5 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Torsten Kaiser 2016-12-17 19:31:43 UTC
The last upgrade of gentoolkit switched to the new python revdep-rebuild.

When running it, it wants zu rebuild bacula, but I can't seen anything wrong with hat package. Running the old revdep-rebuild.sh does not show any problems and rebuilding bacula does not fix the problem the new revdep-rebuild is seeing.

Output:
ariolc-ex ~ # revdep-rebuild -i -p
 * This is the new python coded version
 * Please report any bugs found using it.
 * The original revdep-rebuild script is installed as revdep-rebuild.sh
 * Please file bugs at: https://bugs.gentoo.org/
 * Collecting system binaries and libraries
 * Checking dynamic linking consistency
 * Assign files to packages

emerge  --pretend --oneshot --complete-graph=y app-backup/bacula:0

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] app-backup/bacula-7.4.3 


Running with the -d flag shows these messages:
        LibCheck.search(); FOUND: 64bit, libbaccats-7.4.3.so, /usr/sbin/bacula-dir
        LibCheck.search(); FOUND: 64bit, libbaccats-7.4.3.so, /usr/sbin/dbcheck
        LibCheck.search(); FOUND: 64bit, libbaccats-7.4.3.so, /usr/sbin/bscan

... but it is not explaining, what it thinks is wrong with this lib.



If yout want me to re-run revdep-rebuild with any special flags: Please just ask, I will try to provide any info you need.
Comment 1 Thomas Beutin 2016-12-19 20:03:31 UTC
(In reply to Torsten Kaiser from comment #0)
[...]
> If yout want me to re-run revdep-rebuild with any special flags: Please just
> ask, I will try to provide any info you need.

i'm also listening to dev requests coz i've exact the same issue here
Comment 2 Carsten Böcker 2016-12-20 10:57:36 UTC
same here, revdep-rebuild with debug output:

!!! Repository 'x-portage' is missing masters attribute in '/usr/local/portage/metadata/layout.conf'
!!! Set 'masters = gentoo' in this file for future compatibility
 * This is the new python coded version
 * Please report any bugs found using it.
 * The original revdep-rebuild script is installed as revdep-rebuild.sh
 * Please file bugs at: https://bugs.gentoo.org/
        main(), _libs_to_check = set()
        all_masks:

                /lib/modules
                /lib32/modules
                /lib64/modules
                /opt/icedtea-bin-3.2.0
                /opt/icedtea-bin-7.2.6.8
                libjava.so
                libjawt.so
                libjvm.so
                libodbc.so
                libodbcinst.so
 * Collecting system binaries and libraries
        analyse(), bin directories:
                /bin
                /lib
                /lib32
                /lib64
                /opt/bin
                /opt/blackdown-jdk-1.4.2.03/bin
                /opt/blackdown-jdk-1.4.2.03/jre/bin
                /sbin
                /usr/bin
                /usr/lib
                /usr/lib32
                /usr/lib64
                /usr/libexec
                /usr/sbin
                /usr/x86_64-pc-linux-gnu/gcc-bin/4.9.4
        analyse(), lib directories:
                /bin
                /lib
                /lib32
                /lib64
                /opt/blackdown-jdk-1.4.2.03/jre/lib/amd64/
                /opt/blackdown-jdk-1.4.2.03/jre/lib/amd64/classic/
                /opt/blackdown-jdk-1.4.2.03/jre/lib/amd64/native_threads/
                /opt/blackdown-jdk-1.4.2.03/jre/lib/amd64/server/
                /sbin
                /usr/bin
                /usr/lib
                /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3
                /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/32
                /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.4
                /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.4/32
                /usr/lib32
                /usr/lib64
                /usr/lib64/fltk
                /usr/lib64/qt4
                /usr/libexec
                /usr/local/lib
                /usr/local/lib32
                /usr/local/lib64
                /usr/sbin
        analyse(), masked directories:
                /lib/modules
                /lib32/modules
                /lib64/modules
                /opt/icedtea-bin-3.2.0
                /opt/icedtea-bin-7.2.6.8
        analyse(), masked files:

                libjava.so
                libjawt.so
                libjvm.so
                libodbc.so
                libodbcinst.so
        time to complete task: 4 milliseconds
 * Collecting dynamic linking informations
        Exception collecting libraries: [Errno 2] No such file or directory: '/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/32'
        Exception collecting libraries: [Errno 2] No such file or directory: '/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3'
        Exception collecting libraries: [Errno 2] No such file or directory: '/opt/blackdown-jdk-1.4.2.03/jre/lib/amd64/native_threads/'
        Exception collecting libraries: [Errno 2] No such file or directory: '/opt/blackdown-jdk-1.4.2.03/jre/lib/amd64/server/'
        Exception collecting libraries: [Errno 2] No such file or directory: '/opt/blackdown-jdk-1.4.2.03/jre/lib/amd64/'
        Exception collecting libraries: [Errno 2] No such file or directory: '/opt/blackdown-jdk-1.4.2.03/jre/lib/amd64/classic/'
        Exception during binaries collecting: [Errno 2] No such file or directory: '/opt/blackdown-jdk-1.4.2.03/jre/bin'
        Exception during binaries collecting: [Errno 2] No such file or directory: '/opt/bin'
        Exception during binaries collecting: [Errno 2] No such file or directory: '/opt/blackdown-jdk-1.4.2.03/bin'
        time to complete task: 7342 milliseconds
        analyse(), Found 18548 libraries (+5427 symlinks) and 18556 binaries
 * Scanning files
        scan(), scanelf params = ['-BF', '%F;%f;%S;%n;%M'], # files: 18969
        scan(), final output length: 16061
        scan_files(); total time to get scanelf data is 557 milliseconds
        scan_files(); total filenames found: 9662 in 967 milliseconds
 * Checking dynamic linking consistency
        analyse(), Searching for 18969 libs, bins within 23975 libraries and links
        LibCheck.__init__(), new searchlibs: ['32', '64']
        LibCheck.search(), Checking for broken 32 bit libs
        LibCheck.search(), Checking for broken 64 bit libs
        LibCheck.search(); FOUND: 64bit, libbaccats-7.4.3.so, /usr/sbin/bacula-dir
        LibCheck.search(); FOUND: 64bit, libbaccats-7.4.3.so, /usr/sbin/bscan
        LibCheck.search(); FOUND: 64bit, libbaccats-7.4.3.so, /usr/sbin/dbcheck
        Library libjawt.so ignored as it is masked
        LibCheck.search(); Total found: 1 libs, 3 files in 2746 milliseconds
 * Broken files that requires: libbaccats-7.4.3.so (64 bits)
        * /usr/sbin/bacula-dir
        * /usr/sbin/bscan
        * /usr/sbin/dbcheck
        LibCheck.process_results(); total filepaths found: 3 in 0 milliseconds
 * Assign files to packages
        * /usr/sbin/bscan -> app-backup/bacula-7.4.3
        * /usr/sbin/bacula-dir -> app-backup/bacula-7.4.3
        * /usr/sbin/dbcheck -> app-backup/bacula-7.4.3
        assign_packages(); assigned 1 packages, 0 orphans in 1346 milliseconds

emerge  --pretend --verbose --oneshot --complete-graph=y app-backup/bacula:0
!!! Repository 'x-portage' is missing masters attribute in '/usr/local/portage/metadata/layout.conf'
!!! Set 'masters = gentoo' in this file for future compatibility

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] app-backup/bacula-7.4.3::gentoo  USE="acl ipv6 mysql qt4 readline ssl tcpd vim-syntax -X -bacula-clientonly -bacula-nodir -bacula-nosd -examples (-libressl) -logwatch -postgres -sqlite -static" 0 KiB

Total: 1 package (1 reinstall), Size of downloads: 0 KiB
        rebuild(); emerge call for 1 ebuilds took: 54.385 seconds
rebuild return code = 0

and equery tells that 
/usr/lib64/libbaccats-7.4.3.so
belongs to bacula
equery belongs /usr/lib64/libbaccats-7.4.3.so
 * Searching for /usr/lib64/libbaccats-7.4.3.so ... 
app-backup/bacula-7.4.3 (/usr/lib64/libbaccats-7.4.3.so -> libbaccats-mysql.so)
app-backup/bacula-7.4.3 (/usr/lib64/libbaccats-mysql-7.4.3.so)
Comment 3 Tomasz Bielaszewski 2016-12-22 12:42:59 UTC
same here, revdep-rebuild with debug output and lddtree of file marked as broken (includes linking of libbaccats-7.4.3.so, which is marked as source of problem):

# revdep-rebuild -i -p -v -d
 * This is the new python coded version
 * Please report any bugs found using it.
 * The original revdep-rebuild script is installed as revdep-rebuild.sh
 * Please file bugs at: https://bugs.gentoo.org/
        main(), _libs_to_check = set([])
        all_masks:

                /lib/modules
                /lib32/modules
                /lib64/modules
                libjava.so
                libjvm.so
                libodbc.so
                libodbcinst.so
 * Collecting system binaries and libraries
        analyse(), bin directories:
                /bin
                /lib
                /lib32
                /lib64
                /opt/bin
                /sbin
                /usr/bin
                /usr/lib
                /usr/lib32
                /usr/lib64
                /usr/libexec
                /usr/sbin
                /usr/x86_64-pc-linux-gnu/gcc-bin/4.9.4
        analyse(), lib directories:
                /bin
                /lib
                /lib32
                /lib64
                /sbin
                /usr/bin
                /usr/lib
                /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3
                /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/32
                /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.4
                /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.4/32
                /usr/lib/postgresql
                /usr/lib32
                /usr/lib64
                /usr/lib64/postgresql
                /usr/lib64/postgresql-9.4/lib64/
                /usr/lib64/postgresql-9.5/lib64/
                /usr/libexec
                /usr/local/lib
                /usr/local/lib32
                /usr/local/lib64
                /usr/sbin
        analyse(), masked directories:
                /lib/modules
                /lib32/modules
                /lib64/modules
        analyse(), masked files:

                libjava.so
                libjvm.so
                libodbc.so
                libodbcinst.so
        time to complete task: 8 milliseconds
 * Collecting dynamic linking informations
        Exception collecting libraries: [Errno 2] No such file or directory: '/usr/local/lib32'
        Exception during binaries collecting: [Errno 2] No such file or directory: '/opt/bin'
        time to complete task: 4312 milliseconds
        analyse(), Found 5776 libraries (+1041 symlinks) and 5334 binaries
 * Scanning files
        scan(), scanelf params = ['-BF', '%F;%f;%S;%n;%M'], # files: 5799
        scan(), final output length: 4070
        scan_files(); total time to get scanelf data is 3088 milliseconds
        scan_files(); total filenames found: 2561 in 358 milliseconds
 * Checking dynamic linking consistency
        analyse(), Searching for 5799 libs, bins within 6817 libraries and links
        LibCheck.__init__(), new searchlibs: ['32', '64']
        LibCheck.search(), Checking for broken 32 bit libs
        LibCheck.search(), Checking for broken 64 bit libs
        LibCheck.search(); FOUND: 64bit, libbaccats-7.4.3.so, /usr/sbin/bacula-dir
        LibCheck.search(); FOUND: 64bit, libbaccats-7.4.3.so, /usr/sbin/bscan
        LibCheck.search(); FOUND: 64bit, libbaccats-7.4.3.so, /usr/sbin/dbcheck
        LibCheck.search(); Total found: 1 libs, 3 files in 91 milliseconds
 * Broken files that requires: libbaccats-7.4.3.so (64 bits)
        * /usr/sbin/bacula-dir
        * /usr/sbin/bscan
        * /usr/sbin/dbcheck
        LibCheck.process_results(); total filepaths found: 3 in 1 milliseconds
 * Assign files to packages
        * /usr/sbin/dbcheck -> app-backup/bacula-7.4.3
        * /usr/sbin/bscan -> app-backup/bacula-7.4.3
        * /usr/sbin/bacula-dir -> app-backup/bacula-7.4.3
        assign_packages(); assigned 1 packages, 0 orphans in 1230 milliseconds

emerge  --pretend --verbose --oneshot --complete-graph=y app-backup/bacula:0

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] app-backup/bacula-7.4.3::gentoo  USE="acl postgres readline ssl vim-syntax -X -bacula-clientonly -bacula-nodir -bacula-nosd -examples -ipv6 (-libressl) -logwatch -mysql -qt4 -sqlite -static -tcpd" 0 KiB

Total: 1 package (1 reinstall), Size of downloads: 0 KiB

 * IMPORTANT: 1 news items need reading for repository 'gentoo'.
 * Use eselect news read to view new items.

        rebuild(); emerge call for 1 ebuilds took: 9.519 seconds
rebuild return code = 0


# lddtree /usr/sbin/bscan
bscan => /usr/sbin/bscan (interpreter => /lib64/ld-linux-x86-64.so.2)
    libbacsql-7.4.3.so => /usr/lib64/libbacsql-7.4.3.so
    libbaccats-7.4.3.so => /usr/lib64/libbaccats-7.4.3.so
        libpq.so.5 => /usr/lib64/postgresql-9.4/lib64/libpq.so.5
            libssl.so.1.0.0 => /usr/lib64/libssl.so.1.0.0
            libcrypto.so.1.0.0 => /usr/lib64/libcrypto.so.1.0.0
                libdl.so.2 => /lib64/libdl.so.2
                    ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2
                libz.so.1 => /lib64/libz.so.1
    libbacfind-7.4.3.so => /usr/lib64/libbacfind-7.4.3.so
    libbaccfg-7.4.3.so => /usr/lib64/libbaccfg-7.4.3.so
    libbac-7.4.3.so => /usr/lib64/libbac-7.4.3.so
        libcap.so.2 => /lib64/libcap.so.2
            libattr.so.1 => /lib64/libattr.so.1
        libm.so.6 => /lib64/libm.so.6
    libpthread.so.0 => /lib64/libpthread.so.0
    libstdc++.so.6 => /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.4/libstdc++.so.6
        libgcc_s.so.1 => /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.4/libgcc_s.so.1
    libc.so.6 => /lib64/libc.so.6
Comment 4 Brian Dolbec (RETIRED) gentoo-dev 2016-12-22 15:53:52 UTC
The python version uses scanelf instead of ldd to search for broken libs.

I'm also certain bacula has come up before, I think it was for the masks not being honored bug.  I thought there was a solution for that pkg.  But I am sucking at finding it/bugzilla searches  this morning.
Comment 5 Torsten Kaiser 2016-12-22 17:22:53 UTC
The debug log shows the parameters for the scanelf call and after calling that directly I think, I found what angers the new revdep-rebuild:

ariolc ~ # scanelf --soname /usr/lib64/libbaccats-7.4.3.so 
 TYPE   SONAME FILE 
ET_DYN libbaccats-sqlite3-7.4.3.so /usr/lib64/libbaccats-7.4.3.so 

The SONAME of the "broken" library does not seem to fit to its actual filename.

ariolc ~ # cd /usr/lib64/
ariolc lib64 # ls -l libbaccat*
lrwxrwxrwx 1 root root    21 Dec 17 17:38 libbaccats-7.4.3.so -> libbaccats-sqlite3.so
-rw-r--r-- 1 root root   954 Dec 17 17:38 libbaccats.la
lrwxrwxrwx 1 root root    19 Dec 17 17:38 libbaccats.so -> libbaccats-7.4.3.so
-rwxr-xr-x 1 root root 26984 Dec 17 17:38 libbaccats-sqlite3-7.4.3.so
-rw-r--r-- 1 root root  1025 Dec 17 17:38 libbaccats-sqlite3.la
lrwxrwxrwx 1 root root    27 Dec 17 17:38 libbaccats-sqlite3.so -> libbaccats-sqlite3-7.4.3.so

Oh: That "lib" is just a symlink to libbaccats-sqlite3, so its obvious that its SONAME will be returned...
Comment 6 Brian Dolbec (RETIRED) gentoo-dev 2016-12-22 18:28:26 UTC
hmm, your output seems to indicate it is not only a symlink, but it's target is also a symlink to the real lib.  So it is a double link traversal it needs to do.
At any rate, that seems to a poor way of doing things.

It's been awhile since I looked at that code, I thought it did process the symlink, maybe it's the dbl symlink that's screwing it up.

Thank you for trouble-shooting this.  My brain was not fully awake yet this morning for my earlier comment.
Comment 7 Brian Dolbec (RETIRED) gentoo-dev 2016-12-22 18:38:50 UTC
Holy shit, it's worse than that...

piecing together your lib listings...

      libbaccats.so -> libbaccats-7.4.3.so ->  libbaccats-sqlite3.so ->  libbaccats-sqlite3-7.4.3.so


I wonder if you re-made all those symlinks to point to the same final target instead of being daisychained like that if it wouldn't fix the problem.
Comment 8 Torsten Kaiser 2016-12-22 19:28:06 UTC
I did not play with these symlinks, portage installed them all. ;-P

But I think all of this mess is intentional.
Two of the symlinks are the normal unversioned lib pointing to the versioned version. Additional bacula also links libbaccats.so an libbaccats-sqlite.so, but because its linking the versioned generic lib to the unversioned db specific lib it creates this weird 4 level deep link maze.

I think the core problem is, that bacula can't decide between an generic db abstract level and an db specific build. On one hand bscan and the other tools only link against a generic libbaccats.so, but on the other hand only one db backend can be selected at build time to there only ever is a single libbaccats-sqlite3.so or libbaccats-mysql.so or libbaccats-pgsql.so. And this static selection of the db backend then gets codified by the symlink.

Ubuntu seems to have hit something similar:
https://bugs.launchpad.net/ubuntu/+source/bacula/+bug/929523

That is against a much oder bacula version (5.2.3) and that bug is from 2012.
And its a completely different tool (dh_shlibdeps) that fails.

But I believe the core problem is the same: The bacula tools use the generic name for linking, this name gets checked, but as its just a symlink any tool that looks at this lib will get the SONAME of the linked-to lib and that does not match the "requested" lib.

Ubuntu seems to have fixed it that they put the generic SONAME libbaccats.so into each of the db backend libs. I'm not sure if that is the best way, but on the surface it looks like a simple fix.

Ubuntu had to modify their ltmain.sh to specify the soname, but that was a much older bacula version:
http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/precise/bacula/precise/revision/77/autoconf/ltmain.sh#autoconf/ltmain.sh

The real soname switch:
http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/precise/bacula/precise/revision/77/src/cats/Makefile.in#src/cats/Makefile.in
... maybe you can borrow something from there.

The full change is rather bad to read, because they mixed a bacula version bump into this soname fix. :-(
http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/precise/bacula/precise/revision/77
Comment 9 Zac Medico gentoo-dev 2016-12-22 21:34:42 UTC
(In reply to Torsten Kaiser from comment #8)
> Ubuntu seems to have fixed it that they put the generic SONAME libbaccats.so
> into each of the db backend libs. I'm not sure if that is the best way, but
> on the surface it looks like a simple fix.

I think that seems pretty reasonable, because it's definitely not normal to rely on a symlink to resolve an soname.

@tomjbe, what do you think?
Comment 10 Thomas Beierlein gentoo-dev 2016-12-23 12:34:11 UTC
(In reply to Zac Medico from comment #9)
> (In reply to Torsten Kaiser from comment #8)
> > Ubuntu seems to have fixed it that they put the generic SONAME libbaccats.so
> > into each of the db backend libs. I'm not sure if that is the best way, but
> > on the surface it looks like a simple fix.
> 
> I think that seems pretty reasonable, because it's definitely not normal to
> rely on a symlink to resolve an soname.
> 
> @tomjbe, what do you think?

It seems the best solution. I will look into it (but I am not quite sure if I will finish before the guests are coming in.)
Comment 11 Thomas Beierlein gentoo-dev 2016-12-24 12:30:04 UTC
(In reply to Thomas Beierlein from comment #10)
> (In reply to Zac Medico from comment #9)
> > (In reply to Torsten Kaiser from comment #8)
> > > Ubuntu seems to have fixed it that they put the generic SONAME libbaccats.so
> > > into each of the db backend libs. I'm not sure if that is the best way, but
> > > on the surface it looks like a simple fix.
> > 
> > I think that seems pretty reasonable, because it's definitely not normal to
> > rely on a symlink to resolve an soname.
> > 
> > @tomjbe, what do you think?
> 
> It seems the best solution. I will look into it (but I am not quite sure if
> I will finish before the guests are coming in.)

After some digging in baculas source and git history I saw, that the mentioned changes got picked up by baculas git directory already in 2013. But an update of the ltmain.sh in 2014 dropped the feature again. Weird.

I will prepare a patch shortly and report upstream.
Comment 12 Thomas Beierlein gentoo-dev 2016-12-24 13:09:37 UTC
> I will prepare a patch shortly and report upstream.

Should be fixed in bacula-7.4.3-r1 and bacula-7.4.4-r2. 

bacula-5.2.13-r5 is not affected and bacula-7.0.5-rx are old and should go away after new ones get stable.

Please test and report back. Thanks.
Comment 13 Carsten Böcker 2016-12-24 15:30:18 UTC
tested and no more rebuild here

Thanks
Comment 14 Thomas Beierlein gentoo-dev 2016-12-25 08:00:38 UTC
(In reply to Carsten Böcker from comment #13)
> tested and no more rebuild here
> 
> Thanks

So I am closing the bug. Thanks for reporting.
Comment 15 Thomas Beierlein gentoo-dev 2017-01-25 16:47:09 UTC
*** Bug 606682 has been marked as a duplicate of this bug. ***