pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
To: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: pltcl crash on recent macOS
Date: Mon, 13 Jun 2022 08:53:36 +0200
Message-ID: <a78c847a-4f79-9286-be99-e819e9e4139e@enterprisedb.com> (raw)

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 <tgl@sss.pgh.pa.us>
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.





view thread (11+ messages)  latest in thread

Message-ID: <a78c847a-4f79-9286-be99-e819e9e4139e@enterprisedb.com>
Permalink:  ../a78c847a-4f79-9286-be99-e819e9e4139e@enterprisedb.com/
Also on:    postgresql.org/message-id/a78c847a-4f79-9286-be99-e819e9e4139e@enterprisedb.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: peter.eisentraut@enterprisedb.com
  Subject: Re: pltcl crash on recent macOS
  In-Reply-To: <a78c847a-4f79-9286-be99-e819e9e4139e@enterprisedb.com>
  References: <a78c847a-4f79-9286-be99-e819e9e4139e@enterprisedb.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox