Add minidump crash reporting (#35263)

- [x] Handle uploading minidumps from the remote_server
- [x] Associate minidumps with panics with some sort of ID (we don't use
session_id on the remote)
  - [x] Update the protobufs and client/server code to request panics
- [x] Upload minidumps with no corresponding panic
- [x] Fill in panic info when there _is_ a corresponding panic
- [x] Use an env var for the sentry endpoint instead of hardcoding it

Release Notes:

- Zed now generates minidumps for crash reporting

---------

Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
This commit is contained in:
Julia Ryan 2025-08-04 20:19:42 -05:00 committed by GitHub
parent 07e3d53d58
commit 669c57b45f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
25 changed files with 709 additions and 135 deletions

189
Cargo.lock generated
View file

@ -1172,7 +1172,7 @@ dependencies = [
"serde_json",
"serde_path_to_error",
"serde_qs 0.10.1",
"smart-default",
"smart-default 0.6.0",
"smol_str 0.1.24",
"thiserror 1.0.69",
"tokio",
@ -3927,6 +3927,42 @@ dependencies = [
"target-lexicon 0.13.2",
]
[[package]]
name = "crash-context"
version = "0.6.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "031ed29858d90cfdf27fe49fae28028a1f20466db97962fa2f4ea34809aeebf3"
dependencies = [
"cfg-if",
"libc",
"mach2",
]
[[package]]
name = "crash-handler"
version = "0.6.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2066907075af649bcb8bcb1b9b986329b243677e6918b2d920aa64b0aac5ace3"
dependencies = [
"cfg-if",
"crash-context",
"libc",
"mach2",
"parking_lot",
]
[[package]]
name = "crashes"
version = "0.1.0"
dependencies = [
"crash-handler",
"log",
"minidumper",
"paths",
"smol",
"workspace-hack",
]
[[package]]
name = "crc"
version = "3.2.1"
@ -4453,6 +4489,15 @@ dependencies = [
"zlog",
]
[[package]]
name = "debugid"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bef552e6f588e446098f6ba40d89ac146c8c7b64aade83c051ee00bb5d2bc18d"
dependencies = [
"uuid",
]
[[package]]
name = "deepseek"
version = "0.1.0"
@ -7235,6 +7280,17 @@ dependencies = [
"workspace-hack",
]
[[package]]
name = "goblin"
version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1b363a30c165f666402fe6a3024d3bec7ebc898f96a4a23bd1c99f8dbf3f4f47"
dependencies = [
"log",
"plain",
"scroll",
]
[[package]]
name = "google_ai"
version = "0.1.0"
@ -7850,6 +7906,7 @@ dependencies = [
"http-body 1.0.1",
"log",
"parking_lot",
"reqwest 0.12.15 (git+https://github.com/zed-industries/reqwest.git?rev=951c770a32f1998d6e999cef3e59e0013e6c4415)",
"serde",
"serde_json",
"url",
@ -10080,6 +10137,63 @@ dependencies = [
"unicase",
]
[[package]]
name = "minidump-common"
version = "0.21.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5c4d14bcca0fd3ed165a03000480aaa364c6860c34e900cb2dafdf3b95340e77"
dependencies = [
"bitflags 2.9.0",
"debugid",
"num-derive",
"num-traits",
"range-map",
"scroll",
"smart-default 0.7.1",
]
[[package]]
name = "minidump-writer"
version = "0.8.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e2abcd9c8a1e6e1e9d56ce3627851f39a17ea83e17c96bc510f29d7e43d78a7d"
dependencies = [
"bitflags 2.9.0",
"byteorder",
"cfg-if",
"crash-context",
"goblin",
"libc",
"log",
"mach2",
"memmap2",
"memoffset",
"minidump-common",
"nix 0.28.0",
"procfs-core",
"scroll",
"tempfile",
"thiserror 1.0.69",
]
[[package]]
name = "minidumper"
version = "0.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9b4ebc9d1f8847ec1d078f78b35ed598e0ebefa1f242d5f83cd8d7f03960a7d1"
dependencies = [
"cfg-if",
"crash-context",
"libc",
"log",
"minidump-writer",
"parking_lot",
"polling",
"scroll",
"thiserror 1.0.69",
"uds",
]
[[package]]
name = "minimal-lexical"
version = "0.2.1"
@ -12069,6 +12183,12 @@ version = "0.3.32"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c"
[[package]]
name = "plain"
version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6"
[[package]]
name = "plist"
version = "1.7.1"
@ -12329,6 +12449,16 @@ dependencies = [
"yansi",
]
[[package]]
name = "procfs-core"
version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2d3554923a69f4ce04c4a754260c338f505ce22642d3830e049a399fc2059a29"
dependencies = [
"bitflags 2.9.0",
"hex",
]
[[package]]
name = "prodash"
version = "29.0.2"
@ -12979,6 +13109,15 @@ dependencies = [
"rand_core 0.5.1",
]
[[package]]
name = "range-map"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "12a5a2d6c7039059af621472a4389be1215a816df61aa4d531cfe85264aee95f"
dependencies = [
"num-traits",
]
[[package]]
name = "rangemap"
version = "1.5.1"
@ -13321,6 +13460,8 @@ dependencies = [
"clap",
"client",
"clock",
"crash-handler",
"crashes",
"dap",
"dap_adapters",
"debug_adapter_extension",
@ -13344,6 +13485,7 @@ dependencies = [
"libc",
"log",
"lsp",
"minidumper",
"node_runtime",
"paths",
"project",
@ -13532,6 +13674,7 @@ dependencies = [
"js-sys",
"log",
"mime",
"mime_guess",
"once_cell",
"percent-encoding",
"pin-project-lite",
@ -14260,6 +14403,26 @@ dependencies = [
"once_cell",
]
[[package]]
name = "scroll"
version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6ab8598aa408498679922eff7fa985c25d58a90771bd6be794434c5277eab1a6"
dependencies = [
"scroll_derive",
]
[[package]]
name = "scroll_derive"
version = "0.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1783eabc414609e28a5ba76aee5ddd52199f7107a0b24c2e9746a1ecc34a683d"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.101",
]
[[package]]
name = "scrypt"
version = "0.11.0"
@ -15005,6 +15168,17 @@ dependencies = [
"syn 1.0.109",
]
[[package]]
name = "smart-default"
version = "0.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0eb01866308440fc64d6c44d9e86c5cc17adfe33c4d6eed55da9145044d0ffc1"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.101",
]
[[package]]
name = "smol"
version = "2.0.2"
@ -17288,6 +17462,15 @@ version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971"
[[package]]
name = "uds"
version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "885c31f06fce836457fe3ef09a59f83fe8db95d270b11cd78f40a4666c4d1661"
dependencies = [
"libc",
]
[[package]]
name = "uds_windows"
version = "1.1.0"
@ -19743,9 +19926,11 @@ dependencies = [
"lyon_path",
"md-5",
"memchr",
"mime_guess",
"miniz_oxide",
"mio 1.0.3",
"naga",
"nix 0.28.0",
"nix 0.29.0",
"nom",
"num-bigint",
@ -20217,6 +20402,7 @@ dependencies = [
"command_palette",
"component",
"copilot",
"crashes",
"dap",
"dap_adapters",
"db",
@ -20284,6 +20470,7 @@ dependencies = [
"release_channel",
"remote",
"repl",
"reqwest 0.12.15 (git+https://github.com/zed-industries/reqwest.git?rev=951c770a32f1998d6e999cef3e59e0013e6c4415)",
"reqwest_client",
"rope",
"search",