Skip to content

[New msys2-runtime-package version] msys2-runtime: Avoid deadlocks with app execution aliases (#6736) #6444

Closed

Description

@github-actions
msys2-runtime: Avoid deadlocks with app execution aliases (#6736)

https://github.com/msys2/msys2-runtime/issues/372 reports that calling `winget.exe` through its app execution alias from an interactive MSYS2 shell can leave the shell hanging after `winget.exe` exits. This affects all app execution aliases, not only `winget.exe`.

App execution alias handling was introduced in 0631c6644e (Cygwin: Treat Windows Store's "app execution aliases" as symbolic links, 2021-03-22), and 6c3d26961d (Cygwin: termios: Handle app execution alias in is_console_app(), 2025-12-10) taught `is_console_app()` to follow aliases using another `path_conv`, which allocates cygheap memory.

618eb90fc2 (Cygwin: console: Fix undesired mode change at exit of non-cygwin apps, 2026-09-19) added a second `is_console_app()` call from `wait_for_resume_if_necessary()`. Unfortunately, at that point, `child_info_spawn::worker()` already holds the non-recursive `cygheap_protect`, so following an alias tries to acquire the same lock recursively and deadlocks.

Let's avoid running `is_console_app()` under that lock by instead classifying the executable _once_, in `spawn_worker::setup()`, before acquiring the cygheap lock, then cache and reuse the result for both PTY setup and the post-resume wait.

This addresses https://github.com/msys2/msys2-runtime/issues/372

This corresponds to https://github.com/msys2/msys2-runtime/pull/373

msys2/MSYS2-packages@3c4cc77

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions