python / python/cpython

Interpreter segfaults when LC_CTYPE is unsupported on Linux s390x

Open
#98,715 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

interpreter-core type-crash
Dominant language
Python
Stars
77.2k
Forks
36k
PR merge metrics
PR metrics pending

Description

Crash report

set LC_CTYPE to an unsupported locale, e.g.

export LC_CTYPE=UTF-8

You should hopefully get -bash: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory. If not, set LC_CTYPE to something random, e.g. foobar.

Start python REPL => segfault.

Error messages

Enter any relevant error message caused by the crash, including a core dump if there is one.

Your environment

  • CPython versions tested on: 3.7.13, 3.8.13, 3.9.12
  • Operating system and architecture: Linux s390x
  • Running in a conda env. Unsetting LC_CTYPE fixes the problem, in the same env. (System Python3 not available/installable on the available machine unfortunately.)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the crash on Linux s390x with CPython 3.7.13, 3.8.13, or 3.9.12 while LC_CTYPE is set to an unsupported value, then compare it with the same environment after unsetting LC_CTYPE. Done means starting the Python REPL no longer segfaults under the reported locale configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, python
Domain
operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.