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 1o0qZ5-0005OW-OY for pgsql-hackers@arkaria.postgresql.org; Mon, 13 Jun 2022 20:21:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1o0qZ4-0000uG-9J for pgsql-hackers@arkaria.postgresql.org; Mon, 13 Jun 2022 20:21:34 +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 1o0qZ3-0000u7-6h for pgsql-hackers@lists.postgresql.org; Mon, 13 Jun 2022 20:21:33 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o0qYx-0004su-9n for pgsql-hackers@postgresql.org; Mon, 13 Jun 2022 20:21:32 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id AB2215C0084; Mon, 13 Jun 2022 16:21:22 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Mon, 13 Jun 2022 16:21:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1655151682; x= 1655238082; bh=gr0GeSGvZKDWuV4fJo9mOsfDzKvJQ6K5enuswc62ceI=; b=M wJLH/DPNkq6QPoJOqX7Ye6nJAEqObKefHoDUt3kxB3TV/UmGvOv2K23uQXUR5j9m VeCtMAyVcHXFlP+oIdwjG6J23d3VZwRdd2ljiShxldmeDi8M1eIl7ErbxsK3rCES 1Lux5XJ2qOxEmPsM/kdX1MACIZ4cvejIV5/ifPXSbXgeILqnHHWtFb7GqEEVs7JE pnNRah06RjQ3PytTPEJqpLXTKHhRS2evHK8P/hCxrF9L0dGF1azstpS5KQpeKASx 4gQiRIkI2GavedLlTzKUK6dYe00W/k8IloPVTpLolcQ29XoX0eLYl5KnrJiz8Rnc DveBvCl4FSw6e5ngpHIOw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedruddujedgudeghecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefkffggfgfuvfevfhfhjggtgfesthekredttdefjeenucfhrhhomheprfgv thgvrhcugfhishgvnhhtrhgruhhtuceophgvthgvrhdrvghishgvnhhtrhgruhhtsegvnh htvghrphhrihhsvggusgdrtghomheqnecuggftrfgrthhtvghrnhephfejudeuleefheeu tddufeetjeevgeeiieeujeeuheefkedttdeuieeiieethfevnecuvehluhhsthgvrhfuih iivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepphgvthgvrhdrvghishgvnhhtrhgr uhhtsegvnhhtvghrphhrihhsvggusgdrtghomh X-ME-Proxy: Feedback-ID: i131946ab:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 13 Jun 2022 16:21:20 -0400 (EDT) Message-ID: <360e3d9b-a335-bced-840c-a185e213fe15@enterprisedb.com> Date: Mon, 13 Jun 2022 22:21:17 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: pltcl crash on recent macOS Content-Language: en-US To: Thomas Munro Cc: pgsql-hackers References: From: Peter Eisentraut In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 13.06.22 13:27, Thomas Munro wrote: > On Mon, Jun 13, 2022 at 6:53 PM Peter Eisentraut > wrote: >> frame #1: 0x00007ff803a28751 libsystem_c.dylib`hash_search + 215 >> frame #2: 0x0000000110357700 >> pltcl.so`compile_pltcl_function(fn_oid=16418, tgreloid=0, > > Hmm, I can’t reproduce that…. although that symbol is present in my > libSystem.B.dylib according to dlsym() and callable from a simple > program not linked to anything else, pltcl.so is apparently reaching > postgres’s hash_search for me, based on the fact that make -C > src/pl/tcl check succeeds and nm -m on pltcl.so shows it as "from > executable". It would be interesting to see what nm -m shows for you. ... (undefined) external _get_call_result_type (from executable) (undefined) external _getmissingattr (from executable) (undefined) external _hash_create (from libSystem) (undefined) external _hash_search (from libSystem) ... > I’m using tcl 8.6.12 installed by MacPorts on macOS 12.4, though, hmm, > SDK 12.3. I see the explicit -lc when building pltcl.so, and I see > that libSystem.B.dylib is explicitly mentioned here, whether or not I > have -lc: > > % otool -L ./tmp_install/Users/tmunro/install/lib/postgresql/pltcl.so > ./tmp_install/Users/tmunro/install/lib/postgresql/pltcl.so: > /opt/local/lib/libtcl8.6.dylib (compatibility version 8.6.0, current > version 8.6.12) > /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current > version 1311.100.3) Looks the same here: pltcl.so: /usr/local/opt/tcl-tk/lib/libtcl8.6.dylib (compatibility version 8.6.0, current version 8.6.12) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.100.3) > Here’s the complete link line: > > ccache cc -Wall -Wmissing-prototypes -Wpointer-arith > -Wdeclaration-after-statement -Werror=vla > -Werror=unguarded-availability-new -Wendif-labels > -Wmissing-format-attribute -Wcast-function-type -Wformat-security > -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument > -Wno-compound-token-split-by-macro -g -O0 -bundle -multiply_defined > suppress -o pltcl.so pltcl.o -L../../../src/port > -L../../../src/common -isysroot > /Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk > -Wl,-dead_strip_dylibs -L/opt/local/lib -ltcl8.6 -lz -lpthread > -framework CoreFoundation -lc -bundle_loader > ../../../src/backend/postgres The difference is that I use CC=gcc-11. I have change to CC=cc, then it works (nm output shows "from executable"). So it's gcc that gets thrown off by the -lc.