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 1tyJeA-0054AD-4C for pgsql-hackers@arkaria.postgresql.org; Sat, 29 Mar 2025 00:01:58 +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 1tyJe8-001J9G-7L for pgsql-hackers@arkaria.postgresql.org; Sat, 29 Mar 2025 00:01:56 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tyJe7-001J1w-Ox for pgsql-hackers@lists.postgresql.org; Sat, 29 Mar 2025 00:01:55 +0000 Received: from mail-lj1-x22a.google.com ([2a00:1450:4864:20::22a]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tyJe5-001hpZ-2k for pgsql-hackers@postgresql.org; Sat, 29 Mar 2025 00:01:54 +0000 Received: by mail-lj1-x22a.google.com with SMTP id 38308e7fff4ca-30beedb99c9so24653381fa.3 for ; Fri, 28 Mar 2025 17:01:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1743206511; x=1743811311; darn=postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=b5cTt03hWaAhhQGkblsG5G6ZKBQi//3q2td+AyFyeQI=; b=Wcg8armnXv1HsaPoTrOGgod7D3hNcCelrGbfLgSomZFyNeR+Nv/JNDYNc6SMoxxLGS 58K6XXqYGA0A857tc2fPEC62cO2mP9UB/XOvcS+uEvUhMRE5z0609vgY4C1vgM52ljgp So8yrHokXlfWYHoYtojcN6XA9Tz2EWmYuC+ozOGxBTRT9E1s6KnBDGKDSIqggiZdCZu6 qJtjKaHmm0NcqFih/T2R817t7/NFPTnwAN84ki0eTRuRyPjeGjO4c3MAtwFYVct5GWTs eUNA2B6lEoAGr4C3q63NbtunVFU1jD0OHImQcuCYqV2oFLv40Q0S7bAj2eCvdTBrL0xJ 1c6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743206511; x=1743811311; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=b5cTt03hWaAhhQGkblsG5G6ZKBQi//3q2td+AyFyeQI=; b=o3GB+fHqsVoJvv5TRbKEKrHZsAsmvYsk0D8LUFQuHgWib2W/MhhL5BtkT5irAXgOdZ nC/2H9IRpeDe0W2aRIrGGLmPo/WWw5LjD1Bqmn8/fE5LsxSwbHlK9ShbUq/7iRpLg6xV l9w/0k1rZb+1uXg5OdCuJ7dNnDy4Zm7JiwTATWP/ROLin+n2SB/TF90pc7Uzo1+IiA58 8fLyz8qDAe40V7tWLP8cVagnVlW4I33170U9XRhyWVO2dDIU+qj7Xrvh6HITty0iowSC uAkGZZMpj1cxzKQCnK7MPTguuzv9PzQG89vg2e2rqOM+BZn/gzhAC35Za/MFKArj20ox omuA== X-Forwarded-Encrypted: i=1; AJvYcCWO/YshIAPmvpPCmLBD/p/wjFPIal+Gl3doKGkCDzOOJ/3MMReEYYuxPzqUd1ibMInsTZZJBc4INhNVTRwX@postgresql.org X-Gm-Message-State: AOJu0Yy+ZNXmy9NiuAmjR4LYJq6HpXYWKJVZzOfeAO/U+x+Of1VpnCek 1TyZxqVHUZ4rBTcPKe/YKvbbfa/qOWzTLUWIuZPG/dAs9aE4qi7z/inMBAbj6hINfaenQ4Uii6l 1chBCrGEgMXQrh3gG3ejahrsz++k= X-Gm-Gg: ASbGncs8ENc2saXyF1cWnf3zsDI6i8XMopqK6rrscu5CPijplpq8euq96XiZ/hQz6R5 SkVXLjsBMnHbMOZfBiy7/jXWQ7VKtjF+2p+/Y++S3eKo9BpcsoPSqExnAvlnWwQ1/s9t13Tj8cj YRw5+eA+9s1GlXYjOnUt1nwsXqG8s= X-Google-Smtp-Source: AGHT+IEUBVak48eu+FltbDJJ69ttSWO3UndIkgLqQJAyroJJHPlx25KRifd2JRErSkdJCvgO3FgglJgTiu/i5DqtVMo= X-Received: by 2002:a2e:be29:0:b0:309:26e8:cb1a with SMTP id 38308e7fff4ca-30de02ccb33mr4696781fa.30.1743206510818; Fri, 28 Mar 2025 17:01:50 -0700 (PDT) MIME-Version: 1.0 References: <423491f5-2eaa-454e-8dc9-037d69c1a8f9@eisentraut.org> <2652c576-29b3-4b4a-b61b-10275cacadcb@eisentraut.org> <679e8c35-0429-478e-8805-607d15b82e53@eisentraut.org> <3f16f601-6785-4751-9fd9-2bfd5117e760@eisentraut.org> <1a0bad5f-0ab1-46bc-a70b-9290291c9cd8@eisentraut.org> In-Reply-To: <1a0bad5f-0ab1-46bc-a70b-9290291c9cd8@eisentraut.org> From: Masahiko Sawada Date: Fri, 28 Mar 2025 17:01:14 -0700 X-Gm-Features: AQ5f1JqdptNGq9GNlicrkShI7bIwgwmZ6CQ4cvYJXApoaSScBRv5s-O7ASaP3Y8 Message-ID: Subject: Re: On non-Windows, hard depend on uselocale(3) To: Peter Eisentraut Cc: Thomas Munro , Michael Paquier , Andrew Dunstan , Tristan Partin , Tom Lane , pgsql-hackers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, Mar 28, 2025 at 9:32=E2=80=AFAM Peter Eisentraut wrote: > > On 28.03.25 17:14, Masahiko Sawada wrote: > > On Fri, Mar 28, 2025 at 8:30=E2=80=AFAM Peter Eisentraut wrote: > >> > >> On 09.02.25 08:32, Peter Eisentraut wrote: > >>> Checking the status of this thread ... > >>> > >>> The patches that removed the configure checks for _configthreadlocale= (), > >>> and related cleanup, have been committed. > >>> > >>> The original patch to "Tidy up locale thread safety in ECPG library" = is > >>> still outstanding. > >>> > >>> Attached is a rebased version, based on the posted v6, with a couple = of > >>> small fixups from me. > >>> > >>> I haven't re-reviewed it yet, but from scanning the discussion, it lo= oks > >>> close to done. > >> > >> After staring at this a few more times, I figured it was ready enough > >> and I committed it. > > > > It seems that some bf animals such as jackdaw are unhappy with this > > commit[0][1]. I also got the same 'undefined reference to symbol > > error' locally when building test_json_parser. > > Yeah, looks like we'll have to revert this for now. But I'm confused, > because I don't see any clear pattern for which platforms or > configurations it's failing and for which not. > Not sure it would help the investigation but I got the linker error when building with 'make' but not with 'meson'. Looking at the build logs, when building test_json_parser with meson, it adds -lpthread as follows: % /home/masahiko/work/gcc/12.2.0/bin/gcc -v -o src/test/modules/test_json_parser/test_json_parser_incremental_shlib src/test/modules/test_json_parser/test_json_parser_incremental_shlib.p/test= _json_parser_incremental.c.o -Wl,--as-needed -Wl,--no-undefined '-Wl,-rpath,$ORIGIN/../../../interfaces/libpq:/lib/../lib64' -Wl,-rpath-link,/lib/../lib64 -Wl,-rpath-link,/home/masahiko/pgsql/source/dev_master/build/src/interfaces= /libpq -Wl,--start-group src/common/libpgcommon_excluded_shlib.a src/common/libpgcommon_shlib.a src/common/libpgcommon_shlib_config_info.a src/common/libpgcommon_shlib_ryu.a src/port/libpgport_shlib.a src/interfaces/libpq/libpq.so.5.18 -lm -ldl -pthread -lrt /usr/lib64/libz.so /lib/../lib64/libzstd.so /usr/lib64/liblz4.so /usr/lib64/libssl.so /usr/lib64/libcrypto.so -Wl,--end-group whereas with 'make' it doesn't: % gcc -v -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=3Dvla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3D3 -Wcast-function-type -Wshadow=3Dcompatible-local -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=3Dstandard -Wno-format-truncation -Wno-stringop-truncation -g -g -O0 test_json_parser_incremental.o -L../../../../src/port -L../../../../src/common -Wl,--as-needed -Wl,-rpath,'/home/masahiko/pgsql/master/lib',--enable-new-dtags -lpgcommon_excluded_shlib -L../../../../src/common -lpgcommon_shlib -L../../../../src/port -lpgport_shlib -L../../../../src/interfaces/libpq -lpq -o test_json_parser_incremental_shlib FYI the following change fixed the issue in my local env: --- a/src/test/modules/test_json_parser/Makefile +++ b/src/test/modules/test_json_parser/Makefile @@ -27,7 +27,7 @@ test_json_parser_incremental$(X): test_json_parser_incremental.o $(WIN32RES) $(CC) $(CFLAGS) $^ $(PG_LIBS_INTERNAL) $(LDFLAGS) $(LDFLAGS_EX) $(PG_LIBS) $(LIBS) -o $@ test_json_parser_incremental_shlib$(X): test_json_parser_incremental.o $(WIN32RES) - $(CC) $(CFLAGS) $^ $(LDFLAGS) -lpgcommon_excluded_shlib $(libpq_pgport_shlib) $(filter -lintl, $(LIBS)) -o $@ + $(CC) $(CFLAGS) $^ $(LDFLAGS) -lpgcommon_excluded_shlib $(libpq_pgport_shlib) $(filter -lintl, $(LIBS)) $(LIBS) -o $@ test_json_parser_perf$(X): test_json_parser_perf.o $(WIN32RES) $(CC) $(CFLAGS) $^ $(PG_LIBS_INTERNAL) $(LDFLAGS) $(LDFLAGS_EX) $(PG_LIBS) $(LIBS) -o $@ It seems that no MacOS and NetBSD animals failed due to this error because they have LC_C_LOCALE. But I'm not sure why some animals successfully built test_json_parser() even without -lpthread or -pthread[1][2]. Regards, [1] https://buildfarm.postgresql.org/cgi-bin/show_stage_log.pl?nm=3Dprion&d= t=3D2025-03-28%2015%3A33%3A03&stg=3Dmake-testmodules [2] https://buildfarm.postgresql.org/cgi-bin/show_stage_log.pl?nm=3Dbushmas= ter&dt=3D2025-03-28%2015%3A32%3A01&stg=3Dmake-testmodules -- Masahiko Sawada Amazon Web Services: https://aws.amazon.com