Re: BUG #18833: libpq.so doesn't contain declared symbol in rpm --provides - Mailing list pgsql-pkg-yum

From Andreas Rogge
Subject Re: BUG #18833: libpq.so doesn't contain declared symbol in rpm --provides
Date
Msg-id fee4ea5b-6bfe-4d03-9c2f-8b2d7431ec9d@bareos.com
Whole thread Raw
In response to Re: BUG #18833: libpq.so doesn't contain declared symbol in rpm --provides  (Christoph Berg <myon@debian.org>)
List pgsql-pkg-yum
Am 11.03.25 um 11:13 schrieb Christoph Berg:
> Is this only hitting Bareos and not every other application
> distributed by RH itself? If so, why?

That depends on what you call "hitting".
As far as I can tell the warning messsage
"/lib64/libpq.so.5: no version information available (required by ...)"
is emitted by ld.so for everything that was linked at build-time to 
redhat's version of libpq and then run with pgdg's libpq5.

In in a fresh rhel9 ubi container you can do the following:

# dnf install rhel-9-x86_64/pgdg-redhat-repo-42.0-46PGDG.noarch.rpm
# dnf install libpq5
# dnf install postfix-pgsql
# ldd /usr/lib64/postfix/postfix-pgsql.so
(here you'll see the message)

It seems like you will not see the warning message in postfix, because 
postfix-pgsql.so is loaded using dlopen(). When dynamic linking occurs 
during dlopen() ld.so will not write a message to stderr, of course.

It looks like most (if not all) of the things in the rhel repos that 
link to libpq are plugins that will be loaded with dlopen(). At least I 
couldn't quickly find any program that directly links to libpq.

Nevertheless, the problem Bareos hits can be reproduced easily:
1. set up a rhel9 system without PGDG
2. install compiler + libpq-devel
3. build "libpq Example Program 1" [1] and link with RH's libpq
4. move resulting program to a system with libpq5 from PGDG and run it

When libpq is dynamically linked during initial program setup by ld.so, 
you will see the warning message.

Best Regards,
Andreas

[1] https://www.postgresql.org/docs/current/libpq-example.html
-- 
Andreas Rogge                             andreas.rogge@bareos.com
   Bareos GmbH & Co. KG                      Phone: +49 221-630693-86
   http://www.bareos.com

   Sitz der Gesellschaft: Köln | Amtsgericht Köln: HRA 29646
   Komplementär: Bareos Verwaltungs-GmbH
   Geschäftsführer: Stephan Dühr, Jörg Steffens, Philipp Storz




pgsql-pkg-yum by date:

Previous
From: Laurenz Albe
Date:
Subject: Re: BUG #18833: libpq.so doesn't contain declared symbol in rpm --provides
Next
From: Andreas Rogge
Date:
Subject: Re: BUG #18833: libpq.so doesn't contain declared symbol in rpm --provides