Commit 241f53af1d for perl
commit 241f53af1d5f01f61134219e669054da11794796
Author: Karl Williamson <khw@cpan.org>
Date: Thu Sep 24 08:50:39 2026 -0600
Use correct constant when calling LC_ALL
This value is ignored except when emulating thread-safe locales. The
wrong symbol was used to call the locking macros that could
coincidentally be valid on some platforms, but definitely was wrong on
FreeBSD ones, causing an assertion failure, noted in GH #24844
diff --git a/perl.h b/perl.h
index 01729fc27f..99ee06c35e 100644
--- a/perl.h
+++ b/perl.h
@@ -8269,16 +8269,16 @@ typedef struct am_table_short AMTS;
* write', to indicate the caller wants to be able to access memory that isn't
* thread specific, either to write to itself, or to prevent anyone else from
* writing. */
-#define gwLOCALE_LOCK PERL_GENx_LCr_LOCK(LC_ALL)
-#define gwLOCALE_UNLOCK PERL_GENx_LCr_UNLOCK(LC_ALL)
+#define gwLOCALE_LOCK PERL_GENx_LCr_LOCK(PERL_LC_ALLb)
+#define gwLOCALE_UNLOCK PERL_GENx_LCr_UNLOCK(PERL_LC_ALLb)
/* Similar to gwLOCALE_LOCK, there are functions that require both the locale
* and environment to be constant during their execution, and don't change
* either of those things, but do write to some sort of shared global space.
* They require some sort of exclusive lock against similar functions, and a
* read lock on both the locale and environment. */
-#define gwENVr_LOCALEr_LOCK PERL_GENx_ENVr_LCr_LOCK(LC_ALL)
-#define gwENVr_LOCALEr_UNLOCK PERL_GENx_ENVr_LCr_UNLOCK(LC_ALL)
+#define gwENVr_LOCALEr_LOCK PERL_GENx_ENVr_LCr_LOCK(PERL_LC_ALLb)
+#define gwENVr_LOCALEr_UNLOCK PERL_GENx_ENVr_LCr_UNLOCK(PERL_LC_ALLb)
/* posix_setlocale() is used internally to mean the setlocale() libc function
* defined in C89 and the POSIX Standard. Windows implementations have
@@ -8320,14 +8320,14 @@ typedef struct am_table_short AMTS;
#endif
/* These spellings are retained for backwards compatibility */
-#define ENVr_LOCALEr_LOCK PERL_ENVr_LCr_LOCK(LC_ALL)
-#define ENVr_LOCALEr_UNLOCK PERL_ENVr_LCr_UNLOCK(LC_ALL)
-#define gwLOCALEr_LOCK PERL_GENx_LCr_LOCK(LC_ALL)
-#define gwLOCALEr_UNLOCK PERL_GENx_LCr_UNLOCK(LC_ALL)
+#define ENVr_LOCALEr_LOCK PERL_ENVr_LCr_LOCK(PERL_LC_ALLb)
+#define ENVr_LOCALEr_UNLOCK PERL_ENVr_LCr_UNLOCK(PERL_LC_ALLb)
+#define gwLOCALEr_LOCK PERL_GENx_LCr_LOCK(PERL_LC_ALLb)
+#define gwLOCALEr_UNLOCK PERL_GENx_LCr_UNLOCK(PERL_LC_ALLb)
#define LC_COLLATE_LOCK LOCALE_LOCK
#define LC_COLLATE_UNLOCK LOCALE_UNLOCK
-#define LOCALE_LOCK PERL_LCx_LOCK(LC_ALL)
-#define LOCALE_UNLOCK PERL_LCx_UNLOCK(LC_ALL)
+#define LOCALE_LOCK PERL_LCx_LOCK(PERL_LC_ALLb)
+#define LOCALE_UNLOCK PERL_LCx_UNLOCK(PERL_LC_ALLb)
/* End of locale/env synchronization */