Skip to content

fix: forward termination signal#6204

Merged
baszalmstra merged 2 commits into
prefix-dev:mainfrom
baszalmstra:claude/elegant-meitner-9js2A
May 26, 2026
Merged

fix: forward termination signal#6204
baszalmstra merged 2 commits into
prefix-dev:mainfrom
baszalmstra:claude/elegant-meitner-9js2A

Conversation

@baszalmstra
Copy link
Copy Markdown
Contributor

@baszalmstra baszalmstra commented May 26, 2026

Description

pixi exec and pixi run previously hid signal terminations from the user. When a child process was killed by a signal such as SIGSEGV, pixi silently exited (with code 1 in the case of pixi exec) and no "Segmentation fault" message reached the terminal. This change makes both commands surface signal terminations the same way the shell would if the command had been run directly.

Before:

$ pixi exec python -c "import ctypes; ctypes.string_at(0)"
$ echo $?
1

After:

$ pixi exec python -c "import ctypes; ctypes.string_at(0)"
Segmentation fault (core dumped)
$ echo $?
139

Fixes #6166

How Has This Been Tested?

Built pixi from this branch and ran the command from the issue against both pixi exec and pixi run (inline and via a task). All three cases now print Segmentation fault and exit with 139, matching plain python3. Verified that normal exits (0, non-zero like 42) still propagate correctly.

AI Disclosure

  • This PR contains AI-generated content.
    • I have tested any AI-generated content in my PR.
    • I take responsibility for any AI-generated content in my PR.

Tools: Claude

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added sufficient tests to cover my changes.

claude added 2 commits May 26, 2026 07:26
When a command run via `pixi exec` or `pixi run` is killed by a signal
(e.g. SIGSEGV), pixi previously consumed the signal status while waiting
on the child and then exited "normally". This hid the shell's
"Segmentation fault" diagnostic and, for `pixi exec`, collapsed every
signal death to exit code 1.

On Unix, after the child terminates from a signal, restore that signal's
default disposition and re-raise it on pixi itself. The parent shell then
observes the same WIFSIGNALED status it would have from the child
directly, printing the familiar diagnostic and reporting exit 128+signal.

Fixes prefix-dev#6166.
@baszalmstra baszalmstra requested a review from wolfv May 26, 2026 07:45
@baszalmstra baszalmstra merged commit 364d706 into prefix-dev:main May 26, 2026
38 checks passed
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.

Executing python code with pixi run swallows message about segfaults

3 participants