Re: BUG #18833: libpq.so doesn't contain declared symbol in rpm --provides

From: Andreas Rogge <andreas(dot)rogge(at)bareos(dot)com>
To: pgsql-pkg-yum(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18833: libpq.so doesn't contain declared symbol in rpm --provides
Date: 2025-03-11 17:25:18
Message-ID: fee4ea5b-6bfe-4d03-9c2f-8b2d7431ec9d@bareos.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs 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(dot)rogge(at)bareos(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Andreas Rogge 2025-03-11 17:36:42 Re: BUG #18833: libpq.so doesn't contain declared symbol in rpm --provides
Previous Message Tom Lane 2025-03-11 17:14:31 Re: Attribute of type record has wrong type error with MERGE ... WHEN NOT MATCHED BY SOURCE THEN DELETE

Browse pgsql-pkg-yum by date

  From Date Subject
Next Message Andreas Rogge 2025-03-11 17:36:42 Re: BUG #18833: libpq.so doesn't contain declared symbol in rpm --provides
Previous Message Laurenz Albe 2025-03-11 12:44:55 Re: BUG #18833: libpq.so doesn't contain declared symbol in rpm --provides