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 1tb1qP-007MQZ-6p for pgsql-hackers@arkaria.postgresql.org; Thu, 23 Jan 2025 18:22:21 +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 1tb1qO-001sDU-Ax for pgsql-hackers@arkaria.postgresql.org; Thu, 23 Jan 2025 18:22:20 +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 1tb1qO-001sDI-1m for pgsql-hackers@lists.postgresql.org; Thu, 23 Jan 2025 18:22:20 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tb1qJ-001803-0Q for pgsql-hackers@lists.postgresql.org; Thu, 23 Jan 2025 18:22:17 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 50NIMDC3206318; Thu, 23 Jan 2025 13:22:13 -0500 From: Tom Lane To: pgsql-hackers@lists.postgresql.org cc: Noah Misch Subject: "postmaster became multithreaded" is reachable MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <206316.1737656533.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 23 Jan 2025 13:22:13 -0500 Message-ID: <206317.1737656533@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk ExitPostmaster() says: /* * There is no known cause for a postmaster to become multithreaded af= ter * startup. Recheck to account for the possibility of unknown causes. * This message uses LOG level, because an unclean shutdown at this po= int * would usually not look much different from a clean shutdown. */ if (pthread_is_threaded_np() !=3D 0) ereport(LOG, (errcode(ERRCODE_INTERNAL_ERROR), errmsg_internal("postmaster became multithreaded"), errdetail("Please report this to <%s>.", PACKAGE_BUGREPOR= T))); We now have a report[1] of a way to trigger this error message. It seems to boil down to "cause an error before PostmasterMain has reached its test of pthread_is_threaded_np()", for example $ # build with --enable-nls, using MacPorts' gettext package $ unset LANG $ postgres -D /foo postgres: could not access directory "/foo": No such file or directory Run initdb or pg_basebackup to initialize a PostgreSQL data directory. 2025-01-23 18:16:03.843 GMT [41524] LOG: postmaster became multithreaded 2025-01-23 18:16:03.843 GMT [41524] DETAIL: Please report this to . I suggest therefore that we remove the "Please report a bug" bit and instead use the much more helpful hint appearing in PostmasterMain: errhint("Set the LC_ALL environment variable to a valid l= ocale."))); An alternative idea (that maybe should also be done in PostmasterMain) is to report the HINT only #ifdef __darwin__ and on other platforms use the "Please report a bug" text. regards, tom lane [1] https://www.postgresql.org/message-id/18783-d1873b95a59b9103%40postgre= sql.org