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 1o0dxM-0005kO-Ds for pgsql-hackers@arkaria.postgresql.org; Mon, 13 Jun 2022 06:53:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1o0dxK-0005UC-2h for pgsql-hackers@arkaria.postgresql.org; Mon, 13 Jun 2022 06:53:46 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o0dxJ-0005Tv-Os for pgsql-hackers@lists.postgresql.org; Mon, 13 Jun 2022 06:53:45 +0000 Received: from wout5-smtp.messagingengine.com ([64.147.123.21]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o0dxG-0007uO-MK for pgsql-hackers@postgresql.org; Mon, 13 Jun 2022 06:53:44 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 26EB03200950 for ; Mon, 13 Jun 2022 02:53:40 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Mon, 13 Jun 2022 02:53:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:date:feedback-id:feedback-id:from:from:in-reply-to :message-id:mime-version: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=1655103219; x=1655189619; bh=UWqBbapiCf7o6kMRmUJokBYy2bNP XhGBQ6I+QRUrxjg=; b=aVGAaP4oNlA2BO8pw2/qfQHt/skYXWa7aTCze8spQCOc qm9gxhZffmtW5FnAiaoSqI8Z1U4EGU+0gvQB8cfwk/L7n47nGMaiyZNEhraenIL0 KDRPmpWidSYmrvkfVG+2ZQL/R6bgrzbCoIwdKE7vUF5Z36KOn9u1ZXllMz7z8GAg r73KJzzvP5ioxWv8SD5cJIT9HOmAIObep9iCl5EWhiJcejNFGulLqtWxIJmqrXbd DcjuSfeHSTSJ4WmcyFDXUa+zBO5917wHjt+XN3BROp74rZiBTPilozOySd92maCH jD5apWTzE/Yg3arwGPxQ67SN8vgCawoDDSBeamKtMw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrudduiedguddtkecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepkfffgggfhffuvfgtgfesthejre dttdefjeenucfhrhhomheprfgvthgvrhcugfhishgvnhhtrhgruhhtuceophgvthgvrhdr vghishgvnhhtrhgruhhtsegvnhhtvghrphhrihhsvggusgdrtghomheqnecuggftrfgrth htvghrnhepieejueevgefhieettedtgedtvefhvdeludelveevgeelvedtleeuheetveff tdeunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepph gvthgvrhdrvghishgvnhhtrhgruhhtsegvnhhtvghrphhrihhsvggusgdrtghomh X-ME-Proxy: Feedback-ID: i131946ab:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Mon, 13 Jun 2022 02:53:38 -0400 (EDT) Message-ID: Date: Mon, 13 Jun 2022 08:53:36 +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 Content-Language: en-US From: Peter Eisentraut Subject: pltcl crash on recent macOS To: pgsql-hackers Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk A little while ago, the pltcl tests starting crashing for me on macOS. I don't know what had changed, but I suspect it was either an operating system update or something like an xcode update. Here is a backtrace: * frame #0: 0x00007ff7b0e61853 frame #1: 0x00007ff803a28751 libsystem_c.dylib`hash_search + 215 frame #2: 0x0000000110357700 pltcl.so`compile_pltcl_function(fn_oid=16418, tgreloid=0, is_event_trigger=false, pltrusted=true) at pltcl.c:1418:13 frame #3: 0x0000000110355d50 pltcl.so`pltcl_func_handler(fcinfo=0x00007fb6f1817028, call_state=0x00007ff7b0e61b80, pltrusted=true) at pltcl.c:814:12 ... Note that the hash_search call goes into some system library, not postgres. The command to link pltcl is: gcc ... -ltcl8.6 -lz -lpthread -framework CoreFoundation -lc -bundle_loader ../../../src/backend/postgres Notice the -lc in there. If I remove that, it works again. The -lc is explicitly added in src/pl/tcl/Makefile, so it's our own doing. I tracked this back, and it's been moved and rearranged in that makefile a number of time. The original addition was commit e3909672f12e0ddf3e202b824fda068ad2195ef2 Author: Tom Lane Date: Mon Dec 14 00:46:49 1998 Build pltcl.so correctly on platforms that want dependent shared libraries to be listed in the link command. Has anyone else seen this? Note, I'm using the tcl-tk package from Homebrew. The tcl installation provided by macOS itself no longer appears to work for linking against.