[Bug] CWStringTest may not restore the original LC_CTYPE locale
Maintainer thường phản hồi trong vòng 2 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 78/100
Hướng nghiên cứu
Tìm CWStringTest::EresUnittest_AppendFormatInvalidLocale() trong mã kiểm thử GPORCA và xem cách mã lưu, khôi phục LC_CTYPE khi chuyển sang "C". Sao chép tên locale trước khi thay đổi, rồi khôi phục từ bản sao đó. Chạy bài kiểm thử bị ảnh hưởng trên Linux và xác nhận rằng nó khôi phục locale ban đầu cho các bài kiểm thử tiếp theo.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Apache Cloudberry version
main (the SETLOCALE call and saved pointer already exist in the PR base)
What happened
CWStringTest::EresUnittest_AppendFormatInvalidLocale() saves the pointer returned by SETLOCALE(LC_CTYPE, nullptr), switches the locale to "C", then passes the saved pointer back to restore the locale. In configurations where SETLOCALE maps to libc setlocale, that returned pointer refers to library-managed storage and may be overwritten by the next setlocale call. The restore can therefore leave LC_CTYPE set to "C" instead of restoring the prior locale, affecting later tests in the same process.
This code was present before PR 2453; the PR changes the standalone test to call setlocale directly but does not introduce the saved-pointer pattern.
What should happen instead
Copy the locale name before changing it, then restore using the copy.
How to reproduce
Run the equivalent sequence with a non-C LC_CTYPE locale (for example, LC_ALL=en_US.UTF-8): save setlocale(LC_CTYPE, nullptr), call setlocale(LC_CTYPE, "C"), then call setlocale(LC_CTYPE, saved). On this machine, the saved pointer's contents changed to "C" after the second call, and the restore left the current locale at "C".
The GPORCA test itself is excluded on Darwin; the test suite runs this case on Linux, where the same setlocale pointer lifetime should be verified.
Operating System
Reproduced with the platform libc on macOS 14.6, arm64. The affected GPORCA test is enabled on non-Darwin platforms.
Anything else
- Yes, I am willing to submit a PR!
- Ngôn ngữ chính
- C
- Star
- 1.5k
- Fork
- 280
- Merge trung bình
- 4 ngày 21 giờ
- Pull request đã merge (30 ngày)
- 122
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của apache/cloudberry
-
psql tab completion broken for storage servers, tags, profiles and resource groups (pre-PG15 query format)Có thể đã có người làm @allenvox đã nhận 18 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
apache/cloudberry#2316 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
gpexpand first stage fails: 'SyncPackages' object has no attribute 'ret' (extension sync never runs; regression)Có thể đã có người làm @talmacschen-arch đã nhận 166 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
apache/cloudberry#1825 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
[Bug] ORCA returns wrong system column values through a partially pruned CTE consumerCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởtype: Bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
apache/cloudberry#2458 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
[Bug] Window Sort above ROLLUP gets a larger memory quota and runs slower after "Reserve memory for one partition at a time"Có thể đã có người làm @Alena0704 đã nhận 1 ngày trước. Đang mởtype: Bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
apache/cloudberry#2446 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 2 ngày
-
type: Bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 56/100
apache/cloudberry#2429 ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của apache/cloudberry
Issue tương tự
-
HXsetdir strdup leakĐang mở
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 82/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
ly05010419/MacNativeGames#2459 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
2024.2 Backport Required 2025.2 Backport Required 2026.1 Backport Required 2026.2 Backport Required area/build-framework kind/enhancement priority/medium
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
yugabyte/yugabyte-db#39930 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
RecompLauncher supportĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
shinyquagsire23/OpenJKDF2#540 ·
Maintainer thường phản hồi trong vòng 12 ngày
-
Prison work hall: laundry and kitchen stations stand at bare walls, the hatch has no counter or signĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Life-Framework/Life-Framework#5939 ·
Maintainer thường phản hồi trong vòng 1 ngày