ITADN

[New msys2-runtime version] Cygwin: console: fix deadlock in pcon teardown

#6257Closedgithub-actions[bot] 创建于 2026-05-24
component-update
``` Cygwin: console: fix deadlock in pcon teardown When a process inside a pseudo console (pcon) exits, the sequence was: exit() -> atexit handlers (including pcon_hand_over_proc) pcon_hand_over_proc closes parent_pty_input_mutex -- handle slot now free to be recycled -- -> _exit() -> do_exit() -> close_all_files() -> fhandler_console::close() set_input_mode() waits on input_mutex <-- hangs The fix, suggested by Takashi Yano: remove the atexit registration entirely and instead call pcon_hand_over_proc() directly from fhandler_console::close(), after both input_mutex and output_mutex have been closed. By that point close() has already waited for cons_master_thread to exit, so parent_pty_input_mutex is no longer accessed by any other thread and can be safely closed. Fixes: https://github.com/msys2/msys2-runtime/issues/338 ``` https://github.com/msys2/msys2-runtime/commit/01d6c708f9221334d18ab332621b6d87eb12d37e
关闭于 2026-06-06 1 条评论