Rémi Kalbe and Julia Ryan
8315fde1ff
Fix LSP spawning by resetting exception ports in child processes ( #40716 )
...
## Summary
Fixes #36754
This PR fixes an issue where LSPs fail to spawn after the crash handler
is initialized.
## Problem
After PR #35263 added minidump crash reporting, some users experienced
LSP spawn failures. The issue manifests as:
- LSPs fail to spawn with no clear error messages
- The problem only occurs after crash handler initialization
- LSPs work when a debugger is attached, revealing a timing issue
### Root Cause
The crash handler installs Mach exception ports for minidump generation.
Due to a timing issue, child processes inherit these exception ports
before they're fully stabilized, which can block child process spawning.
## Solution
Reset exception ports in child processes using the `pre_exec()` hook,
which runs after `fork()` but before `exec()`. This prevents children
from inheriting the parent's crash handler exception ports.
### Implementation
- Adds macOS-specific implementation of `new_smol_command()` that resets
exception ports before exec
- Calls `task_set_exception_ports` to reset all exception ports to
`MACH_PORT_NULL`
- Graceful error handling: logs warnings but doesn't fail process
spawning if port reset fails
Release Notes:
- Fixed LSPs failing to spawn on some macOS systems
---------
Co-authored-by: Julia Ryan <juliaryan3.14@gmail.com >
2025-11-05 22:05:34 +00:00
..
2025-11-03 19:25:15 +00:00
2025-11-02 18:11:21 +00:00
2025-11-03 19:25:15 +00:00
2025-10-29 19:35:16 +00:00
2025-11-03 19:25:15 +00:00
2025-11-04 21:40:35 -05:00
2025-10-19 15:52:28 +00:00
2025-11-05 21:14:16 +00:00
2025-10-20 08:35:28 -03:00
2025-10-17 18:58:14 +00:00
2025-10-24 18:19:53 +02:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 21:56:57 +02:00
2025-11-03 19:25:15 +00:00
2025-10-21 10:43:22 +00:00
2025-11-04 15:06:30 +01:00
2025-11-04 15:06:30 +01:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-29 16:41:43 +01:00
2025-11-03 14:50:34 -03:00
2025-11-03 19:25:15 +00:00
2025-10-17 18:58:14 +00:00
2025-11-03 19:25:15 +00:00
2025-10-28 20:21:49 +00:00
2025-10-21 10:43:22 +00:00
2025-10-21 10:43:22 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-11-04 17:36:50 +00:00
2025-11-01 19:35:04 +00:00
2025-10-29 22:16:13 -03:00
2025-11-03 19:25:15 +00:00
2025-11-05 16:51:10 +00:00
2025-10-17 18:58:14 +00:00
2025-10-28 16:15:44 -03:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-11-04 14:31:51 -05:00
2025-10-23 21:04:22 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-11-01 17:30:13 -04:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-31 01:53:46 +00:00
2025-11-05 00:49:47 +02:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-11-03 19:25:15 +00:00
2025-10-23 14:13:35 -04:00
2025-10-17 18:58:14 +00:00
2025-11-03 19:25:15 +00:00
2025-10-21 10:43:22 +00:00
2025-11-05 21:22:29 +00:00
2025-10-22 17:55:26 +00:00
2025-10-17 18:58:14 +00:00
2025-11-04 21:40:23 -05:00
2025-09-11 13:56:06 -07:00
2025-10-31 21:18:22 +00:00
2025-11-03 19:25:15 +00:00
2025-11-03 03:54:47 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-11-04 12:11:17 +00:00
2025-10-17 18:58:14 +00:00
2025-11-04 16:41:06 +00:00
2025-10-20 10:30:06 +00:00
2025-10-17 18:58:14 +00:00
2025-10-20 23:54:56 +03:00
2025-11-04 16:41:06 +00:00
2025-11-03 07:51:04 +01:00
2025-11-04 16:41:06 +00:00
2025-10-30 17:40:56 +00:00
2025-10-17 18:58:14 +00:00
2025-11-05 21:03:36 +00:00
2025-10-17 18:58:14 +00:00
2025-10-26 13:24:26 +00:00
2025-10-17 18:58:14 +00:00
2025-11-04 17:11:54 -05:00
2025-10-17 18:58:14 +00:00
2025-11-03 22:22:50 -03:00
2025-10-26 13:24:26 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-11-03 20:47:39 +01:00
2025-11-05 12:16:28 +01:00
2025-11-03 19:25:15 +00:00
2025-10-21 10:43:22 +00:00
2025-11-05 13:47:14 +01:00
2025-10-17 18:58:14 +00:00
2025-10-22 19:52:38 +00:00
2025-10-31 01:53:46 +00:00
2025-11-04 17:48:42 +05:30
2025-10-22 19:52:38 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-11-03 19:25:15 +00:00
2025-11-03 19:25:15 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-11-04 08:24:17 -07:00
2025-10-17 18:58:14 +00:00
2025-11-04 08:24:17 -07:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-11-05 14:10:42 -07:00
2025-10-20 17:20:09 +00:00
2025-10-17 18:58:14 +00:00
2025-10-26 13:24:26 +00:00
2025-11-05 13:47:14 +01:00
2025-10-17 18:58:14 +00:00
2025-10-17 21:56:57 +02:00
2025-11-03 22:01:52 +00:00
2025-10-17 18:58:14 +00:00
2025-10-27 15:24:44 +00:00
2025-10-31 04:26:36 +00:00
2025-10-17 18:58:14 +00:00
2025-11-05 08:30:22 +00:00
2025-11-04 20:35:37 +05:30
2025-10-17 18:58:14 +00:00
2025-10-29 16:27:30 +00:00
2025-11-04 16:41:06 +00:00
2025-11-03 21:38:00 -05:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-11-05 18:15:15 +05:30
2025-11-04 14:56:24 +00:00
2025-10-28 14:45:27 +00:00
2025-10-17 18:58:14 +00:00
2025-11-03 19:25:15 +00:00
2025-11-03 19:25:15 +00:00
2025-10-24 07:52:51 -04:00
2025-11-03 19:25:15 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-11-03 14:50:34 -03:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-11-04 08:24:17 -07:00
2025-10-27 10:13:26 -04:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-11-05 16:49:19 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-11-03 19:25:15 +00:00
2025-11-03 19:25:15 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-29 18:49:39 +01:00
2025-10-17 18:58:14 +00:00
2025-10-28 03:00:55 -04:00
2025-10-24 18:19:53 +02:00
2025-11-03 15:25:44 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-31 15:01:50 +00:00
2025-10-31 15:01:50 +00:00
2025-11-04 08:48:38 +00:00
2025-10-23 04:23:25 +05:30
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-11-02 07:35:11 +00:00
2025-10-22 19:52:38 +00:00
2025-11-05 16:12:30 -03:00
2025-11-04 14:12:05 -05:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-11-05 22:05:34 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-11-04 11:08:51 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-11-04 18:47:49 +01:00
2025-11-04 20:35:37 +05:30
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-11-05 17:31:18 +00:00
2025-11-03 21:38:00 -05:00
2025-10-17 18:58:14 +00:00
2025-11-03 19:25:15 +00:00
2025-11-03 15:12:08 -08:00
2025-11-03 15:12:08 -08:00
2025-11-04 17:36:50 +00:00
2025-10-29 18:49:39 +01:00
2025-10-17 18:58:14 +00:00