Skip to content

Conversation

@khwilliamson
Copy link
Contributor

Fixes #23825

From the discussion in that ticket, it appears that the problem is the OS.

  • This set of changes requires a perldelta entry, and it is included.

@Leont
Copy link
Contributor

Leont commented Oct 10, 2025

Possibly we should just add a proper configure flag for this?

@khwilliamson
Copy link
Contributor Author

I don't understand @Leont 's comment. Please clarify

@tonycoz
Copy link
Contributor

tonycoz commented Oct 12, 2025

I don't understand @Leont 's comment. Please clarify

A ./Configure -Duse_posix_2008_locale_api flags, propagated to config.h. (Or logic inverted, but why add an extra negative?)

So aix.sh would do something like:

case "X$use_posix_2008_locale_api" in
X) use_posix_2008_locale_api=$undef
esac

which lets people test with it enabled.

I don't think it's reasonable to have Configure detect the kind of breakage the provoked this change.

But even without detection it would be a bigger change than this one.

@khwilliamson
Copy link
Contributor Author

In some previous releases, I had a test i Configure to see if something about locales worked. The simplistic test ruled out egregious violations, but more subtle bugs in the platform's implementation went undetected. It was better to take that out and put it in the hints rather than misleadingly say it worked; which led to barking up the wrong tree during debugging.

@tonycoz
Copy link
Contributor

tonycoz commented Oct 13, 2025

yeah, I'm not suggesting that sort of probe, just that it has it's own Configure id that defaults define unless already set from the command-line or hints.

@Leont
Copy link
Contributor

Leont commented Oct 13, 2025

But even without detection it would be a bigger change than this one.

Yeah, I don't think my suggestion has to stop us from fixing locales on AIX first, but this way of wiring things is suboptimal for our users IMHO. Toggling it uses a surprising mechanism, and it isn't introspectable through %Config

@Leont
Copy link
Contributor

Leont commented Oct 13, 2025

just that it has it's own Configure id that defaults define unless already set from the command-line or hints.

Well, default to define if newlocale/freelocale/duplocale/uselocale/… are defined.

And arguably a uselocale option to go with it.

@khwilliamson
Copy link
Contributor Author

I still don't understand.

The way it current works is that Configure has separate probes for each of newlocale, uselocale, duplocale, freelocale and LC_ALL_MASK. If and only if it finds all of them and neither NO_LOCALE nor NO_POSIX_2008_LOCALE are present does it enable using POSIX 2008 locales.

I don't see what's wrong with that. We do have platforms where one or another isn't found, but others are. We need all of them for this to work. In AIX, since we know duplocale doesn't work, we could turn just that off, and the 2008 locales would not be selected, but this seemed clearer.

@Leont
Copy link
Contributor

Leont commented Oct 14, 2025

The way it current works is that Configure has separate probes for each of newlocale, uselocale, duplocale, freelocale and LC_ALL_MASK.

Yes that is excellent.

If and only if it finds all of them and neither NO_LOCALE nor NO_POSIX_2008_LOCALE are present does it enable using POSIX 2008 locales.

I think I see your point. It probably doesn't make sense to have both those specific *locale checks and a useposix2008locale on top; defining the latter is senseless if any of the functions are missing.

In AIX, since we know duplocale doesn't work, we could turn just that off, and the 2008 locales would not be selected, but this seemed clearer.

To me that would make more sense to be honest. It points at the actual problem, instead of the consequence of the problem.

Fixes Perl#23825

From the discussion in that ticket, it appears that the problem is the
OS.
@khwilliamson
Copy link
Contributor Author

I changed to undef duplocale.

I think this patch should go in 5.42.1

Copy link
Contributor

@mauke mauke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable to me, although I don't have an AIX system to test on.

@khwilliamson khwilliamson merged commit 1f9d9f8 into Perl:blead Oct 16, 2025
33 checks passed
@khwilliamson khwilliamson deleted the aix branch October 17, 2025 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

duplocale fails on AIX (locale.c: 2458: panic: duplocale failed; errno=22 Called by locale.c: 8734)

4 participants