public inbox for [email protected]  
help / color / mirror / Atom feed
From: Thomas Munro <[email protected]>
To: Sandeep Thakkar <[email protected]>
Cc: Ertan Küçükoglu <[email protected]>
Cc: Adrian Klaver <[email protected]>
Cc: [email protected]
Subject: Re: Windows installation problem at post-install step
Date: Tue, 6 Aug 2024 17:26:25 +1200
Message-ID: <CA+hUKGK_LqmzEbR6YjyuQ9eAaecMfogv1e+E-dZVw=qULXtyGQ@mail.gmail.com> (raw)
In-Reply-To: <CANFyU959RhJvRAY7=8vgN-1f+qKFuK80uFvrR1kMoQMQqzKPQg@mail.gmail.com>
References: <CAH2i4ydECHZPxEBB7gtRG3vROv7a0d3tqAFXzcJWQ9hRsc1znQ@mail.gmail.com>
	<[email protected]>
	<CAH2i4yfkH7YPoLz1aE6MQiBOm8dra5uOTpn51=9ce_Tm6fy3Pw@mail.gmail.com>
	<[email protected]>
	<CAH2i4ycV8p_uDsdGRcP3bWcU52ogojg9_-mT8uMixSqpNmW7Sg@mail.gmail.com>
	<[email protected]>
	<CAH2i4yfBEYmOzsvsT=D+ySpLpsEW2O1VfUwx9Ckd69du67YY_w@mail.gmail.com>
	<[email protected]>
	<CA+hUKGJA4pGEeZtfUUEuQmNNO7x16wZ+RWOeXP+tq3Hf4iu8oQ@mail.gmail.com>
	<CANFyU95Le+trZbtB1D4Y1FdUu4y_OJLxvJMi1Zb9WOWuf8KpqA@mail.gmail.com>
	<CAH2i4ycX3Q79uv431CxZ9dcyM5jkL=sJ8Z8rbNaNuKSK=Bprfg@mail.gmail.com>
	<CANFyU95q_WDM+utY3Mnrf1pwgASN3ZR1r6Fb+Zs7kXsPEDQQ2A@mail.gmail.com>
	<CANFyU94yoUCYovEZ9By2cpRbHsziRqndfPZ5qiTRD24CM57cEg@mail.gmail.com>
	<CANFyU959RhJvRAY7=8vgN-1f+qKFuK80uFvrR1kMoQMQqzKPQg@mail.gmail.com>

On Mon, Aug 5, 2024 at 8:50 PM Sandeep Thakkar
<[email protected]> wrote:
> This issue is seen only on v16 and not the back branches (tested on 15 and 14) and also confirmed by @Ertan Küçükoglu at https://github.com/EnterpriseDB/edb-installers/issues/127#issuecomment-2268371442

Does that mean you can reproduce the problem with initdb.exe directly
in a shell?  That is, remove the EDB installer from the picture and
compare v15 and v16 with the exact command line options that
initcluster.vbs is using, or perhaps just:

initdb.exe --locale="Turkish,Türkiye" --encoding=UTF-8 -D pgdata

. o O (Why does that locale name have a comma?)  If v15 works and v16
breaks, perhaps you could try comparing the output with the attached
patch?  It will give a hex dump of the contents of the locale name at
various points in the program, to see if/where it was corrupted, which
might also be a bit less confusing than looking at script output via
email (I don't even know how many onion layers of transcoding are
involved...)


Attachments:

  [text/x-patch] 0001-xxx-debug.patch (2.4K, 2-0001-xxx-debug.patch)
  download | inline diff:
From b97fe5a55e50a447d41a439412922ffe3f7e168b Mon Sep 17 00:00:00 2001
From: Thomas Munro <[email protected]>
Date: Tue, 6 Aug 2024 16:06:29 +1200
Subject: [PATCH 1/3] xxx debug

---
 src/bin/initdb/initdb.c | 34 +++++++++++++++++++++++++++++++++-
 1 file changed, 33 insertions(+), 1 deletion(-)

diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c
index 458dc1137a3..abe5983ab16 100644
--- a/src/bin/initdb/initdb.c
+++ b/src/bin/initdb/initdb.c
@@ -336,6 +336,33 @@ do { \
 		output_failed = true, output_errno = errno; \
 } while (0)
 
+static void
+xxx_debug(const char *prefix, const char *s)
+{
+	const unsigned char *us;
+
+	if (s == NULL)
+	{
+		printf("XXX debug: %s  = NULL\n", prefix);
+		return;
+	}
+
+	printf("XXX debug raw: %s  = \"%s\"\n", prefix, s);
+	printf("XXX debug hex: %s  = { ", prefix);
+	for (us = (const unsigned char *) s; *us; us++)
+		printf("%02x ", *us);
+	printf("}\n");
+	printf("XXX debug txt: %s  = { ", prefix);
+	for (us = (const unsigned char *) s; *us; us++)
+	{
+		if (*us >= 0x20 && *us < 0x80)
+			printf("%c  ", *us);
+		else
+			printf("?  ");
+	}
+	printf("}\n");
+}
+
 /*
  * Escape single quotes and backslashes, suitably for insertions into
  * configuration files or SQL E'' strings.
@@ -2369,8 +2396,10 @@ setlocales(void)
 	 * canonicalize locale names, and obtain any missing values from our
 	 * current environment
 	 */
+	xxx_debug("setlocales lc_ctype", lc_ctype);
 	check_locale_name(LC_CTYPE, lc_ctype, &canonname);
 	lc_ctype = canonname;
+	xxx_debug("setlocales cannonname", lc_ctype);
 	check_locale_name(LC_COLLATE, lc_collate, &canonname);
 	lc_collate = canonname;
 	check_locale_name(LC_NUMERIC, lc_numeric, &canonname);
@@ -2597,7 +2626,10 @@ setup_locale_encoding(void)
 		strcmp(lc_ctype, lc_monetary) == 0 &&
 		strcmp(lc_ctype, lc_messages) == 0 &&
 		(!icu_locale || strcmp(lc_ctype, icu_locale) == 0))
+	{
+		xxx_debug("setup_locale_encoding", lc_ctype);
 		printf(_("The database cluster will be initialized with locale \"%s\".\n"), lc_ctype);
+	}
 	else
 	{
 		printf(_("The database cluster will be initialized with this locale configuration:\n"));
@@ -3056,7 +3088,6 @@ initialize_data_directory(void)
 	check_ok();
 }
 
-
 int
 main(int argc, char *argv[])
 {
@@ -3214,6 +3245,7 @@ main(int argc, char *argv[])
 				break;
 			case 1:
 				locale = pg_strdup(optarg);
+				xxx_debug("getopt optarg", locale);
 				break;
 			case 2:
 				lc_collate = pg_strdup(optarg);
-- 
2.46.0



view thread (8+ messages)  latest in thread

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 using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: Windows installation problem at post-install step
  In-Reply-To: <CA+hUKGK_LqmzEbR6YjyuQ9eAaecMfogv1e+E-dZVw=qULXtyGQ@mail.gmail.com>

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

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