[Bug] CWStringTest may not restore the original LC_CTYPE locale
Mantenedores costumam responder em até 2 dias
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Facilidade para iniciantes
- 78/100
Direção de pesquisa
Encontre CWStringTest::EresUnittest_AppendFormatInvalidLocale() no código de testes do GPORCA e inspecione como ele salva e restaura LC_CTYPE ao alternar para "C". Copie o nome da localidade antes de alterá-lo e depois restaure-o a partir dessa cópia. Execute o teste afetado no Linux e confirme que ele restaura a localidade original para os testes seguintes.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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!
- Linguagem predominante
- C
- Estrelas
- 1.5k
- Forks
- 280
- Merge médio
- 5d 35min
- PRs com merge (30d)
- 128
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de apache/cloudberry
-
psql tab completion broken for storage servers, tags, profiles and resource groups (pre-PG15 query format)Talvez já em andamento @allenvox assumiu há 18 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
apache/cloudberry#2316 ·
Mantenedores costumam responder em até 2 dias
-
gpexpand first stage fails: 'SyncPackages' object has no attribute 'ret' (extension sync never runs; regression)Talvez já em andamento @talmacschen-arch assumiu há 166 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 86/100
apache/cloudberry#1825 ·
Mantenedores costumam responder em até 2 dias
-
[Bug] ORCA returns wrong system column values through a partially pruned CTE consumerTalvez já em andamento @yjhjstz assumiu hoje. Abertatype: Bug
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 48/100
apache/cloudberry#2458 · 1 comentário ·
Mantenedores costumam responder em até 2 dias
-
[Bug] Window Sort above ROLLUP gets a larger memory quota and runs slower after "Reserve memory for one partition at a time"Talvez já em andamento @Alena0704 assumiu há 1 dia. Abertatype: Bug
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 52/100
apache/cloudberry#2446 · 1 responsável ·
Mantenedores costumam responder em até 2 dias
-
type: Bug
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 56/100
apache/cloudberry#2429 ·
Mantenedores costumam responder em até 2 dias
Todas as issues de apache/cloudberry
Issues semelhantes
-
HXsetdir strdup leakAberta
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 82/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 90/100
ly05010419/MacNativeGames#2459 ·
Mantenedores costumam responder em até 1 dia
-
2024.2 Backport Required 2025.2 Backport Required 2026.1 Backport Required 2026.2 Backport Required area/build-framework kind/enhancement priority/medium
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
yugabyte/yugabyte-db#39930 ·
Mantenedores costumam responder em até 1 dia
-
RecompLauncher supportAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
shinyquagsire23/OpenJKDF2#540 ·
Mantenedores costumam responder em até 12 dias
-
Prison work hall: laundry and kitchen stations stand at bare walls, the hatch has no counter or signAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Life-Framework/Life-Framework#5939 ·
Mantenedores costumam responder em até 1 dia