Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1u8542-00D8zB-21 for pgsql-hackers@arkaria.postgresql.org; Thu, 24 Apr 2025 22:29:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1u8531-004EYa-F8 for pgsql-hackers@arkaria.postgresql.org; Thu, 24 Apr 2025 22:28:00 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1u8530-004EYN-ES for pgsql-hackers@lists.postgresql.org; Thu, 24 Apr 2025 22:27:59 +0000 Received: from fhigh-a3-smtp.messagingengine.com ([103.168.172.154]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1u852v-001rP1-0a for pgsql-hackers@lists.postgresql.org; Thu, 24 Apr 2025 22:27:56 +0000 Received: from phl-compute-04.internal (phl-compute-04.phl.internal [10.202.2.44]) by mailfhigh.phl.internal (Postfix) with ESMTP id 798CF114025A; Thu, 24 Apr 2025 18:27:50 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-04.internal (MEProxy); Thu, 24 Apr 2025 18:27:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=justatheory.com; h=cc:cc:content-type:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm2; t=1745533670; x= 1745620070; bh=FBBXeCIKJZ0I+eQC3BPmeGqa1nLr4xYZVCXlmm+YnyE=; b=H 8zUaRR7VBxsOADf//d2udvuzEVRb2XVnr8y0OBoz+N6bKFJIvk4xy3B7BL6+G7nH LQScod1+v+YtW8aHdPWiC5kVRVii/Fnz1syFjiz6uOUcqzXpmE+1zNLvgVIcZ6D3 vQrrWg4VGvpzGOjXxOplXDo7Da+SV+fNgzuyDrLL8AMfPvwmlwbwrXW0ogNqKVSs nTsD8qJpBwF0FtwkQo/Na+N/qNEL62aRDiZVmU6y+XrKVQIPdiqUJKcfcpbtqHae aueqf2P/Slge14g9zQoSa5D0At0mRyGL/yIO6bNNIligfYo5Ipib9imSuxEkD8dF b3EffOPski93BUFujoW+Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1745533670; x=1745620070; bh=FBBXeCIKJZ0I+eQC3BPmeGqa1nLr4xYZVCX lmm+YnyE=; b=FZZQBg0Ulb5m4l58i6ZEFT6ahDJMRgtIsH+cjbZx2vx+RSDuNTF RjstNz9kgvVQruX8ui9jvvzyO9/48DjFx3KdHBm5tEzfOMCd0hAZ8JDEZml6OwQK Abb5sTQBz1mfSn+3+j9P9MVsSgMPUsDSQFdE/MTo/YJ95ccjdaFvt28ZxzMACSsf DC2h7OiTQ2yQaJtRrmP8xfteZghtwag8SnjhEsYqmmqXdyNaU1xB6L9QLe8JH3Nf /LTDdYI7HoRJUXxhLdwt+E49JYvq2l8wqkLFTfwfwBitaHldjcdVG2fiZiaU9dKx Ivf/Ash7LiSM5j6mqN4giuNaY2/TL8wuA9A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvhedtieeiucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpih gvnhhtshculddquddttddmnecujfgurheptggguffhjgffvefkfhfvofesghdtmherhhdt jeenucfhrhhomhepfdffrghvihguucfgrdcuhghhvggvlhgvrhdfuceouggrvhhiugesjh hushhtrghthhgvohhrhidrtghomheqnecuggftrfgrthhtvghrnhephffhieeitdefkeev hfehtdfgieehgfffleetjeetkeeitdeugeejgeefffffkeeinecuvehluhhsthgvrhfuih iivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepuggrvhhiugesjhhushhtrghthhgv ohhrhidrtghomhdpnhgspghrtghpthhtohepgedpmhhouggvpehsmhhtphhouhhtpdhrtg hpthhtohepmhgrthhhvghushhsshhilhhvleejsehgmhgrihhlrdgtohhmpdhrtghpthht ohepmhihohhnseguvggsihgrnhdrohhrghdprhgtphhtthhopehpvghtvghrsegvihhsvg hnthhrrghuthdrohhrghdprhgtphhtthhopehpghhsqhhlqdhhrggtkhgvrhhssehlihhs thhsrdhpohhsthhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: i7c334307:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 24 Apr 2025 18:27:49 -0400 (EDT) Content-Type: multipart/signed; boundary="Apple-Mail=_4BCB023D-4825-477A-BD10-EDA9D6B36EB4"; protocol="application/pgp-signature"; micalg=pgp-sha256 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.500.181.1.5\)) Subject: Re: extension_control_path and "directory" From: "David E. Wheeler" In-Reply-To: Date: Thu, 24 Apr 2025 18:27:37 -0400 Cc: Christoph Berg , Peter Eisentraut , pgsql-hackers@lists.postgresql.org Message-Id: <546E7C54-D2F4-4DBB-9A06-EBBF90265A2C@justatheory.com> References: <3C304C9E-976C-4FB9-A883-707E0B90756A@justatheory.com> To: Matheus Alcantara X-Mailer: Apple Mail (2.3826.500.181.1.5) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Apple-Mail=_4BCB023D-4825-477A-BD10-EDA9D6B36EB4 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 On Apr 24, 2025, at 11:18, Matheus Alcantara = wrote: > In v2 I've moved the logic to remove the /extension to > parse_extension_control_file(), do you think that this Assert on this > function would still be wrong? IIUC we should always have /extension = at > the end of "control_dir" at this place, because the > extension_control_path GUC will omit the /extension at the end and we > will force it to have the suffix on the path at > find_extension_control_filename() and > get_extension_control_directories() functions. I'm missing something > here? I took this patch for a spin and managed to make it core dump. How? Well = I installed semver with this command: ```sh make prefix=3D/Users/david/Downloads install ``` Then set the search paths and restarted: ```ini extension_control_path =3D = '/Users/david/Downloads/share/extension:$system' dynamic_library_path =3D '/Users/david/Downloads/lib:$libdir' ``` Then I connected and ran `CREATE EXTENSION semver` and it segfaulted. I = poked around for a few minutes and realized that my prefix is not what I = expected. Because it doesn=E2=80=99t contain the string =E2=80=9Cpostgres=E2= =80=9D, PGXS helpfully adds it. The actual paths are: ```ini extension_control_path =3D = '/Users/david/Downloads/share/postgresql/extension:$system' dynamic_library_path =3D '/Users/david/Downloads/lib/postgresql:$libdir' ``` With that fix it no longer segafulted. So I presume something crashes when a directory or file doesn=E2=80=99t = exist. But I am not at all sure we want this prefix behavior for installing = extensions. I get that has been the behavior for setting the main = sharedir and libdir for Postgres, but I don=E2=80=99t know that it makes = sense for extension prefixes. Best, David --Apple-Mail=_4BCB023D-4825-477A-BD10-EDA9D6B36EB4 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEd+KfmbOQis6ZycGGkt9idPjIgfEFAmgKutkACgkQkt9idPjI gfEAQBAAgarmRmJG4qGI0B96X0GjDSMU3Y+jvuHuhsHrdrBKM1iMDRA5mve0eRqG V1j7HpRCWJmz53WJQ7QsbIwgssLt/vjmXOdL6gjbC7HPjTy+98WoSQDEy9rgkxMv uyNJY629P6ia81sa2I9v3kmHGX1Ef2QAk7+AyxggNeQ3EOc0jePVshAanqRHD7bh 6St6Ty9cpy55JulypGf/CzK6wV4Rqo6DN0FyEpG/TM6sEt3GYwazqnl0k1LLVoMf x47ncIHEwnJr0G8RI/1kCxclhdYOXyPQKFVbraOVJ4W3S2xSjcQMhk0FAHPlUpQp v0POU8sAv0Vg6M4HUQQjdPyZOCi7ae8XZme1n8F9T7Mtj+22VrvSiUS/H7RlmMtc SmP8kiGo4RHTNATy4tB2QmXcDhWnPZFvZOSs/wmmtfxNUsmcD+MIzPSIRUri4aBZ rWR1c6xYLW9xD9APNVeoZqKcuIQmZrTs2tl3uerUreSxa/hpAFrTvpkpz93SDPML W20ziTuZNg4B8mNK2TuX2/0LmTgboxUPz7aOxW+cL9fglt7tXCurrthS3C/mebNA lMN8FCXH4azuJyVgvrwO/PR4AXonIv3fS1g6Q9pfdoTF0mnjAaZ/rs1aoIymphdu 6JgLx2JTrEgGMQ94xP9Puku6CGxIuMSpvtyIqj8X75bFF8p4Gew= =yNz+ -----END PGP SIGNATURE----- --Apple-Mail=_4BCB023D-4825-477A-BD10-EDA9D6B36EB4--