Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lyHKk-0000a4-BN for pgsql-hackers@arkaria.postgresql.org; Tue, 29 Jun 2021 17:15:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lyHKj-00083u-Am for pgsql-hackers@arkaria.postgresql.org; Tue, 29 Jun 2021 17:15:37 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lyHKj-00083m-3F for pgsql-hackers@lists.postgresql.org; Tue, 29 Jun 2021 17:15:37 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lyHKh-0001hk-7j for pgsql-hackers@postgresql.org; Tue, 29 Jun 2021 17:15:36 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 15THFUMf451279; Tue, 29 Jun 2021 13:15:30 -0400 From: Tom Lane To: Michael Paquier cc: Jacob Champion , "pgsql-hackers@postgresql.org" , Daniel Gustafsson Subject: Re: Preventing abort() and exit() calls in libpq In-reply-to: <340320.1624912475@sss.pgh.pa.us> References: <3128896.1624742969@sss.pgh.pa.us> <340320.1624912475@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Mon, 28 Jun 2021 16:34:35 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <451277.1624986930.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 29 Jun 2021 13:15:30 -0400 Message-ID: <451278.1624986930@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk I wrote: >> This relies on "nm" being able to work on shlibs, which it's not >> required to by POSIX. However, it seems to behave as desired even >> on my oldest dinosaurs. In any case, if "nm" doesn't work then >> we'll just not detect such problems on that platform, which should >> be OK as long as the test does work on common platforms. So I pushed that, and not very surprisingly, it's run into some portability problems. gombessa (recent OpenBSD) reports ! nm -A -g -u libpq.so.5.15 2>/dev/null | grep -v '_eprintf\\.o:' | grep -= e abort -e exit libpq.so.5.15:__cxa_atexit So far as I can find, __cxa_atexit is a C++ support routine, so I wondered what the heck libpq.so is doing calling it. I managed to reproduce the failure here using an OpenBSD installation I had at hand, and confirmed that __cxa_atexit is *not* referenced by any of the .o files in src/port, src/common, or src/interfaces/libpq. So apparently it's being injected at some fairly low level of the shlib support on that platform. Probably the thing to do is adjust the grep filter to exclude __cxa_atexit, but I want to wait awhile and see whether any other buildfarm animals report this. morepork at least will be pretty interesting, since it's a slightly older OpenBSD vintage. regards, tom lane