Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gJ1hh-0006VG-6i for pgsql-hackers@arkaria.postgresql.org; Sat, 03 Nov 2018 19:35:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gJ1hf-0006Xf-4g for pgsql-hackers@arkaria.postgresql.org; Sat, 03 Nov 2018 19:35:27 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gJ1he-0006AO-P1 for pgsql-hackers@lists.postgresql.org; Sat, 03 Nov 2018 19:35:26 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gJ1hc-00063W-8x for pgsql-hackers@postgresql.org; Sat, 03 Nov 2018 19:35:25 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id wA3JZKvw023333; Sat, 3 Nov 2018 15:35:20 -0400 From: Tom Lane To: Andres Freund cc: Pavel Raiskup , PostgreSQL Hacker , devrim@gunduz.org Subject: Re: plruby: rb_iterate symbol clash with libruby.so In-reply-to: <20181103184259.w5g2quh7fevuny23@alap3.anarazel.de> References: <4738198.8KVIIDhgEB@nb.usersys.redhat.com> <20461.1541269186@sss.pgh.pa.us> <20181103183040.jj7gp2zszusnea2d@alap3.anarazel.de> <21251.1541270385@sss.pgh.pa.us> <20181103184259.w5g2quh7fevuny23@alap3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Sat, 03 Nov 2018 11:42:59 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <23331.1541273720.1@sss.pgh.pa.us> Date: Sat, 03 Nov 2018 15:35:20 -0400 Message-ID: <23332.1541273720@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Andres Freund writes: > On 2018-11-03 14:39:45 -0400, Tom Lane wrote: >> Andres Freund writes: >>> ISTM this specific case we could solve the issue by opening plruby.so / >>> extension sos with RTLD_DEEPBIND. That doesn't work if ruby extensions >>> that are loaded later use rb_iterate, but should work for the case above. >> Doesn't work on non-glibc platforms, though. > Yea, but I'm not sure there's anything portable to do about such cases :/ The portable answer is to rename to avoid the symbol conflict. >>> I don't mind the precedent that much, but isn't that also not unlikely >>> to break other extensions that use those functions? >> I rather doubt there are any. Also, if there are, the RTLD_DEEPBIND >> solution would break them too, no? > Why would it break? Deepbind just means the to-be-opened .so is put > first in the search path, if there's no match it'll still look in other > sos. Yeah, but once plruby is loaded, any subsequently loaded .so has got two possible ways to resolve rb_iterate. No matter what we do, the behavior will be wrong for some of them. regards, tom lane