Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

locale.c: Don't do asymmetric back out on failure #23172

Open
wants to merge 1 commit into
base: blead
Choose a base branch
from

Conversation

khwilliamson
Copy link
Contributor

@khwilliamson khwilliamson commented Apr 3, 2025

This fixes #23159

When something goes wrong doing locale-aware string collation, the code attempts to carry on as well as can be expected. prior to this commit the backout code was asymmetric, trying to undo things that had not been done. This happened when the failure was early on.

In the case of this ticket, the platform has a defective locale that was detectable before getting very far along.

The solution adopted here is to jump to a different label for those early failures that does less backout than for later failures.

  • This set of changes does not require a perldelta entry.

This fixes #23519

When something goes wrong doing locale-aware string collation, the code
attempts to carry on as well as can be expected.  Prior to this commit
the backout code was asymmetric, trying to undo things that had not been
done.  This happened when the failure was early on.

In the case of this ticket, the platform has a defective locale that was
detectable before getting very far along.

The solution adopted here is to jump to a different label for those
early failures that does less backout than for later failures.
@khwilliamson khwilliamson force-pushed the smoke-me/khw-darwin_locale branch from eb43f7f to b9e1bad Compare April 3, 2025 18:54
@Leont
Copy link
Contributor

Leont commented Apr 6, 2025

It's not clear to me if free_me, sans_nuls and sans_highs will be correctly freed when an error occurs.

@tonycoz
Copy link
Contributor

tonycoz commented Apr 7, 2025

There's a few paths where they can leak.

@sevan
Copy link
Contributor

sevan commented Apr 10, 2025

All tests successful.
Elapsed: 2660 sec
u=22.73  s=11.66  cu=2088.93  cs=219.98  scripts=2748  tests=1180795

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.

locale.t ends with panic "attempting to unlock already unlocked locale" on Mac OS X Tiger
4 participants