diff --git a/.cargo/config.in b/.cargo/config.in index bcb6a234a1e8..7c237b263950 100644 --- a/.cargo/config.in +++ b/.cargo/config.in @@ -105,11 +105,6 @@ git = "https://github.com/mozilla/uniffi-rs.git" rev = "bc7ff8977bf38d0fdd1a458810b14f434d4dc4de" replace-with = "vendored-sources" -[source."git+https://github.com/rust-minidump/minidump-writer.git?rev=59179c83ba62e4378619c6967c0b8c0c077cac2d"] -git = "https://github.com/rust-minidump/minidump-writer.git" -rev = "59179c83ba62e4378619c6967c0b8c0c077cac2d" -replace-with = "vendored-sources" - [source."git+https://github.com/servo/rust-cssparser?rev=45bc47e2bcb846f1efb5aea156be5fe7d18624bf"] git = "https://github.com/servo/rust-cssparser" rev = "45bc47e2bcb846f1efb5aea156be5fe7d18624bf" diff --git a/Cargo.lock b/Cargo.lock index 8739ff3d8a21..849605e86bb6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -43,7 +43,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8512c9117059663fb5606788fbca3619e2a91dac0e3fe516242eab1fa6be5e44" dependencies = [ "alsa-sys", - "bitflags", + "bitflags 1.3.2", "libc", "nix 0.24.99", ] @@ -248,7 +248,7 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd92208b8b0c2477d1123f9fa898e35d9f7d9340e3f26ddda27bf37a608eff99" dependencies = [ - "bitflags", + "bitflags 1.3.2", ] [[package]] @@ -325,7 +325,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e73e25e6ae754b553f930c48af8f0e5ca71e641c419151e95bafd5644ff6e21b" dependencies = [ "base64", - "bitflags", + "bitflags 1.3.2", "cfg-if 1.0.0", "core-foundation", "devd-rs", @@ -420,7 +420,7 @@ version = "0.64.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4243e6031260db77ede97ad86c27e501d646a27ab57b59a574f725d98ab1fb4" dependencies = [ - "bitflags", + "bitflags 1.3.2", "cexpr", "clang-sys", "lazy_static", @@ -455,6 +455,13 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.999.999" +dependencies = [ + "bitflags 1.3.2", +] + [[package]] name = "bitreader" version = "0.3.6" @@ -733,7 +740,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2dbdf4bdacb33466e854ce889eee8dfd5729abf7ccd7664d0a2d60cd384440b" dependencies = [ "atty", - "bitflags", + "bitflags 1.3.2", "clap_derive", "clap_lex", "indexmap", @@ -821,7 +828,7 @@ version = "0.22.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2581bbab3b8ffc6fcbd550bf46c355135d16e9ff2a6ea032ad6b9bf1d7efe4fb" dependencies = [ - "bitflags", + "bitflags 1.3.2", "core-foundation", "core-graphics-types", "foreign-types", @@ -834,7 +841,7 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3a68b68b3446082644c91ac778bf50cd4104bfb002b5a6a7c44cca5a2c70788b" dependencies = [ - "bitflags", + "bitflags 1.3.2", "core-foundation", "foreign-types", "libc", @@ -918,14 +925,13 @@ dependencies = [ [[package]] name = "crash-context" -version = "0.5.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8bb7283a39cb25312513ccd35ce14098a4a8398e821a13130c76bb803c4a3b0" +checksum = "6d433b84b88830c0c253292a52fe43bd3f385668b6a39a84ce291e6e7db52724" dependencies = [ "cfg-if 1.0.0", "libc", "mach2", - "winapi", ] [[package]] @@ -1064,7 +1070,7 @@ version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6203cd567a2ae4382077cc2160738517462c93cf77f3910fa18b2a74549abc84" dependencies = [ - "bitflags", + "bitflags 1.3.2", "cubeb-sys", ] @@ -1075,7 +1081,7 @@ source = "git+https://github.com/mozilla/cubeb-coreaudio-rs?rev=93b5c01a131f65c8 dependencies = [ "atomic", "audio-mixer", - "bitflags", + "bitflags 1.3.2", "coreaudio-sys-utils", "cubeb-backend", "float-cmp", @@ -1113,7 +1119,7 @@ name = "d3d12" version = "0.6.0" source = "git+https://github.com/gfx-rs/d3d12-rs?rev=b940b1d71#b940b1d71ab7083ae80eec697872672dc1f2bd32" dependencies = [ - "bitflags", + "bitflags 1.3.2", "libloading", "winapi", ] @@ -1357,7 +1363,7 @@ dependencies = [ name = "dom" version = "0.1.0" dependencies = [ - "bitflags", + "bitflags 1.3.2", ] [[package]] @@ -1823,7 +1829,7 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" dependencies = [ - "bitflags", + "bitflags 1.3.2", "fuchsia-zircon-sys", ] @@ -2304,7 +2310,7 @@ version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7fc59e5f710e310e76e6707f86c561dd646f69a8876da9131703b2f717de818d" dependencies = [ - "bitflags", + "bitflags 1.3.2", "gpu-alloc-types", ] @@ -2314,7 +2320,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "54804d0d6bc9d7f26db4eaec1ad10def69b599315f487d32c334a80d1efe67a5" dependencies = [ - "bitflags", + "bitflags 1.3.2", ] [[package]] @@ -2323,7 +2329,7 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b0c02e1ba0bdb14e965058ca34e09c020f8e507a760df1121728e0aef68d57a" dependencies = [ - "bitflags", + "bitflags 1.3.2", "gpu-descriptor-types", "hashbrown", ] @@ -2334,7 +2340,7 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "363e3677e55ad168fef68cf9de3a4a310b53124c5e784c53a1d70e92d23f2126" dependencies = [ - "bitflags", + "bitflags 1.3.2", ] [[package]] @@ -2397,7 +2403,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3e372db8e5c0d213e0cd0b9be18be2aca3d44cf2fe30a9d46a65581cd454584" dependencies = [ "base64", - "bitflags", + "bitflags 1.3.2", "bytes", "headers-core", "http", @@ -2970,7 +2976,7 @@ version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "447a296f7aca299cfbb50f4e4f3d49451549af655fb7215d7f8c0c3d64bad42b" dependencies = [ - "bitflags", + "bitflags 1.3.2", "byteorder", "libc", "lmdb-rkv-sys", @@ -3160,7 +3166,7 @@ version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "de11355d1f6781482d027a3b4d4de7825dcedb197bf573e0596d00008402d060" dependencies = [ - "bitflags", + "bitflags 1.3.2", "block", "core-graphics-types", "foreign-types", @@ -3174,7 +3180,7 @@ version = "0.7.0" source = "git+https://github.com/mozilla/midir.git?rev=519e651241e867af3391db08f9ae6400bc023e18#519e651241e867af3391db08f9ae6400bc023e18" dependencies = [ "alsa", - "bitflags", + "bitflags 1.3.2", "coremidi", "js-sys", "libc", @@ -3216,7 +3222,7 @@ version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "694717103b2c15f8c16ddfaec1333fe15673bc22b10ffa6164427415701974ba" dependencies = [ - "bitflags", + "bitflags 1.3.2", "debugid", "enum-primitive-derive", "num-traits", @@ -3227,9 +3233,11 @@ dependencies = [ [[package]] name = "minidump-writer" -version = "0.7.0" -source = "git+https://github.com/rust-minidump/minidump-writer.git?rev=59179c83ba62e4378619c6967c0b8c0c077cac2d#59179c83ba62e4378619c6967c0b8c0c077cac2d" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8109e02c3cf4a587eea0bec18ccdfecc9041f91b5ebffa223b1e692c9a223c26" dependencies = [ + "bitflags 2.999.999", "byteorder", "cfg-if 1.0.0", "crash-context", @@ -3243,7 +3251,6 @@ dependencies = [ "scroll", "tempfile", "thiserror", - "winapi", ] [[package]] @@ -3481,7 +3488,7 @@ version = "0.11.0" source = "git+https://github.com/gfx-rs/naga?rev=9742f1616c3e3dd2cc9a5880616fc886c391bb9f#9742f1616c3e3dd2cc9a5880616fc886c391bb9f" dependencies = [ "bit-set", - "bitflags", + "bitflags 1.3.2", "codespan-reporting", "hexf-parse", "indexmap", @@ -3627,7 +3634,7 @@ version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfdda3d196821d6af13126e40375cdf7da646a96114af134d5f417a9a1dc8e1a" dependencies = [ - "bitflags", + "bitflags 1.3.2", "cfg-if 1.0.0", "libc", "static_assertions", @@ -3675,7 +3682,7 @@ source = "git+https://github.com/mozilla/application-services?rev=86c84c217036c1 name = "nsstring" version = "0.1.0" dependencies = [ - "bitflags", + "bitflags 1.3.2", "encoding_rs", ] @@ -4215,7 +4222,7 @@ name = "pulse" version = "0.3.0" source = "git+https://github.com/mozilla/cubeb-pulse-rs?rev=cf48897be5cbe147d051ebbbe1eaf5fd8fb6bbc9#cf48897be5cbe147d051ebbbe1eaf5fd8fb6bbc9" dependencies = [ - "bitflags", + "bitflags 1.3.2", "pulse-ffi", ] @@ -4350,7 +4357,7 @@ version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" dependencies = [ - "bitflags", + "bitflags 1.3.2", ] [[package]] @@ -4406,7 +4413,7 @@ checksum = "9f0ea3af1393b22f8fe25615b6fa5d13072b7b622e66acffc8b12b2baa0342b1" dependencies = [ "arrayref", "bincode", - "bitflags", + "bitflags 1.3.2", "byteorder", "id-arena", "lazy_static", @@ -4428,7 +4435,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "300a51053b1cb55c80b7a9fde4120726ddf25ca241a1cbb926626f62fb136bff" dependencies = [ "base64", - "bitflags", + "bitflags 1.3.2", "serde", ] @@ -4470,7 +4477,7 @@ version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "01e213bc3ecb39ac32e81e51ebe31fd888a940515173e3a18a35f8c6e896422a" dependencies = [ - "bitflags", + "bitflags 1.3.2", "fallible-iterator", "fallible-streaming-iterator", "hashlink", @@ -4602,7 +4609,7 @@ dependencies = [ name = "selectors" version = "0.22.0" dependencies = [ - "bitflags", + "bitflags 1.3.2", "cssparser", "derive_more", "fxhash", @@ -4887,7 +4894,7 @@ version = "0.2.0+1.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "246bfa38fe3db3f1dfc8ca5a2cdeb7348c78be2112740cc0ec8ef18b6d94f830" dependencies = [ - "bitflags", + "bitflags 1.3.2", "num-traits", ] @@ -4961,7 +4968,7 @@ dependencies = [ "arrayvec", "atomic_refcell", "bindgen 0.64.0", - "bitflags", + "bitflags 1.3.2", "byteorder", "cssparser", "derive_more", @@ -5026,7 +5033,7 @@ name = "style_traits" version = "0.0.1" dependencies = [ "app_units", - "bitflags", + "bitflags 1.3.2", "cssparser", "euclid", "lazy_static", @@ -6008,7 +6015,7 @@ name = "webrender" version = "0.62.0" dependencies = [ "bincode", - "bitflags", + "bitflags 1.3.2", "build-parallel", "byteorder", "derive_more", @@ -6045,7 +6052,7 @@ name = "webrender_api" version = "0.62.0" dependencies = [ "app_units", - "bitflags", + "bitflags 1.3.2", "byteorder", "crossbeam-channel", "euclid", @@ -6092,7 +6099,7 @@ dependencies = [ name = "webrender_build" version = "0.0.2" dependencies = [ - "bitflags", + "bitflags 1.3.2", "lazy_static", "serde", ] @@ -6123,7 +6130,7 @@ source = "git+https://github.com/gfx-rs/wgpu?rev=73b4257b17cc62ecc8df6d6aa3730bd dependencies = [ "arrayvec", "bit-vec", - "bitflags", + "bitflags 1.3.2", "codespan-reporting", "fxhash", "log", @@ -6148,7 +6155,7 @@ dependencies = [ "arrayvec", "ash", "bit-set", - "bitflags", + "bitflags 1.3.2", "block", "core-graphics-types", "d3d12", @@ -6181,7 +6188,7 @@ name = "wgpu-types" version = "0.15.0" source = "git+https://github.com/gfx-rs/wgpu?rev=73b4257b17cc62ecc8df6d6aa3730bd9c6cba4b9#73b4257b17cc62ecc8df6d6aa3730bd9c6cba4b9" dependencies = [ - "bitflags", + "bitflags 1.3.2", "js-sys", "serde", "web-sys", diff --git a/Cargo.toml b/Cargo.toml index 4ad1cf50d862..6c893d86400f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -93,6 +93,9 @@ vcpkg = { path = "build/rust/vcpkg" } # Helper crate for integration in the gecko build system. mozbuild = { path = "build/rust/mozbuild" } +# Patch bitflags 2.0 to 1.0 while not too many crates use 2.0 features +bitflags = { path = "build/rust/bitflags" } + # Patch cfg-if 0.1 to 1.0 cfg-if = { path = "build/rust/cfg-if" } @@ -160,7 +163,6 @@ firefox-on-glean = { path = "toolkit/components/glean/api" } libudev-sys = { path = "dom/webauthn/libudev-sys" } packed_simd = { package = "packed_simd_2", git = "https://github.com/hsivonen/packed_simd", rev="412f9a0aa556611de021bde89dee8fefe6e0fbbd" } midir = { git = "https://github.com/mozilla/midir.git", rev = "519e651241e867af3391db08f9ae6400bc023e18" } -minidump-writer = { git = "https://github.com/rust-minidump/minidump-writer.git", rev = "59179c83ba62e4378619c6967c0b8c0c077cac2d" } # warp 0.3.3 + https://github.com/seanmonstar/warp/pull/1007 warp = { git = "https://github.com/glandium/warp", rev = "4af45fae95bc98b0eba1ef0db17e1dac471bb23d" } diff --git a/build/rust/bitflags/Cargo.toml b/build/rust/bitflags/Cargo.toml new file mode 100644 index 000000000000..0605262d98c0 --- /dev/null +++ b/build/rust/bitflags/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "bitflags" +version = "2.999.999" +edition = "2018" +license = "MPL-2.0" + +[lib] +path = "lib.rs" + +[dependencies.bitflags] +version = "1.0" diff --git a/build/rust/bitflags/lib.rs b/build/rust/bitflags/lib.rs new file mode 100644 index 000000000000..8554fa95fdd9 --- /dev/null +++ b/build/rust/bitflags/lib.rs @@ -0,0 +1,5 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +pub use bitflags::*; diff --git a/supply-chain/audits.toml b/supply-chain/audits.toml index e8204c696d7f..9bb874e04443 100644 --- a/supply-chain/audits.toml +++ b/supply-chain/audits.toml @@ -313,6 +313,12 @@ criteria = "safe-to-deploy" version = "0.6.3" notes = "Another crate I own via contain-rs that is ancient and in maintenance mode but otherwise perfectly fine." +[[audits.bitflags]] +who = "Alex Franchuk " +criteria = "safe-to-deploy" +delta = "1.3.2 -> 2.0.2" +notes = "Removal of some unsafe code/methods. No changes to externals, just some refactoring (mostly internal)." + [[audits.block-buffer]] who = "Mike Hommey " criteria = "safe-to-deploy" @@ -458,6 +464,16 @@ criteria = "safe-to-deploy" version = "0.5.1" notes = "Mozilla employees contributed to this crate and the remaining code was fully audited" +[[audits.crash-context]] +who = "Alex Franchuk " +criteria = "safe-to-deploy" +delta = "0.5.1 -> 0.6.0" +notes = """ +There are few changes. The main change is the removal of `winapi` in favor of +manually-generated bindings (which are minimal). The few small bugfixes are +sound. +""" + [[audits.crossbeam-channel]] who = "Mike Hommey " criteria = "safe-to-deploy" @@ -1408,6 +1424,12 @@ who = "Bobby Holley " criteria = "safe-to-deploy" delta = "0.7.0 -> 0.7.0@git:7d76616d27b9dc87fe3a94639b8b4f947d52a6aa" +[[audits.minidump-writer]] +who = "Alex Franchuk " +criteria = "safe-to-deploy" +delta = "0.7.0 -> 0.8.0" +notes = "The code in this crate was written or reviewed by Mozilla employees, the crate it evolved from was written specifically for gecko." + [[audits.miniz_oxide]] who = "Mike Hommey " criteria = "safe-to-deploy" diff --git a/supply-chain/config.toml b/supply-chain/config.toml index c8100acead66..6e872f4eb85c 100644 --- a/supply-chain/config.toml +++ b/supply-chain/config.toml @@ -87,10 +87,6 @@ notes = "This is a first-party crate which is also published to crates.io. We ce audit-as-crates-io = true notes = "This is a pinned version of the upstream code, presumably to get a fix that hadn't been released yet. We should consider switching to the latest official release." -[policy.minidump-writer] -audit-as-crates-io = true -notes = "This is a pinned version of the upstream code, presumably to get a fix that hadn't been released yet. We should consider switching to the latest official release." - [policy."mio:0.6.23"] audit-as-crates-io = true notes = "Version 0.6.23 is a local fork of upstream which just twiddles some dependencies." diff --git a/third_party/rust/crash-context/.cargo-checksum.json b/third_party/rust/crash-context/.cargo-checksum.json index b509dc407b09..308ccffe9211 100644 --- a/third_party/rust/crash-context/.cargo-checksum.json +++ b/third_party/rust/crash-context/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"CHANGELOG.md":"314a7e0b67fad194bbf9b7a3fe0e6ce6855545b16102c96d04dbb99d4b116507","Cargo.toml":"e4e9c2b053fd3370115968d95fc2f1a7a7163e59c55bf0e624d3c7279ed0fda4","LICENSE-APACHE":"8173d5c29b4f956d532781d2b86e4e30f83e6b7878dce18c919451d6ba707c90","LICENSE-MIT":"090a294a492ab2f41388252312a65cf2f0e423330b721a68c6665ac64766753b","README.md":"5df5b51de9b86b2e724954224209463a48f8549fd023bcb10c1d9cecc754fff2","release.toml":"287ba3b6c89e3b289eae59827d36d6eb6e27b88cc2ada2c0d9a663c8b487117e","src/lib.rs":"26957a6a2555ab82aa9b6d3d1f24efaf20753d6c5eb1510395789283890ac1d1","src/linux.rs":"744008378bfe2d2bbe59d6bbbfb458a5f6401d4a4f8834dbc09e0d0b172b45cc","src/linux/getcontext.rs":"4164236732556d71cbb9e04bf4f2b41fd6f51f9bb94dfb974158cc5f49c3c789","src/linux/getcontext/aarch64.rs":"1193e68f06f7f2f4d3e64d80a196804e6cdfd03643ac50332c7af10928a5eccb","src/linux/getcontext/arm.rs":"682f163f4a96c21930e37427a6d687efc68199cbd8a9125b34d99a81280dd31b","src/linux/getcontext/x86.rs":"9f83062e99204d6ed24001be4d3b0d39974ab7a644003fb503795fcdf9316e87","src/linux/getcontext/x86_64.rs":"278ee4e5c64230da96c018ae2c539d1e3203f0ad4c9a9750044c2f88708f091e","src/mac.rs":"13d25443466d387eabf28adae361708f4b6297949c7eeb5bf1b38cb0ca13a418","src/mac/guard.rs":"115d1e8d5ac7bd9ecc666b11a0c584ed1e997160aacb0a1cc0f215ff5a1e9803","src/mac/ipc.rs":"2fc139ee5b70964bd726a30853d7fe9f74f7a6e0f8cf3d150e72a2ac802c1fba","src/mac/resource.rs":"78db4d344b285258befbb1c47cb4fba580f55ed03742242e561d4b3f383d1ada","src/windows.rs":"e22f7b5f1d067c08da1ff7c435ec3a3b2abe5cc9804490c4e26d1f08f0d2aefb","src/windows/ffi.rs":"87fb4d4e11ae19bf805f05b77daac81a265ca512ffc3506951a85974cdbb11a0","src/windows/ffi/aarch64.rs":"312ea235320a8b72b427857812637fe40e08aeef484b80fd6b5a0ca96d6b9c10","src/windows/ffi/x86_64.rs":"4d65503b229a995efce95536a11632b879d78fe4a1c7d38d89a378900c0aec86"},"package":"b8bb7283a39cb25312513ccd35ce14098a4a8398e821a13130c76bb803c4a3b0"} \ No newline at end of file +{"files":{"CHANGELOG.md":"5108348ce76a50393b51b3711f77910f419fd782eaf5b5aff0c6650c50ad65c4","Cargo.toml":"d116b62ca2aec61c49001c19a37d5768407ee3d31fd8b8835ab8e9565e25b884","LICENSE-APACHE":"8173d5c29b4f956d532781d2b86e4e30f83e6b7878dce18c919451d6ba707c90","LICENSE-MIT":"090a294a492ab2f41388252312a65cf2f0e423330b721a68c6665ac64766753b","README.md":"5df5b51de9b86b2e724954224209463a48f8549fd023bcb10c1d9cecc754fff2","release.toml":"287ba3b6c89e3b289eae59827d36d6eb6e27b88cc2ada2c0d9a663c8b487117e","src/lib.rs":"26957a6a2555ab82aa9b6d3d1f24efaf20753d6c5eb1510395789283890ac1d1","src/linux.rs":"cf05c1217709a60adeea08e8623438f68a18dea66758b194de0e07ff398b090d","src/linux/getcontext.rs":"4164236732556d71cbb9e04bf4f2b41fd6f51f9bb94dfb974158cc5f49c3c789","src/linux/getcontext/aarch64.rs":"1193e68f06f7f2f4d3e64d80a196804e6cdfd03643ac50332c7af10928a5eccb","src/linux/getcontext/arm.rs":"682f163f4a96c21930e37427a6d687efc68199cbd8a9125b34d99a81280dd31b","src/linux/getcontext/x86.rs":"9f83062e99204d6ed24001be4d3b0d39974ab7a644003fb503795fcdf9316e87","src/linux/getcontext/x86_64.rs":"278ee4e5c64230da96c018ae2c539d1e3203f0ad4c9a9750044c2f88708f091e","src/mac.rs":"13d25443466d387eabf28adae361708f4b6297949c7eeb5bf1b38cb0ca13a418","src/mac/guard.rs":"115d1e8d5ac7bd9ecc666b11a0c584ed1e997160aacb0a1cc0f215ff5a1e9803","src/mac/ipc.rs":"2fc139ee5b70964bd726a30853d7fe9f74f7a6e0f8cf3d150e72a2ac802c1fba","src/mac/resource.rs":"8289db9294a45d6148329d537530512913c456a182783059a832767e39c67295","src/windows.rs":"c6c043cf56cf0840cc1373edc4bd39cf829566d181e50589174745629ab2ad37","tests/capture_context.rs":"899e94c522cd015fd1f45230aff5c8970346ba20623da46cd34da892bbd07f7e"},"package":"6d433b84b88830c0c253292a52fe43bd3f385668b6a39a84ce291e6e7db52724"} \ No newline at end of file diff --git a/third_party/rust/crash-context/CHANGELOG.md b/third_party/rust/crash-context/CHANGELOG.md index 961e32934dc8..2724e6ad3a11 100644 --- a/third_party/rust/crash-context/CHANGELOG.md +++ b/third_party/rust/crash-context/CHANGELOG.md @@ -9,6 +9,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] - ReleaseDate +## [0.6.0] - 2023-04-03 +### Changed +- [PR#70](https://github.com/EmbarkStudios/crash-handling/pull/70) removed the `winapi` dependency in favor of embedded bindings to avoid dependencies. +- [PR#70](https://github.com/EmbarkStudios/crash-handling/pull/70) removed the asm implementations for Windows CPU context retrieval in favor of using `RtlCaptureContext`. This means that floating state is not captured, but is otherwise and improvement. + ## [0.5.1] - 2022-11-17 ### Fixed - [PR#66](https://github.com/EmbarkStudios/crash-handling/pull/66) (apparently) resolved [#65](https://github.com/EmbarkStudios/crash-handling/issues/65) by...changing from AT&T to Intel syntax. This shouldn't have changed anything, but it did, and I'm too tired and have other things to work on, so here we are. @@ -53,7 +58,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Initial pass of crash-context, Linux only -[Unreleased]: https://github.com/EmbarkStudios/crash-handling/compare/crash-context-0.5.1...HEAD +[Unreleased]: https://github.com/EmbarkStudios/crash-handling/compare/crash-context-0.6.0...HEAD +[0.6.0]: https://github.com/EmbarkStudios/crash-handling/compare/crash-context-0.5.1...crash-context-0.6.0 [0.5.1]: https://github.com/EmbarkStudios/crash-handling/compare/crash-context-0.5.0...crash-context-0.5.1 [0.5.0]: https://github.com/EmbarkStudios/crash-handling/compare/crash-context-0.4.0...crash-context-0.5.0 [0.4.0]: https://github.com/EmbarkStudios/crash-handling/compare/0.3.1...crash-context-0.4.0 diff --git a/third_party/rust/crash-context/Cargo.toml b/third_party/rust/crash-context/Cargo.toml index 7be488c08089..509b3df19dc9 100644 --- a/third_party/rust/crash-context/Cargo.toml +++ b/third_party/rust/crash-context/Cargo.toml @@ -13,7 +13,7 @@ edition = "2021" rust-version = "1.59.0" name = "crash-context" -version = "0.5.1" +version = "0.6.0" authors = [ "Embark ", "Jake Shadle ", @@ -40,7 +40,3 @@ version = "0.2" [target."cfg(target_os = \"macos\")".dependencies.mach2] version = "0.4" - -[target."cfg(target_os = \"windows\")".dependencies.winapi] -version = "0.3" -features = ["winnt"] diff --git a/third_party/rust/crash-context/src/linux.rs b/third_party/rust/crash-context/src/linux.rs index 5cd5579d2f6a..f9952c12d945 100644 --- a/third_party/rust/crash-context/src/linux.rs +++ b/third_party/rust/crash-context/src/linux.rs @@ -131,7 +131,7 @@ cfg_if::cfg_if! { #[derive(Clone)] #[doc(hidden)] pub struct mcontext_t { - pub gregs: [i64; 23], + pub gregs: [i32; 23], pub fpregs: *mut fpregset_t, pub oldmask: u32, pub cr2: u32, diff --git a/third_party/rust/crash-context/src/mac/resource.rs b/third_party/rust/crash-context/src/mac/resource.rs index e9553b09b442..c93acfe97a40 100644 --- a/third_party/rust/crash-context/src/mac/resource.rs +++ b/third_party/rust/crash-context/src/mac/resource.rs @@ -185,7 +185,7 @@ impl CpuResourceException { debug_assert_eq!(resource_exc_kind(code), ResourceKind::Cpu as u8); let flavor = Flavor::from(code); - let interval_seconds = ((code >> 7) & 0x1ffffff) as u64; + let interval_seconds = (code >> 7) & 0x1ffffff; let limit = (code & 0x7f) as u8; let consumed = subcode.map_or(0, |sc| sc & 0x7f) as u8; @@ -262,7 +262,7 @@ impl WakeupsResourceException { let flavor = Flavor::from(code); // Note that Apple has a bug in exc_resource.h where the masks in the // decode macros for the interval and the permitted wakeups have been swapped - let interval_seconds = ((code >> 20) & 0xfff) as u64; + let interval_seconds = (code >> 20) & 0xfff; let permitted = (code & 0xfffff) as u32; let observed = subcode.map_or(0, |sc| sc & 0xfffff) as u32; @@ -388,7 +388,7 @@ impl IoResourceException { debug_assert_eq!(resource_exc_kind(code), ResourceKind::Io as u8); let flavor = Flavor::from(code); - let interval_seconds = ((code >> 15) & 0x1ffff) as u64; + let interval_seconds = (code >> 15) & 0x1ffff; let limit_mib = (code & 0x7fff) as u16; let observed_mib = subcode.map_or(0, |sc| sc & 0x7fff) as u16; diff --git a/third_party/rust/crash-context/src/windows.rs b/third_party/rust/crash-context/src/windows.rs index 722e60772fea..231a608c08a8 100644 --- a/third_party/rust/crash-context/src/windows.rs +++ b/third_party/rust/crash-context/src/windows.rs @@ -1,18 +1,262 @@ -pub mod ffi; - /// Full Windows crash context pub struct CrashContext { /// The information on the exception. /// /// Note that this is a pointer into the actual memory of the crashed process, /// and is a pointer to an [EXCEPTION_POINTERS](https://learn.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-exception_pointers) - pub exception_pointers: *const ffi::EXCEPTION_POINTERS, + pub exception_pointers: *const EXCEPTION_POINTERS, /// The top level exception code from the exception_pointers. This is provided /// so that external processes don't need to use `ReadProcessMemory` to inspect /// the exception code - pub exception_code: u32, + pub exception_code: i32, /// The pid of the process that crashed pub process_id: u32, /// The thread id on which the exception occurred pub thread_id: u32, } + +#[link(name = "kernel32")] +extern "system" { + #[link_name = "RtlCaptureContext"] + pub fn capture_context(ctx_rec: *mut CONTEXT); +} + +cfg_if::cfg_if! { + if #[cfg(target_arch = "x86_64")] { + #[repr(C, align(16))] + pub struct M128A { + pub Low: u64, + pub High: i64, + } + + #[repr(C)] + pub struct CONTEXT_0_0 { + pub Header: [M128A; 2], + pub Legacy: [M128A; 8], + pub Xmm0: M128A, + pub Xmm1: M128A, + pub Xmm2: M128A, + pub Xmm3: M128A, + pub Xmm4: M128A, + pub Xmm5: M128A, + pub Xmm6: M128A, + pub Xmm7: M128A, + pub Xmm8: M128A, + pub Xmm9: M128A, + pub Xmm10: M128A, + pub Xmm11: M128A, + pub Xmm12: M128A, + pub Xmm13: M128A, + pub Xmm14: M128A, + pub Xmm15: M128A, + } + + #[repr(C, align(16))] + pub struct XSAVE_FORMAT { + pub ControlWord: u16, + pub StatusWord: u16, + pub TagWord: u8, + pub Reserved1: u8, + pub ErrorOpcode: u16, + pub ErrorOffset: u32, + pub ErrorSelector: u16, + pub Reserved2: u16, + pub DataOffset: u32, + pub DataSelector: u16, + pub Reserved3: u16, + pub MxCsr: u32, + pub MxCsr_Mask: u32, + pub FloatRegisters: [M128A; 8], + pub XmmRegisters: [M128A; 16], + pub Reserved4: [u8; 96], + } + + #[repr(C)] + pub union CONTEXT_0 { + pub FltSave: std::mem::ManuallyDrop, + pub Anonymous: std::mem::ManuallyDrop, + } + + #[repr(C, align(16))] + pub struct CONTEXT { + pub P1Home: u64, + pub P2Home: u64, + pub P3Home: u64, + pub P4Home: u64, + pub P5Home: u64, + pub P6Home: u64, + pub ContextFlags: u32, + pub MxCsr: u32, + pub SegCs: u16, + pub SegDs: u16, + pub SegEs: u16, + pub SegFs: u16, + pub SegGs: u16, + pub SegSs: u16, + pub EFlags: u32, + pub Dr0: u64, + pub Dr1: u64, + pub Dr2: u64, + pub Dr3: u64, + pub Dr6: u64, + pub Dr7: u64, + pub Rax: u64, + pub Rcx: u64, + pub Rdx: u64, + pub Rbx: u64, + pub Rsp: u64, + pub Rbp: u64, + pub Rsi: u64, + pub Rdi: u64, + pub R8: u64, + pub R9: u64, + pub R10: u64, + pub R11: u64, + pub R12: u64, + pub R13: u64, + pub R14: u64, + pub R15: u64, + pub Rip: u64, + pub Anonymous: CONTEXT_0, + pub VectorRegister: [M128A; 26], + pub VectorControl: u64, + pub DebugControl: u64, + pub LastBranchToRip: u64, + pub LastBranchFromRip: u64, + pub LastExceptionToRip: u64, + pub LastExceptionFromRip: u64, + } + } else if #[cfg(target_arch = "x86")] { + #[repr(C)] + pub struct FLOATING_SAVE_AREA { + pub ControlWord: u32, + pub StatusWord: u32, + pub TagWord: u32, + pub ErrorOffset: u32, + pub ErrorSelector: u32, + pub DataOffset: u32, + pub DataSelector: u32, + pub RegisterArea: [u8; 80], + pub Spare0: u32, + } + + #[repr(C, packed(4))] + pub struct CONTEXT { + pub ContextFlags: u32, + pub Dr0: u32, + pub Dr1: u32, + pub Dr2: u32, + pub Dr3: u32, + pub Dr6: u32, + pub Dr7: u32, + pub FloatSave: FLOATING_SAVE_AREA, + pub SegGs: u32, + pub SegFs: u32, + pub SegEs: u32, + pub SegDs: u32, + pub Edi: u32, + pub Esi: u32, + pub Ebx: u32, + pub Edx: u32, + pub Ecx: u32, + pub Eax: u32, + pub Ebp: u32, + pub Eip: u32, + pub SegCs: u32, + pub EFlags: u32, + pub Esp: u32, + pub SegSs: u32, + pub ExtendedRegisters: [u8; 512], + } + } else if #[cfg(target_arch = "aarch64")] { + #[repr(C)] + pub struct ARM64_NT_NEON128_0 { + pub Low: u64, + pub High: i64, + } + #[repr(C)] + pub union ARM64_NT_NEON128 { + pub Anonymous: std::mem::ManuallyDrop, + pub D: [f64; 2], + pub S: [f32; 4], + pub H: [u16; 8], + pub B: [u8; 16], + } + + #[repr(C)] + pub struct CONTEXT_0_0 { + pub X0: u64, + pub X1: u64, + pub X2: u64, + pub X3: u64, + pub X4: u64, + pub X5: u64, + pub X6: u64, + pub X7: u64, + pub X8: u64, + pub X9: u64, + pub X10: u64, + pub X11: u64, + pub X12: u64, + pub X13: u64, + pub X14: u64, + pub X15: u64, + pub X16: u64, + pub X17: u64, + pub X18: u64, + pub X19: u64, + pub X20: u64, + pub X21: u64, + pub X22: u64, + pub X23: u64, + pub X24: u64, + pub X25: u64, + pub X26: u64, + pub X27: u64, + pub X28: u64, + pub Fp: u64, + pub Lr: u64, + } + + #[repr(C)] + pub union CONTEXT_0 { + pub Anonymous: std::mem::ManuallyDrop, + pub X: [u64; 31], + } + + #[repr(C, align(16))] + pub struct CONTEXT { + pub ContextFlags: u32, + pub Cpsr: u32, + pub Anonymous: CONTEXT_0, + pub Sp: u64, + pub Pc: u64, + pub V: [ARM64_NT_NEON128; 32], + pub Fpcr: u32, + pub Fpsr: u32, + pub Bcr: [u32; 8], + pub Bvr: [u64; 8], + pub Wcr: [u32; 2], + pub Wvr: [u64; 2], + } + } +} + +pub type NTSTATUS = i32; +pub type BOOL = i32; + +#[repr(C)] +pub struct EXCEPTION_RECORD { + pub ExceptionCode: NTSTATUS, + pub ExceptionFlags: u32, + pub ExceptionRecord: *mut EXCEPTION_RECORD, + pub ExceptionAddress: *mut std::ffi::c_void, + pub NumberParameters: u32, + pub ExceptionInformation: [usize; 15], +} + +#[repr(C)] +pub struct EXCEPTION_POINTERS { + pub ExceptionRecord: *mut EXCEPTION_RECORD, + pub ContextRecord: *mut CONTEXT, +} diff --git a/third_party/rust/crash-context/src/windows/ffi.rs b/third_party/rust/crash-context/src/windows/ffi.rs deleted file mode 100644 index 96c88ce0ab9b..000000000000 --- a/third_party/rust/crash-context/src/windows/ffi.rs +++ /dev/null @@ -1,49 +0,0 @@ -//! Custom bindings to `CONTEXT` and some structures that relate to it, to both -//! deal with bugs in bindings, as well as not be dependent particularly on -//! `windows-sys` due the massive amount of version churn that crate introduces. -//! -//! Both [`winapi`](https://docs.rs/winapi/latest/winapi/) and -//! [`windows-sys`](https://docs.rs/windows-sys/latest/windows_sys/) have -//! incorrect bindings with regards to `CONTEXT` and its related structures. -//! These structures **must** be aligned to 16 bytes, but [are not](https://github.com/microsoft/win32metadata/issues/1044). - -#![allow(non_snake_case)] - -extern "C" { - /// Reimplementation of [`RtlCaptureContext`](https://learn.microsoft.com/en-us/windows/win32/api/winnt/nf-winnt-rtlcapturecontext) - /// - /// As noted above, the structures from `winapi` and `windows-sys` have - /// incorrect alignment. - /// - /// In addition, `RtlCaptureContext` only captures the state of the integer - /// registers, while this implementation additionally captures floating point - /// and vector state. - /// - /// The implementation is ported from Crashpad. - /// - /// - [x86](https://github.com/chromium/crashpad/blob/f742c1aa4aff1834dc55e97895f8cdfdfc945a21/util/misc/capture_context_win.asm) - /// - [aarch64](https://github.com/chromium/crashpad/blob/f742c1aa4aff1834dc55e97895f8cdfdfc945a21/util/misc/capture_context_win_arm64.asm) - pub fn capture_context(ctx: *mut CONTEXT); -} - -pub use winapi::um::winnt::EXCEPTION_RECORD; - -cfg_if::cfg_if! { - if #[cfg(target_arch = "x86_64")] { - mod x86_64; - pub use x86_64::*; - } else if #[cfg(target_arch = "x86")] { - compile_error!("Please file an issue if you care about this target"); - //mod x86; - } else if #[cfg(target_arch = "aarch64")] { - mod aarch64; - pub use aarch64::*; - } -} - -#[derive(Copy, Clone)] -#[repr(C)] -pub struct EXCEPTION_POINTERS { - pub ExceptionRecord: *mut EXCEPTION_RECORD, - pub ContextRecord: *mut CONTEXT, -} diff --git a/third_party/rust/crash-context/src/windows/ffi/aarch64.rs b/third_party/rust/crash-context/src/windows/ffi/aarch64.rs deleted file mode 100644 index c0b3bb9e563b..000000000000 --- a/third_party/rust/crash-context/src/windows/ffi/aarch64.rs +++ /dev/null @@ -1,143 +0,0 @@ -// Copyright 2019 The Crashpad Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#[derive(Copy, Clone)] -// Note this is intentionally using natural alignment -#[repr(C)] -pub union ARM64_NT_NEON128 { - pub Anonymous: ARM64_NT_NEON128_0, - pub D: [f64; 2], - pub S: [f32; 4], - pub H: [u16; 8], - pub B: [u8; 16], -} - -#[derive(Copy, Clone)] -// Note this is intentionally using natural alignment -#[repr(C)] -pub struct ARM64_NT_NEON128_0 { - pub Low: u64, - pub High: i64, -} - -#[derive(Copy, Clone)] -#[repr(C, align(16))] -pub struct CONTEXT { - pub ContextFlags: u32, - pub Cpsr: u32, - pub Anonymous: CONTEXT_0, - pub Sp: u64, - pub Pc: u64, - pub V: [ARM64_NT_NEON128; 32], - pub Fpcr: u32, - pub Fpsr: u32, - pub Bcr: [u32; 8], - pub Bvr: [u64; 8], - pub Wcr: [u32; 2], - pub Wvr: [u64; 2], -} - -#[derive(Copy, Clone)] -#[repr(C, align(16))] -pub union CONTEXT_0 { - pub Anonymous: CONTEXT_0_0, - pub X: [u64; 31], -} - -#[derive(Copy, Clone)] -#[repr(C, align(16))] -pub struct CONTEXT_0_0 { - pub X0: u64, - pub X1: u64, - pub X2: u64, - pub X3: u64, - pub X4: u64, - pub X5: u64, - pub X6: u64, - pub X7: u64, - pub X8: u64, - pub X9: u64, - pub X10: u64, - pub X11: u64, - pub X12: u64, - pub X13: u64, - pub X14: u64, - pub X15: u64, - pub X16: u64, - pub X17: u64, - pub X18: u64, - pub X19: u64, - pub X20: u64, - pub X21: u64, - pub X22: u64, - pub X23: u64, - pub X24: u64, - pub X25: u64, - pub X26: u64, - pub X27: u64, - pub X28: u64, - pub Fp: u64, - pub Lr: u64, -} - -std::arch::global_asm! { - ".text", - ".global capture_context", -"capture_context:", - // Save general purpose registers in context.regs[i]. - // The original x0 can't be recovered. - "stp x0, x1, [x0, #0x008]", - "stp x2, x3, [x0, #0x018]", - "stp x4, x5, [x0, #0x028]", - "stp x6, x7, [x0, #0x038]", - "stp x8, x9, [x0, #0x048]", - "stp x10, x11, [x0, #0x058]", - "stp x12, x13, [x0, #0x068]", - "stp x14, x15, [x0, #0x078]", - "stp x16, x17, [x0, #0x088]", - "stp x18, x19, [x0, #0x098]", - "stp x20, x21, [x0, #0x0a8]", - "stp x22, x23, [x0, #0x0b8]", - "stp x24, x25, [x0, #0x0c8]", - "stp x26, x27, [x0, #0x0d8]", - "stp x28, x29, [x0, #0x0e8]", - - // The original LR can't be recovered. - "str LR, [x0, #0x0f8]", - - // Use x1 as a scratch register. - "mov x1, SP", - // context.sp - "str x1, [x0, #0x100]", - - // The link register holds the return address for this function. - // context.pc - "str LR, [x0, #0x108]", - - // pstate should hold SPSR but NZCV are the only bits we know about. - "mrs x1, NZCV", - - // Enable Control flags, such as CONTEXT_ARM64, CONTEXT_CONTROL, - // CONTEXT_INTEGER - "ldr w1, =0x00400003", - - // Set ControlFlags /0x000/ and pstate /0x004/ at the same time. - "str x1, [x0, #0x000]", - - // Restore x1 from the saved context. - "ldr x1, [x0, #0x010]", - - // TODO(https://crashpad.chromium.org/bug/300): save floating-point registers - "ret", -} diff --git a/third_party/rust/crash-context/src/windows/ffi/x86_64.rs b/third_party/rust/crash-context/src/windows/ffi/x86_64.rs deleted file mode 100644 index e1ce8377586c..000000000000 --- a/third_party/rust/crash-context/src/windows/ffi/x86_64.rs +++ /dev/null @@ -1,250 +0,0 @@ -// Copyright 2015 The Crashpad Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#[derive(Copy, Clone)] -#[repr(C, align(16))] -pub struct M128A { - pub Low: u64, - pub High: i64, -} - -#[derive(Copy, Clone)] -#[repr(C, align(16))] -pub struct XSAVE_FORMAT { - pub ControlWord: u16, - pub StatusWord: u16, - pub TagWord: u8, - pub Reserved1: u8, - pub ErrorOpcode: u16, - pub ErrorOffset: u32, - pub ErrorSelector: u16, - pub Reserved2: u16, - pub DataOffset: u32, - pub DataSelector: u16, - pub Reserved3: u16, - pub MxCsr: u32, - pub MxCsr_Mask: u32, - pub FloatRegisters: [M128A; 8], - pub XmmRegisters: [M128A; 16], - pub Reserved4: [u8; 96], -} - -#[derive(Copy, Clone)] -#[repr(C, align(16))] -pub struct CONTEXT { - pub P1Home: u64, - pub P2Home: u64, - pub P3Home: u64, - pub P4Home: u64, - pub P5Home: u64, - pub P6Home: u64, - pub ContextFlags: u32, - pub MxCsr: u32, - pub SegCs: u16, - pub SegDs: u16, - pub SegEs: u16, - pub SegFs: u16, - pub SegGs: u16, - pub SegSs: u16, - pub EFlags: u32, - pub Dr0: u64, - pub Dr1: u64, - pub Dr2: u64, - pub Dr3: u64, - pub Dr6: u64, - pub Dr7: u64, - pub Rax: u64, - pub Rcx: u64, - pub Rdx: u64, - pub Rbx: u64, - pub Rsp: u64, - pub Rbp: u64, - pub Rsi: u64, - pub Rdi: u64, - pub R8: u64, - pub R9: u64, - pub R10: u64, - pub R11: u64, - pub R12: u64, - pub R13: u64, - pub R14: u64, - pub R15: u64, - pub Rip: u64, - pub Anonymous: CONTEXT_0, - pub VectorRegister: [M128A; 26], - pub VectorControl: u64, - pub DebugControl: u64, - pub LastBranchToRip: u64, - pub LastBranchFromRip: u64, - pub LastExceptionToRip: u64, - pub LastExceptionFromRip: u64, -} - -#[derive(Copy, Clone)] -#[repr(C, align(16))] -pub union CONTEXT_0 { - pub FltSave: XSAVE_FORMAT, - pub Anonymous: CONTEXT_0_0, -} - -#[derive(Copy, Clone)] -#[repr(C, align(16))] -pub struct CONTEXT_0_0 { - pub Header: [M128A; 2], - pub Legacy: [M128A; 8], - pub Xmm0: M128A, - pub Xmm1: M128A, - pub Xmm2: M128A, - pub Xmm3: M128A, - pub Xmm4: M128A, - pub Xmm5: M128A, - pub Xmm6: M128A, - pub Xmm7: M128A, - pub Xmm8: M128A, - pub Xmm9: M128A, - pub Xmm10: M128A, - pub Xmm11: M128A, - pub Xmm12: M128A, - pub Xmm13: M128A, - pub Xmm14: M128A, - pub Xmm15: M128A, -} - -std::arch::global_asm! { - ".text", - ".global capture_context", -"capture_context:", - ".seh_proc capture_context", - "push rbp", - ".seh_pushreg rbp", - "mov rbp, rsp", - ".seh_setframe rbp, 0", - - // Note that 16-byte stack alignment is not maintained because this function - // does not call out to any other. - - // pushfq first, because some instructions affect rflags. rflags will be in [rbp-8]. - "pushfq", - ".seh_stackalloc 8", - ".seh_endprologue", - - "mov dword ptr [rcx+0x30], 0x10000", // ContextFlags - - // General-purpose registers whose values haven’t changed can be captured directly. - "mov qword ptr [rcx+0x78], rax", // Rax - "mov qword ptr [rcx+0x88], rdx", // Rdx - "mov qword ptr [rcx+0x90], rbx", // Rbx - "mov qword ptr [rcx+0xa8], rsi", // Rsi - "mov qword ptr [rcx+0xb0], rdi", // Rdi - "mov qword ptr [rcx+0xb8], r8", // R8 - "mov qword ptr [rcx+0xc0], r9", // R9 - "mov qword ptr [rcx+0xc8], r10", // R10 - "mov qword ptr [rcx+0xd0], r11", // R11 - "mov qword ptr [rcx+0xd8], r12", // R12 - "mov qword ptr [rcx+0xe0], r13", // R13 - "mov qword ptr [rcx+0xe8], r14", // R14 - "mov qword ptr [rcx+0xf0], r15", // R15 - - // Because of the calling convention, there’s no way to recover the value of - // the caller’s rcx as it existed prior to calling this function. This - // function captures a snapshot of the register state at its return, which - // involves rcx containing a pointer to its first argument. - "mov qword ptr [rcx+0x80], rcx", // Rcx - - // Now that the original value of rax has been saved, it can be repurposed to - // hold other registers’ values. - - // Save mxcsr. This is duplicated in context->FltSave.MxCsr, saved by fxsave - // below. - "stmxcsr [rcx+0x34]", // MxCsr - - // Segment registers. - "mov word ptr [rcx+0x38], cs", // SegCs - "mov word ptr [rcx+0x3a], ds", // SegDs - "mov word ptr [rcx+0x3c], es", // SegEs - "mov word ptr [rcx+0x3e], fs", // SegFs - "mov word ptr [rcx+0x40], gs", // SegGs - "mov word ptr [rcx+0x42], ss", // SegSs - - // The original rflags was saved on the stack above. Note that the CONTEXT - // structure only stores eflags, the low 32 bits. The high 32 bits in rflags - // are reserved. - "mov rax, [rbp-8]", - "mov dword ptr [rcx+0x44], eax", // EFlags - - // rsp was saved in rbp in this function’s prologue, but the caller’s rsp is - // 16 more than this value: 8 for the original rbp saved on the stack in this - // function’s prologue, and 8 for the return address saved on the stack by the - // call instruction that reached this function. - "lea rax, qword ptr [rbp+16]", - "mov qword ptr [rcx+0x98], rax", - - // The original rbp was saved on the stack in this function’s prologue. - "mov rax, rbp", - "mov qword ptr [rcx+0xa0], rax", - - // rip can’t be accessed directly, but the return address saved on the stack by - // the call instruction that reached this function can be used. - "mov rax, [rbp+8]", - "mov qword ptr [rcx+0xf8], rax", - - // Zero out the fxsave area before performing the fxsave. Some of the fxsave - // area may not be written by fxsave, and some is definitely not written by - // fxsave. This also zeroes out the rest of the CONTEXT structure to its end, - // including the unused VectorRegister and VectorControl fields, and the debug - // control register fields. - "mov rbx, rcx", - "cld", - "lea rdi, [rcx+0x100]", - "xor rax, rax", - "mov rcx, 122", - "rep stosq", - "mov rcx, rbx", - - // Save the floating point (including SSE) state. The CONTEXT structure is - // declared as 16-byte-aligned, which is correct for this operation. - "fxsave [rcx+0x100]", - - // TODO: AVX/xsave support. https://crashpad.chromium.org/bug/58 - - // The register parameter home address fields aren’t used, so zero them out. - "mov qword ptr [rcx+0], 0", - "mov qword ptr [rcx+0x8], 0", - "mov qword ptr [rcx+0x10], 0", - "mov qword ptr [rcx+0x18], 0", - "mov qword ptr [rcx+0x20], 0", - - // The debug registers can’t be read from user code, so zero them out in the - // CONTEXT structure. context->ContextFlags doesn’t indicate that they are - // present. - "mov qword ptr [rcx+0x48], 0", - "mov qword ptr [rcx+0x50], 0", - "mov qword ptr [rcx+0x58], 0", - "mov qword ptr [rcx+0x60], 0", - "mov qword ptr [rcx+0x68], 0", - "mov qword ptr [rcx+0x70], 0", - "mov qword ptr [rcx+0x78], 0", - - // Clean up by restoring clobbered registers, even those considered volatile by - // the ABI, so that the captured context represents the state at this - // function’s exit. - "mov rax, [rcx+0x78]", - "mov rbx, [rcx+0x90]", - "mov rdi, [rcx+0xb0]", - "popfq", - - "pop rbp", - "ret", - ".seh_endproc", -} diff --git a/third_party/rust/crash-context/tests/capture_context.rs b/third_party/rust/crash-context/tests/capture_context.rs new file mode 100644 index 000000000000..641e1dd7069c --- /dev/null +++ b/third_party/rust/crash-context/tests/capture_context.rs @@ -0,0 +1,49 @@ +#[test] +fn captures() { + fn one() { + two(); + } + + fn two() { + three(); + } + + #[allow(unsafe_code)] + fn three() { + cfg_if::cfg_if! { + if #[cfg(target_os = "windows")] { + let ctx = unsafe { + let mut ctx = std::mem::MaybeUninit::zeroed(); + crash_context::capture_context(ctx.as_mut_ptr()); + + ctx.assume_init() + }; + + cfg_if::cfg_if! { + if #[cfg(target_arch = "x86_64")] { + assert!(ctx.Rbp != 0); + assert!(ctx.Rsp != 0); + assert!(ctx.Rip != 0); + } else if #[cfg(target_arch = "x86")] { + assert!(ctx.Ebp != 0); + assert!(ctx.Esp != 0); + assert!(ctx.Eip != 0); + } + } + } else if #[cfg(all(target_os = "linux", target_arch = "x86_64"))] { + let ctx = unsafe { + let mut ctx = std::mem::MaybeUninit::zeroed(); + assert_eq!(crash_context::crash_context_getcontext(ctx.as_mut_ptr()), 0); + ctx.assume_init() + }; + + let gregs = &ctx.uc_mcontext.gregs; + assert!(gregs[libc::REG_RBP as usize] != 0); + assert!(gregs[libc::REG_RSP as usize] != 0); + assert!(gregs[libc::REG_RIP as usize] != 0); + } + } + } + + one(); +} diff --git a/third_party/rust/minidump-writer/.cargo-checksum.json b/third_party/rust/minidump-writer/.cargo-checksum.json index 5515d4fc75fb..682981af2321 100644 --- a/third_party/rust/minidump-writer/.cargo-checksum.json +++ b/third_party/rust/minidump-writer/.cargo-checksum.json @@ -1 +1 @@ -{"files":{".github/CODEOWNERS":"4490b855c489d4acccaceb5f0e928a3aa3bd4a68e02abf17a88ee4c8c1b62ca0",".github/workflows/audit.yml":"ad127bb398a2976775d830bb2741094e6aa38442b1256bad165c2ca29b525fbb",".github/workflows/ci.yml":"34d790c72ec92a7b7d258b09f8c636db970d8f8659155c9d01bf4654b48a4881","CHANGELOG.md":"8a780dacaff5ac46d696c643fef3b6356664b8c15a827bc8f569a0b9cb475112","Cargo.toml":"3ea667baa1891ec54fae596566c886c776a3752675bae151dff538417912617d","LICENSE":"1ecdd8e8977af83c07c5f97bec87b47d27059b7ea323ca3160fbfa2314f5d99c","README.md":"ba247891c565089e59211c414755ed4693b81371233fa3b398a501b545f6b962","build.rs":"689cd32a441f5011f694a9f86bc03bc27c2a09bcb4130f47e04fe00bb069b1b5","deny.toml":"38ad2754e3f2743a97efb12566a9e051c690845720eea76438caafdb5a11e1ec","examples/synthetic.rs":"cd13bd0bba64a1d8c8c326bb1ce1818bead6904e5708418fd09edeaef1437c24","release.toml":"f554067378aec602383b96e5fa63427136533a7dd00137fd0664b279fb8fcc56","src/bin/test.rs":"e8c83dcd5d9d7c10ada72bd2135387f66ed8bb803a0bed634e37272c0a01215b","src/dir_section.rs":"b7c83b16acefb4327b406612e1a667dffb91f86bec40f9330171dba8d10346ff","src/lib.rs":"6f393273ea6b354f412e70c9a4925fe2e646bc477591962c96a61aed9fde4e3b","src/linux.rs":"65d1249e80a3c3b6ab8c4361891b5ef35fe68f91253f6378ae03a0ad59ecd807","src/linux/android.rs":"7671a1faddd10c7dd3d73d9b7c3e933673621a8dd469df49c524ec95d3e1ef64","src/linux/app_memory.rs":"5f093e4ed0aecc6086366a9c09658761fdd3b0e6e9ff2111690719e56612df64","src/linux/auxv_reader.rs":"085cf059f3c117c59e60f8a7f108a81ea14cd409fe4209b246035f9495eb722c","src/linux/crash_context.rs":"069d949c7a9fc23a1e8710f7c018cacf71af2326a2dd6ca0283d492c5253107a","src/linux/crash_context/aarch64.rs":"158d02200b25a7ca029ff5132ba3b7f76a05c9976ff529a5658523aff370e4d2","src/linux/crash_context/arm.rs":"a4f41aae015937d3dccdf759df84bc657cf457d8baaf07711617d17f4b40f6f1","src/linux/crash_context/x86.rs":"cf304f829c401df9dd7048591b152c4adc2744f622d3b6c264676d495a8f7a8c","src/linux/crash_context/x86_64.rs":"dceabbcf4d3c4ff5ad7658daa7dec3349cad9b61091385bcd868de6b11eb4957","src/linux/dso_debug.rs":"d9ce10ce3000b9448a5b8dfd3a134dbf44b72e5a0424d6ab3f8e4c92b66795a2","src/linux/dumper_cpu_info.rs":"76558ffc85386e416bbfc49adc550f61fb206dfbfb0b6a25f620a5fc91f32bc1","src/linux/dumper_cpu_info/arm.rs":"6fc140181f3a32504c3b66f0235136e730424be830602c87cfbeb1dfb4c1cec3","src/linux/dumper_cpu_info/x86_mips.rs":"f092d15da921b65cf9efb4cf28c0294b75b5d772c927322fff837bd377dd3b2b","src/linux/errors.rs":"fa35b4f75f13b272b417d1d26daea34933ca681ddeeba7d1a575778b8fd150c3","src/linux/maps_reader.rs":"0829b56fb80ad66761f5e0dad0f690befd4d2fa83d3756bf7a98e85e3746b8dc","src/linux/minidump_writer.rs":"625e125db5cef1cf14cdcd6e941a8b17aa669c53aa3760994f835f728cc0324a","src/linux/ptrace_dumper.rs":"463d8ffe5c4253d025047f6c4e2364b472babb9618c2cc9ecc81e6c8382524a4","src/linux/sections.rs":"b2c85a47138fa822fa0797687af60b1f7b6ae89acfa8f39b7f347d563d03d79a","src/linux/sections/app_memory.rs":"52fdfe9622a395763fef94c5fea924935fcd86103c3eb1b0fb8d7ea61fd3e783","src/linux/sections/exception_stream.rs":"e1b73b5168506f8804479206ef0941aca5f792500cc56c5c17db55cd6b273a99","src/linux/sections/mappings.rs":"acdf6a3d5109f32e2561893ff444ecf56167ec7c6564d8d5126399c88b92e5d1","src/linux/sections/memory_list_stream.rs":"f2d5b33fb4167b502dc8e74371d50b4ad66e0b48f541fe16bcbf5fb62491bf2d","src/linux/sections/systeminfo_stream.rs":"02373c97d4caeb66f4601c066d430ad2929b5584eaa0af3be1dc51ef818e5cb8","src/linux/sections/thread_list_stream.rs":"51f3e12736321f8d9ed46a9618b97e1372b135c0bee0604a49ce533dc3ab3db7","src/linux/sections/thread_names_stream.rs":"2a123335626e941cf0a3349f9327c3e7606af593a8370ef5f71325012107b91f","src/linux/thread_info.rs":"129db24120fee7bc01e5bf5a0bf0b19b6f82581530905f90f79ae7b7f2b724fb","src/linux/thread_info/aarch64.rs":"f3528e541328c29a8e665ecd5d1e435f8a41010d27c58f202563995db048cabb","src/linux/thread_info/arm.rs":"5bcdf554d62134f4b9e822dcc4ce6b0f3f2e44c312da971ccb7fbb1200504d85","src/linux/thread_info/mips.rs":"332d7888bb08a36d3b77023a4a0385193a07b1c6c5bf0e91aacb5d948ba8b903","src/linux/thread_info/x86.rs":"ca3a9a705bf7d9383c271cee9a55216e1e2c90e9b5346af8a610c1b527b26568","src/mac.rs":"4671ad90c433db559ec633c880c3fe083f38a2e185ef4fc99577318526076519","src/mac/errors.rs":"696473d1187a0f003409e3ac0fc83a02cafbad8451a62bda868b08acc36e7443","src/mac/mach.rs":"c7f857b39a388316839a35fad5129ad2f67608a61e4b04bbd83957c005a3f991","src/mac/minidump_writer.rs":"d6f07685779c45f6b773d4163965f5dc5e0a73421937d9ec6b8e4d3320d23e85","src/mac/streams.rs":"82e1b9fefa26d98f1c0efdd98de0aed9a9ee9edf3e4b4f636212c73f8d3e464e","src/mac/streams/breakpad_info.rs":"9aafbc3f376050e39a2295e77a1b764223403ffdd47bded39efa9450a53b5a06","src/mac/streams/exception.rs":"316cf3b9ccb6b1bb3b431b4e927e4d68201f845d80e31fcaa6b80bcc30748147","src/mac/streams/memory_list.rs":"e507a1ada858ef535e3e211d91195901e9976ba0ff6cf601919d7cacb48c5e9f","src/mac/streams/misc_info.rs":"ed9fe394ded145cae62094adf3a9e454e23bfd5b6fab7871f0cf62c6a5e79017","src/mac/streams/module_list.rs":"0d735c07d162311d386aa40d5a80ebcbdc644df0dfc811d7c4b85a2fae51c5f9","src/mac/streams/system_info.rs":"4bd0d171c9d7c97afbacf6fd144d5554f0e46d47ae78f00b85331d6d1a1d24b3","src/mac/streams/thread_list.rs":"2b003e3409daebbd38ebc8a49a2c24e7a75b296d28f58a2c85114cf611174c1b","src/mac/streams/thread_names.rs":"2c8ca3a98b0c4ac9bd0373721324f32038569b70eb5b47bafe7de4cc3f76483b","src/mac/task_dumper.rs":"b22f42b11bb7e9af5976ec04cbf9f8bf4d1d70c3c7738b1072e7bd41e8d5af3c","src/mem_writer.rs":"44d594e4b8a4bedf28c61f89c34f13be42deb9a8820a1d3267dd9572d65d0c97","src/minidump_cpu.rs":"ccb3dc179699159883e539e29285f8f6ba936afb8ce8980dbcb5060a80b6618c","src/minidump_format.rs":"0094097dec5aadc2f69410a57eb9dfe1248f962be629679ea5d47aa1d94da70c","src/windows.rs":"92cb8dd27068a5a60c0f8ab2d23687c5ca3e61bd65b7ba4330cbcac278f5f1f2","src/windows/errors.rs":"9b8752122784417ed48b9c3fccc9bdabc6c4e6285cdb77c79723cba56cb0de82","src/windows/ffi.rs":"77b5de803caa2a47ce2e053d4280a9d6fefe174ae4106b79e093caf6162421c1","src/windows/minidump_writer.rs":"5dc67972d1c8eb9dd4fc80aa0bb3bc6eea411b52e955ef72b88f0773ce6266ce","tests/common/mod.rs":"44a9aa71736886c5f826d9b05095aa20995ffe561654eb6c87d8fb6f18b69308","tests/linux_minidump_writer.rs":"efdc875debbbe9f026c1a0258f0ee2ed4dc699e947761263ef7b1f36df52a372","tests/mac_minidump_writer.rs":"4e557715943e47f3134f5073537b22a97eac9d423e51c9d97b00103e117f0fc7","tests/ptrace_dumper.rs":"e97f41dbf1bf4ba9b8ec7cd308a250dfaf537f7cc73213f076d3f2ff8d14eddf","tests/task_dumper.rs":"3881899e4cfef0dae772d16b1a783497eebd2b58025394e0819cb03a0960d480","tests/windows_minidump_writer.rs":"171c299a608ed29af47bf60652260055df073bc2778462acb353d35754230c38"},"package":null} \ No newline at end of file +{"files":{"CHANGELOG.md":"3e6c3e83f4a0c326ab4709d0a933a3d28e1b71be87df340cc12bd6b6b4f9c0de","Cargo.lock":"407d37b45cf471efcaf635b807d8a864cb08809f521da0429302bf43bd3cb537","Cargo.toml":"d335325fd2323940bc0717868d11774af4156ba60bd50075e82e9cbcf58c4871","LICENSE":"1ecdd8e8977af83c07c5f97bec87b47d27059b7ea323ca3160fbfa2314f5d99c","README.md":"ba247891c565089e59211c414755ed4693b81371233fa3b398a501b545f6b962","build.rs":"689cd32a441f5011f694a9f86bc03bc27c2a09bcb4130f47e04fe00bb069b1b5","deny.toml":"38ad2754e3f2743a97efb12566a9e051c690845720eea76438caafdb5a11e1ec","examples/synthetic.rs":"cd13bd0bba64a1d8c8c326bb1ce1818bead6904e5708418fd09edeaef1437c24","release.toml":"f554067378aec602383b96e5fa63427136533a7dd00137fd0664b279fb8fcc56","src/bin/test.rs":"ed3145df7617bb7a14fb5005f66c867f8bf649c4bd5794bce1357ed0a7ffa502","src/dir_section.rs":"b7c83b16acefb4327b406612e1a667dffb91f86bec40f9330171dba8d10346ff","src/lib.rs":"6f393273ea6b354f412e70c9a4925fe2e646bc477591962c96a61aed9fde4e3b","src/linux.rs":"65d1249e80a3c3b6ab8c4361891b5ef35fe68f91253f6378ae03a0ad59ecd807","src/linux/android.rs":"7671a1faddd10c7dd3d73d9b7c3e933673621a8dd469df49c524ec95d3e1ef64","src/linux/app_memory.rs":"5f093e4ed0aecc6086366a9c09658761fdd3b0e6e9ff2111690719e56612df64","src/linux/auxv_reader.rs":"085cf059f3c117c59e60f8a7f108a81ea14cd409fe4209b246035f9495eb722c","src/linux/crash_context.rs":"069d949c7a9fc23a1e8710f7c018cacf71af2326a2dd6ca0283d492c5253107a","src/linux/crash_context/aarch64.rs":"158d02200b25a7ca029ff5132ba3b7f76a05c9976ff529a5658523aff370e4d2","src/linux/crash_context/arm.rs":"a4f41aae015937d3dccdf759df84bc657cf457d8baaf07711617d17f4b40f6f1","src/linux/crash_context/x86.rs":"cf304f829c401df9dd7048591b152c4adc2744f622d3b6c264676d495a8f7a8c","src/linux/crash_context/x86_64.rs":"dceabbcf4d3c4ff5ad7658daa7dec3349cad9b61091385bcd868de6b11eb4957","src/linux/dso_debug.rs":"d9ce10ce3000b9448a5b8dfd3a134dbf44b72e5a0424d6ab3f8e4c92b66795a2","src/linux/dumper_cpu_info.rs":"76558ffc85386e416bbfc49adc550f61fb206dfbfb0b6a25f620a5fc91f32bc1","src/linux/dumper_cpu_info/arm.rs":"6fc140181f3a32504c3b66f0235136e730424be830602c87cfbeb1dfb4c1cec3","src/linux/dumper_cpu_info/x86_mips.rs":"f092d15da921b65cf9efb4cf28c0294b75b5d772c927322fff837bd377dd3b2b","src/linux/errors.rs":"fa35b4f75f13b272b417d1d26daea34933ca681ddeeba7d1a575778b8fd150c3","src/linux/maps_reader.rs":"0829b56fb80ad66761f5e0dad0f690befd4d2fa83d3756bf7a98e85e3746b8dc","src/linux/minidump_writer.rs":"625e125db5cef1cf14cdcd6e941a8b17aa669c53aa3760994f835f728cc0324a","src/linux/ptrace_dumper.rs":"463d8ffe5c4253d025047f6c4e2364b472babb9618c2cc9ecc81e6c8382524a4","src/linux/sections.rs":"b2c85a47138fa822fa0797687af60b1f7b6ae89acfa8f39b7f347d563d03d79a","src/linux/sections/app_memory.rs":"52fdfe9622a395763fef94c5fea924935fcd86103c3eb1b0fb8d7ea61fd3e783","src/linux/sections/exception_stream.rs":"e1b73b5168506f8804479206ef0941aca5f792500cc56c5c17db55cd6b273a99","src/linux/sections/mappings.rs":"acdf6a3d5109f32e2561893ff444ecf56167ec7c6564d8d5126399c88b92e5d1","src/linux/sections/memory_list_stream.rs":"f2d5b33fb4167b502dc8e74371d50b4ad66e0b48f541fe16bcbf5fb62491bf2d","src/linux/sections/systeminfo_stream.rs":"02373c97d4caeb66f4601c066d430ad2929b5584eaa0af3be1dc51ef818e5cb8","src/linux/sections/thread_list_stream.rs":"51f3e12736321f8d9ed46a9618b97e1372b135c0bee0604a49ce533dc3ab3db7","src/linux/sections/thread_names_stream.rs":"2a123335626e941cf0a3349f9327c3e7606af593a8370ef5f71325012107b91f","src/linux/thread_info.rs":"129db24120fee7bc01e5bf5a0bf0b19b6f82581530905f90f79ae7b7f2b724fb","src/linux/thread_info/aarch64.rs":"f3528e541328c29a8e665ecd5d1e435f8a41010d27c58f202563995db048cabb","src/linux/thread_info/arm.rs":"5bcdf554d62134f4b9e822dcc4ce6b0f3f2e44c312da971ccb7fbb1200504d85","src/linux/thread_info/mips.rs":"332d7888bb08a36d3b77023a4a0385193a07b1c6c5bf0e91aacb5d948ba8b903","src/linux/thread_info/x86.rs":"ca3a9a705bf7d9383c271cee9a55216e1e2c90e9b5346af8a610c1b527b26568","src/mac.rs":"4671ad90c433db559ec633c880c3fe083f38a2e185ef4fc99577318526076519","src/mac/errors.rs":"696473d1187a0f003409e3ac0fc83a02cafbad8451a62bda868b08acc36e7443","src/mac/mach.rs":"c7f857b39a388316839a35fad5129ad2f67608a61e4b04bbd83957c005a3f991","src/mac/minidump_writer.rs":"d6f07685779c45f6b773d4163965f5dc5e0a73421937d9ec6b8e4d3320d23e85","src/mac/streams.rs":"82e1b9fefa26d98f1c0efdd98de0aed9a9ee9edf3e4b4f636212c73f8d3e464e","src/mac/streams/breakpad_info.rs":"9aafbc3f376050e39a2295e77a1b764223403ffdd47bded39efa9450a53b5a06","src/mac/streams/exception.rs":"316cf3b9ccb6b1bb3b431b4e927e4d68201f845d80e31fcaa6b80bcc30748147","src/mac/streams/memory_list.rs":"e507a1ada858ef535e3e211d91195901e9976ba0ff6cf601919d7cacb48c5e9f","src/mac/streams/misc_info.rs":"ed9fe394ded145cae62094adf3a9e454e23bfd5b6fab7871f0cf62c6a5e79017","src/mac/streams/module_list.rs":"0d735c07d162311d386aa40d5a80ebcbdc644df0dfc811d7c4b85a2fae51c5f9","src/mac/streams/system_info.rs":"4bd0d171c9d7c97afbacf6fd144d5554f0e46d47ae78f00b85331d6d1a1d24b3","src/mac/streams/thread_list.rs":"2b003e3409daebbd38ebc8a49a2c24e7a75b296d28f58a2c85114cf611174c1b","src/mac/streams/thread_names.rs":"2c8ca3a98b0c4ac9bd0373721324f32038569b70eb5b47bafe7de4cc3f76483b","src/mac/task_dumper.rs":"b22f42b11bb7e9af5976ec04cbf9f8bf4d1d70c3c7738b1072e7bd41e8d5af3c","src/mem_writer.rs":"44d594e4b8a4bedf28c61f89c34f13be42deb9a8820a1d3267dd9572d65d0c97","src/minidump_cpu.rs":"ccb3dc179699159883e539e29285f8f6ba936afb8ce8980dbcb5060a80b6618c","src/minidump_format.rs":"0094097dec5aadc2f69410a57eb9dfe1248f962be629679ea5d47aa1d94da70c","src/windows.rs":"7aae8747519b203f1889c369cb1122ff308d255e9514cf9d4d3f09257a3bb96c","src/windows/errors.rs":"9b8752122784417ed48b9c3fccc9bdabc6c4e6285cdb77c79723cba56cb0de82","src/windows/ffi.rs":"24a6f99de9f25ae7bc80f2763d8c5b97e65699682a99ec6265ebc435c3310999","src/windows/minidump_writer.rs":"1c89d43c31f59c9091e84155d7062bf85d4674c54899a4e92b4ba2bd5fcd1354","tests/common/mod.rs":"44a9aa71736886c5f826d9b05095aa20995ffe561654eb6c87d8fb6f18b69308","tests/linux_minidump_writer.rs":"efdc875debbbe9f026c1a0258f0ee2ed4dc699e947761263ef7b1f36df52a372","tests/mac_minidump_writer.rs":"4e557715943e47f3134f5073537b22a97eac9d423e51c9d97b00103e117f0fc7","tests/ptrace_dumper.rs":"e97f41dbf1bf4ba9b8ec7cd308a250dfaf537f7cc73213f076d3f2ff8d14eddf","tests/task_dumper.rs":"3881899e4cfef0dae772d16b1a783497eebd2b58025394e0819cb03a0960d480","tests/windows_minidump_writer.rs":"138551179c4e610141d56ba99305a0fc05531c8e9924805dd071d380338f0f74"},"package":"8109e02c3cf4a587eea0bec18ccdfecc9041f91b5ebffa223b1e692c9a223c26"} \ No newline at end of file diff --git a/third_party/rust/minidump-writer/.github/CODEOWNERS b/third_party/rust/minidump-writer/.github/CODEOWNERS deleted file mode 100644 index 0baeae3646eb..000000000000 --- a/third_party/rust/minidump-writer/.github/CODEOWNERS +++ /dev/null @@ -1 +0,0 @@ -* @Jake-Shadle diff --git a/third_party/rust/minidump-writer/.github/workflows/audit.yml b/third_party/rust/minidump-writer/.github/workflows/audit.yml deleted file mode 100644 index 15ba479dccc3..000000000000 --- a/third_party/rust/minidump-writer/.github/workflows/audit.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Security audit - -on: - schedule: - # Runs at 00:00 UTC everyday - - cron: "0 0 * * *" - push: - paths: - - "**/Cargo.toml" - - "**/Cargo.lock" - - "**/audit.toml" - -jobs: - audit: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - name: deny audit - uses: EmbarkStudios/cargo-deny-action@v1 - with: - command: check advisories diff --git a/third_party/rust/minidump-writer/.github/workflows/ci.yml b/third_party/rust/minidump-writer/.github/workflows/ci.yml deleted file mode 100644 index 3fd572cd7de7..000000000000 --- a/third_party/rust/minidump-writer/.github/workflows/ci.yml +++ /dev/null @@ -1,86 +0,0 @@ -name: Continuous Integration - -on: - push: - branches: - - main - - github-actions - pull_request: - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - lint: - name: Lint - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - components: rustfmt,clippy - - name: rustfmt - run: cargo fmt --all -- --check - - name: clippy - run: cargo clippy --all-features --all-targets -- -D warnings - - test: - name: Test - runs-on: ${{ matrix.job.os }} - strategy: - matrix: - job: - - { os: ubuntu-22.04, target: x86_64-unknown-linux-gnu } - - { os: ubuntu-22.04, target: x86_64-unknown-linux-musl } - - { os: windows-2022, target: x86_64-pc-windows-msvc } - - { os: macos-12, target: x86_64-apple-darwin } - # TODO: Add macos aarch64 here once it becomes available as a runner - steps: - - uses: actions/checkout@v3 - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - target: ${{ matrix.job.target }} - - name: Fetch - run: cargo fetch --target ${{ matrix.job.target }} - - name: Build - run: cargo test --target ${{ matrix.job.target }} --no-run - - name: Test - run: cargo test --target ${{ matrix.job.target }} - - # This job builds non-tier1 targets that aren't already tested - build_lower_tier: - name: Build sources - runs-on: ${{ matrix.job.os }} - strategy: - matrix: - job: - - { os: ubuntu-22.04, target: i686-unknown-linux-gnu, use-cross: true } - #- { os: ubuntu-latest, target: i686-unknown-linux-musl, use-cross: true } - - { os: ubuntu-22.04, target: aarch64-unknown-linux-gnu, use-cross: true } - - { os: ubuntu-22.04, target: aarch64-unknown-linux-musl, use-cross: true } - #- { os: ubuntu-22.04, target: aarch64-linux-android, use-cross: true } - - { os: ubuntu-22.04, target: arm-unknown-linux-gnueabi, use-cross: true } - - { os: ubuntu-22.04, target: arm-unknown-linux-musleabi, use-cross: true } - - { os: ubuntu-22.04, target: arm-linux-androideabi, use-cross: true } - - { os: ubuntu-22.04, target: arm-unknown-linux-gnueabihf, use-cross: true } - # TODO: Remove this when aarch64 macs can be used as runners - - { os: macos-12, target: aarch64-apple-darwin, use-cross: false } - steps: - - uses: actions/checkout@v3 - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - target: ${{ matrix.job.target }} - #- name: Unit tests - - name: Build - uses: actions-rs/cargo@v1 - with: - #command: test - command: build - use-cross: ${{ matrix.job.use-cross }} - args: --target ${{ matrix.job.target }} --verbose --all-targets - #args: --target ${{ matrix.job.target }} --verbose -- --nocapture - diff --git a/third_party/rust/minidump-writer/CHANGELOG.md b/third_party/rust/minidump-writer/CHANGELOG.md index fc44ec281e4b..6bde9648b8e3 100644 --- a/third_party/rust/minidump-writer/CHANGELOG.md +++ b/third_party/rust/minidump-writer/CHANGELOG.md @@ -8,6 +8,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] - ReleaseDate +## [0.8.0] - 2023-04-03 +### Removed +- [PR#77](https://github.com/rust-minidump/minidump-writer/pull/77) removed the dependency on `winapi`, all bindings are either part of `minidump-writer` or `crash-context` now. + +### Changed +- [PR#77](https://github.com/rust-minidump/minidump-writer/pull/77) closed [#67](https://github.com/rust-minidump/minidump-writer/issues/67) by allowing the user to specify the `MinidumpType` flags when creating a minidump. + +### Fixed +- [PR#68](https://github.com/rust-minidump/minidump-writer/pull/68) resolved [#29](https://github.com/rust-minidump/minidump-writer/issues/29) by ignoring the bening `ESRCH` error when detaching pthreads. Thanks [@afranchuk](https://github.com/afranchuk)! +- [PR#74](https://github.com/rust-minidump/minidump-writer/pull/74) resolved [#73](https://github.com/rust-minidump/minidump-writer/issues/73) by ensuring the `NT_GNU_BUILD_ID` section had the proper correct `GNU` name before using it as the build identifier. + ## [0.7.0] - 2022-11-17 ### Changed - [PR#65](https://github.com/rust-minidump/minidump-writer/pull/65) updated `crash-context` to 0.5, which has support for a custom `capture_context` to replace `RtlCaptureContext` on Windows, due to improper bindings and deficiencies, resolving [#63](https://github.com/rust-minidump/minidump-writer/issues/63). @@ -60,7 +71,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Initial release, including basic support for `x86_64-unknown-linux-gnu/musl` and `x86_64-pc-windows-msvc` -[Unreleased]: https://github.com/rust-minidump/minidump-writer/compare/0.7.0...HEAD +[Unreleased]: https://github.com/rust-minidump/minidump-writer/compare/0.8.0...HEAD +[0.8.0]: https://github.com/rust-minidump/minidump-writer/compare/0.7.0...0.8.0 [0.7.0]: https://github.com/rust-minidump/minidump-writer/compare/0.6.0...0.7.0 [0.6.0]: https://github.com/rust-minidump/minidump-writer/compare/0.5.0...0.6.0 [0.5.0]: https://github.com/rust-minidump/minidump-writer/compare/0.4.0...0.5.0 diff --git a/third_party/rust/minidump-writer/Cargo.lock b/third_party/rust/minidump-writer/Cargo.lock new file mode 100644 index 000000000000..160ac4f3cc5a --- /dev/null +++ b/third_party/rust/minidump-writer/Cargo.lock @@ -0,0 +1,1839 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "ahash" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +dependencies = [ + "getrandom", + "once_cell", + "version_check", +] + +[[package]] +name = "aho-corasick" +version = "0.7.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" +dependencies = [ + "memchr", +] + +[[package]] +name = "anyhow" +version = "1.0.70" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7de8ce5e0f9f8d88245311066a578d72b7af3e7088f32783804676302df237e4" + +[[package]] +name = "arrayvec" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" + +[[package]] +name = "async-trait" +version = "0.1.68" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.13", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "binary-merge" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597bb81c80a54b6a4381b23faba8d7774b144c94cbd1d6fe3f1329bd776554ab" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "487f1e0fcbe47deb8b0574e646def1c903389d95241dd1bbcc6ce4a715dfc0c1" + +[[package]] +name = "bitvec" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +dependencies = [ + "funty", + "radium", + "tap", + "wyz", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "breakpad-symbols" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ef8c8cbf9ccb37133038543271b19d580475f9edcbe1bd1cc0eef5a743ddb62" +dependencies = [ + "async-trait", + "circular", + "debugid", + "minidump-common", + "nom", + "range-map", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "brownstone" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5839ee4f953e811bfdcf223f509cb2c6a3e1447959b0bff459405575bc17f22" +dependencies = [ + "arrayvec", +] + +[[package]] +name = "bstr" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223" +dependencies = [ + "lazy_static", + "memchr", + "regex-automata", +] + +[[package]] +name = "byteorder" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" + +[[package]] +name = "cab" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae6b4de23c7d39c0631fd3cc952d87951c86c75a13812d7247cb7a896e7b3551" +dependencies = [ + "byteorder", + "flate2", + "lzxd", + "time", +] + +[[package]] +name = "cc" +version = "1.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "circular" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fc239e0f6cb375d2402d48afb92f76f5404fd1df208a41930ec81eda078bea" + +[[package]] +name = "console" +version = "0.15.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3d79fbe8970a77e3e34151cc13d3b3e248aa0faaecb9f6091fa07ebefe5ad60" +dependencies = [ + "encode_unicode", + "lazy_static", + "libc", + "windows-sys 0.42.0", +] + +[[package]] +name = "cpp_demangle" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b446fd40bcc17eddd6a4a78f24315eb90afdb3334999ddfd4909985c47722442" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "cpufeatures" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "280a9f2d8b3a38871a3c8a46fb80db65e5e5ed97da80c4d08bf27fb63e35e181" +dependencies = [ + "libc", +] + +[[package]] +name = "crash-context" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d433b84b88830c0c253292a52fe43bd3f385668b6a39a84ce291e6e7db52724" +dependencies = [ + "cfg-if", + "libc", + "mach2", +] + +[[package]] +name = "crc" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86ec7a15cbe22e59248fc7eadb1907dab5ba09372595da4d73dd805ed4417dfe" +dependencies = [ + "crc-catalog", +] + +[[package]] +name = "crc-catalog" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cace84e55f07e7301bae1c519df89cdad8cc3cd868413d3fdbdeca9ff3db484" + +[[package]] +name = "crc32fast" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2801af0d36612ae591caa9568261fddce32ce6e08a7275ea334a06a4ad021a2c" +dependencies = [ + "cfg-if", + "crossbeam-channel", + "crossbeam-deque", + "crossbeam-epoch", + "crossbeam-queue", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf2b3e8478797446514c91ef04bafcb59faba183e621ad488df88983cc14128c" +dependencies = [ + "cfg-if", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" +dependencies = [ + "cfg-if", + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46bd5f3f85273295a9d14aedfb86f6aadbff6d8f5295c4a9edb08e819dcf5695" +dependencies = [ + "autocfg", + "cfg-if", + "crossbeam-utils", + "memoffset", + "scopeguard", +] + +[[package]] +name = "crossbeam-queue" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1cfb3ea8a53f37c40dea2c7bedcbd88bdfae54f5e2175d6ecaff1c988353add" +dependencies = [ + "cfg-if", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c063cd8cc95f5c377ed0d4b49a4b21f632396ff690e8470c29b3359b346984b" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "debugid" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef552e6f588e446098f6ba40d89ac146c8c7b64aade83c051ee00bb5d2bc18d" +dependencies = [ + "serde", + "uuid", +] + +[[package]] +name = "digest" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" +dependencies = [ + "block-buffer", + "crypto-common", +] + +[[package]] +name = "dirs" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + +[[package]] +name = "dmsort" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0bc8fbe9441c17c9f46f75dfe27fa1ddb6c68a461ccaed0481419219d4f10d3" + +[[package]] +name = "dump_syms" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0640a83419dce0966981ccf5f41359cf858ce786314e55af12bff22e782585d5" +dependencies = [ + "anyhow", + "bitflags 1.3.2", + "cab", + "crossbeam", + "dirs", + "goblin", + "hashbrown", + "log", + "lzma-rs", + "num_cpus", + "once_cell", + "regex", + "serde", + "serde_json", + "sha2", + "symbolic", + "url", + "uuid", +] + +[[package]] +name = "elementtree" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3efd4742acf458718a6456e0adf0b4d734d6b783e452bbf1ac36bf31f4085cb3" +dependencies = [ + "string_cache", +] + +[[package]] +name = "elsa" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f74077c3c3aedb99a2683919698285596662518ea13e5eedcf8bdd43b0d0453b" +dependencies = [ + "stable_deref_trait", +] + +[[package]] +name = "encode_unicode" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" + +[[package]] +name = "encoding" +version = "0.2.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b0d943856b990d12d3b55b359144ff341533e516d94098b1d3fc1ac666d36ec" +dependencies = [ + "encoding-index-japanese", + "encoding-index-korean", + "encoding-index-simpchinese", + "encoding-index-singlebyte", + "encoding-index-tradchinese", +] + +[[package]] +name = "encoding-index-japanese" +version = "1.20141219.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04e8b2ff42e9a05335dbf8b5c6f7567e5591d0d916ccef4e0b1710d32a0d0c91" +dependencies = [ + "encoding_index_tests", +] + +[[package]] +name = "encoding-index-korean" +version = "1.20141219.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dc33fb8e6bcba213fe2f14275f0963fd16f0a02c878e3095ecfdf5bee529d81" +dependencies = [ + "encoding_index_tests", +] + +[[package]] +name = "encoding-index-simpchinese" +version = "1.20141219.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d87a7194909b9118fc707194baa434a4e3b0fb6a5a757c73c3adb07aa25031f7" +dependencies = [ + "encoding_index_tests", +] + +[[package]] +name = "encoding-index-singlebyte" +version = "1.20141219.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3351d5acffb224af9ca265f435b859c7c01537c0849754d3db3fdf2bfe2ae84a" +dependencies = [ + "encoding_index_tests", +] + +[[package]] +name = "encoding-index-tradchinese" +version = "1.20141219.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd0e20d5688ce3cab59eb3ef3a2083a5c77bf496cb798dc6fcdb75f323890c18" +dependencies = [ + "encoding_index_tests", +] + +[[package]] +name = "encoding_index_tests" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a246d82be1c9d791c5dfde9a2bd045fc3cbba3fa2b11ad558f27d01712f00569" + +[[package]] +name = "enum-primitive-derive" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c375b9c5eadb68d0a6efee2999fef292f45854c3444c86f09d8ab086ba942b0e" +dependencies = [ + "num-traits", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "errno" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50d6a0976c999d473fe89ad888d5a284e55366d9dc9038b1ba2aa15128c4afa0" +dependencies = [ + "errno-dragonfly", + "libc", + "windows-sys 0.45.0", +] + +[[package]] +name = "errno-dragonfly" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "fallible-iterator" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" + +[[package]] +name = "fastrand" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" +dependencies = [ + "instant", +] + +[[package]] +name = "flate2" +version = "1.0.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8a2db397cb1c8772f31494cb8917e48cd1e64f0fa7efac59fbd741a0a8ce841" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "form_urlencoded" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "funty" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" + +[[package]] +name = "futures" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" + +[[package]] +name = "futures-executor" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" + +[[package]] +name = "futures-macro" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.13", +] + +[[package]] +name = "futures-sink" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" + +[[package]] +name = "futures-task" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" + +[[package]] +name = "futures-util" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "gimli" +version = "0.27.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad0a93d233ebf96623465aad4046a8d3aa4da22d4f4beba5388838c8a434bbb4" +dependencies = [ + "fallible-iterator", + "stable_deref_trait", +] + +[[package]] +name = "goblin" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d6b4de4a8eb6c46a8c77e1d3be942cb9a8bf073c22374578e5ba4b08ed0ff68" +dependencies = [ + "log", + "plain", + "scroll", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +dependencies = [ + "ahash", + "serde", +] + +[[package]] +name = "hermit-abi" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" +dependencies = [ + "libc", +] + +[[package]] +name = "hermit-abi" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" + +[[package]] +name = "idna" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "indent_write" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cfe9645a18782869361d9c8732246be7b410ad4e919d3609ebabdac00ba12c3" + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown", +] + +[[package]] +name = "inplace-vec-builder" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf64c2edc8226891a71f127587a2861b132d2b942310843814d5001d99a1d307" +dependencies = [ + "smallvec", +] + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "io-lifetimes" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09270fd4fa1111bc614ed2246c7ef56239a3063d5be0d1ec3b589c505d400aeb" +dependencies = [ + "hermit-abi 0.3.1", + "libc", + "windows-sys 0.45.0", +] + +[[package]] +name = "itoa" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" + +[[package]] +name = "joinery" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72167d68f5fce3b8655487b8038691a3c9984ee769590f93f2a631f4ad64e4f5" + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "leb128" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" + +[[package]] +name = "libc" +version = "0.2.140" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99227334921fae1a979cf0bfdfcc6b3e5ce376ef57e16fb6fb3ea2ed6095f80c" + +[[package]] +name = "linux-raw-sys" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d59d8c75012853d2e872fb56bc8a2e53718e2cafe1a4c823143141c6d90c322f" + +[[package]] +name = "lock_api" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "lzma-rs" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "297e814c836ae64db86b36cf2a557ba54368d03f6afcd7d947c266692f71115e" +dependencies = [ + "byteorder", + "crc", +] + +[[package]] +name = "lzxd" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "784462f20dddd9dfdb45de963fa4ad4a288cb10a7889ac5d2c34fb6481c6b213" + +[[package]] +name = "mach2" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d0d1830bcd151a6fc4aea1369af235b36c1528fe976b8ff678683c9995eade8" +dependencies = [ + "libc", +] + +[[package]] +name = "maybe-owned" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4facc753ae494aeb6e3c22f839b158aebd4f9270f55cd3c79906c45476c47ab4" + +[[package]] +name = "memchr" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" + +[[package]] +name = "memmap2" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" +dependencies = [ + "libc", +] + +[[package]] +name = "memoffset" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1" +dependencies = [ + "autocfg", +] + +[[package]] +name = "minidump" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94e5cd2ca4f6b85c6c7fb41ae0aebe0b443a6c0558876f1d779c7236d42417cf" +dependencies = [ + "debugid", + "encoding", + "memmap2", + "minidump-common", + "num-traits", + "range-map", + "scroll", + "thiserror", + "time", + "tracing", + "uuid", +] + +[[package]] +name = "minidump-common" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "694717103b2c15f8c16ddfaec1333fe15673bc22b10ffa6164427415701974ba" +dependencies = [ + "bitflags 1.3.2", + "debugid", + "enum-primitive-derive", + "num-traits", + "range-map", + "scroll", + "smart-default", +] + +[[package]] +name = "minidump-processor" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e019e95dbb18128387ce3192782239c2fc442909fd8bacccd2c4ed590c543087" +dependencies = [ + "async-trait", + "breakpad-symbols", + "debugid", + "futures-util", + "memmap2", + "minidump", + "minidump-common", + "scroll", + "serde", + "serde_json", + "thiserror", + "tracing", +] + +[[package]] +name = "minidump-writer" +version = "0.8.0" +dependencies = [ + "bitflags 2.0.2", + "byteorder", + "cfg-if", + "crash-context", + "dump_syms", + "futures", + "goblin", + "libc", + "mach2", + "memmap2", + "memoffset", + "minidump", + "minidump-common", + "minidump-processor", + "nix", + "scroll", + "similar-asserts", + "tempfile", + "thiserror", + "uuid", +] + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniz_oxide" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" +dependencies = [ + "adler", +] + +[[package]] +name = "msvc-demangler" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfb67c6dd0fa9b00619c41c5700b6f92d5f418be49b45ddb9970fbd4569df3c8" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "new_debug_unreachable" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" + +[[package]] +name = "nix" +version = "0.26.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfdda3d196821d6af13126e40375cdf7da646a96114af134d5f417a9a1dc8e1a" +dependencies = [ + "bitflags 1.3.2", + "cfg-if", + "libc", + "static_assertions", +] + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "nom-supreme" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bd3ae6c901f1959588759ff51c95d24b491ecb9ff91aa9c2ef4acc5b1dcab27" +dependencies = [ + "brownstone", + "indent_write", + "joinery", + "memchr", + "nom", +] + +[[package]] +name = "num-traits" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_cpus" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" +dependencies = [ + "hermit-abi 0.2.6", + "libc", +] + +[[package]] +name = "once_cell" +version = "1.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall 0.2.16", + "smallvec", + "windows-sys 0.45.0", +] + +[[package]] +name = "pdb" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82040a392923abe6279c00ab4aff62d5250d1c8555dc780e4b02783a7aa74863" +dependencies = [ + "fallible-iterator", + "scroll", + "uuid", +] + +[[package]] +name = "pdb-addr2line" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4e89a9f2f40b2389ba6da0814c8044bf942bece03dffa1514f84e3b525f4f9a" +dependencies = [ + "bitflags 1.3.2", + "elsa", + "maybe-owned", + "pdb", + "range-collections", + "thiserror", +] + +[[package]] +name = "percent-encoding" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" + +[[package]] +name = "phf_shared" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096" +dependencies = [ + "siphasher", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "plain" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" + +[[package]] +name = "precomputed-hash" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" + +[[package]] +name = "proc-macro2" +version = "1.0.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + +[[package]] +name = "range-collections" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61fdfd79629e2b44a1d34b4d227957174cb858e6b86ee45fad114edbcfc903ab" +dependencies = [ + "binary-merge", + "inplace-vec-builder", + "smallvec", +] + +[[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 = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "redox_syscall" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "redox_users" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +dependencies = [ + "getrandom", + "redox_syscall 0.2.16", + "thiserror", +] + +[[package]] +name = "regex" +version = "1.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b1f693b24f6ac912f4893ef08244d70b6067480d2f1a46e950c9691e6749d1d" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" + +[[package]] +name = "regex-syntax" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + +[[package]] +name = "rustc-demangle" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4a36c42d1873f9a77c53bde094f9664d9891bc604a45b4798fd2c389ed12e5b" + +[[package]] +name = "rustix" +version = "0.37.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d097081ed288dfe45699b72f5b5d648e5f15d64d900c7080273baa20c16a6849" +dependencies = [ + "bitflags 1.3.2", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys", + "windows-sys 0.45.0", +] + +[[package]] +name = "ryu" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" + +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + +[[package]] +name = "scroll" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04c565b551bafbef4157586fa379538366e4385d42082f255bfd96e4fe8519da" +dependencies = [ + "scroll_derive", +] + +[[package]] +name = "scroll_derive" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdbda6ac5cd1321e724fa9cee216f3a61885889b896f073b8f82322789c5250e" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "serde" +version = "1.0.159" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c04e8343c3daeec41f58990b9d77068df31209f2af111e059e9fe9646693065" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.159" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c614d17805b093df4b147b51339e7e44bf05ef59fba1e45d83500bcfb4d8585" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.13", +] + +[[package]] +name = "serde_json" +version = "1.0.95" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d721eca97ac802aa7777b701877c8004d950fc142651367300d21c1cc0194744" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "sha2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "similar" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "420acb44afdae038210c99e69aae24109f32f15500aa708e81d46c9f29d55fcf" +dependencies = [ + "bstr", + "unicode-segmentation", +] + +[[package]] +name = "similar-asserts" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbf644ad016b75129f01a34a355dcb8d66a5bc803e417c7a77cc5d5ee9fa0f18" +dependencies = [ + "console", + "similar", +] + +[[package]] +name = "siphasher" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" + +[[package]] +name = "slab" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" + +[[package]] +name = "smart-default" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "133659a15339456eeeb07572eb02a91c91e9815e9cbc89566944d2c8d3efdbf6" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "string_cache" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f91138e76242f575eb1d3b38b4f1362f10d3a43f47d182a5b359af488a02293b" +dependencies = [ + "new_debug_unreachable", + "once_cell", + "parking_lot", + "phf_shared", + "precomputed-hash", + "serde", +] + +[[package]] +name = "symbolic" +version = "12.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdac255fb0c803ba6eeb04f757892f41f91b1f78c1610a1f7d1d3be8bdca588b" +dependencies = [ + "symbolic-cfi", + "symbolic-common", + "symbolic-debuginfo", + "symbolic-demangle", +] + +[[package]] +name = "symbolic-cfi" +version = "12.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e55c702907a9c5f478a1e890e90fb0f8556c29bad07eca6e2a39f0969fac5bde" +dependencies = [ + "symbolic-common", + "symbolic-debuginfo", + "thiserror", +] + +[[package]] +name = "symbolic-common" +version = "12.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9175daca19ecfe5836212bbb4c5c7d59ff5e3faf11c13a299602e8630ac2fb95" +dependencies = [ + "debugid", + "memmap2", + "stable_deref_trait", + "uuid", +] + +[[package]] +name = "symbolic-debuginfo" +version = "12.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b4e2122c4ca3495c489ef077478fc47f3b6d4d5142f0bf3c03631a017368c48" +dependencies = [ + "bitvec", + "debugid", + "dmsort", + "elementtree", + "elsa", + "fallible-iterator", + "flate2", + "gimli", + "goblin", + "lazy_static", + "nom", + "nom-supreme", + "once_cell", + "parking_lot", + "pdb-addr2line", + "regex", + "scroll", + "serde", + "serde_json", + "smallvec", + "symbolic-common", + "symbolic-ppdb", + "thiserror", + "wasmparser", + "zip", +] + +[[package]] +name = "symbolic-demangle" +version = "12.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "949dbae189a16e7d87d91b40a5cd13166f76342d93deeba1145dd9fce64a0a91" +dependencies = [ + "cc", + "cpp_demangle", + "msvc-demangler", + "rustc-demangle", + "symbolic-common", +] + +[[package]] +name = "symbolic-ppdb" +version = "12.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d5fc44d1077d1c10fce068dc7f1629d5874ff07a57f50abdad4a76a2fd04878" +dependencies = [ + "flate2", + "indexmap", + "serde_json", + "symbolic-common", + "thiserror", + "uuid", + "watto", +] + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c9da457c5285ac1f936ebd076af6dac17a61cfe7826f2076b4d015cf47bc8ec" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + +[[package]] +name = "tempfile" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9fbec84f381d5795b08656e4912bec604d162bff9291d6189a78f4c8ab87998" +dependencies = [ + "cfg-if", + "fastrand", + "redox_syscall 0.3.5", + "rustix", + "windows-sys 0.45.0", +] + +[[package]] +name = "thiserror" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.13", +] + +[[package]] +name = "time" +version = "0.3.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd0cbfecb4d19b5ea75bb31ad904eb5b9fa13f21079c3b92017ebdf4999a5890" +dependencies = [ + "itoa", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e153e1f1acaef8acc537e68b44906d2db6436e2b35ac2c6b42640fff91f00fd" + +[[package]] +name = "time-macros" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd80a657e71da814b8e5d60d3374fc6d35045062245d80224748ae522dd76f36" +dependencies = [ + "time-core", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0de47a4eecbe11f498978a9b29d792f0d2692d1dd003650c24c76510e3bc001" +dependencies = [ + "autocfg", + "pin-project-lite", + "windows-sys 0.45.0", +] + +[[package]] +name = "tracing" +version = "0.1.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +dependencies = [ + "cfg-if", + "log", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "tracing-core" +version = "0.1.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" +dependencies = [ + "once_cell", +] + +[[package]] +name = "typenum" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" + +[[package]] +name = "unicode-bidi" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" + +[[package]] +name = "unicode-ident" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" + +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-segmentation" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" + +[[package]] +name = "url" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "uuid" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1674845326ee10d37ca60470760d4288a6f80f304007d92e5c53bab78c9cfd79" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasmparser" +version = "0.102.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48134de3d7598219ab9eaf6b91b15d8e50d31da76b8519fe4ecfcec2cf35104b" +dependencies = [ + "indexmap", + "url", +] + +[[package]] +name = "watto" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6746b5315e417144282a047ebb82260d45c92d09bf653fa9ec975e3809be942b" +dependencies = [ + "leb128", + "thiserror", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-sys" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + +[[package]] +name = "wyz" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +dependencies = [ + "tap", +] + +[[package]] +name = "zip" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0445d0fbc924bb93539b4316c11afb121ea39296f99a3c4c9edad09e3658cdef" +dependencies = [ + "byteorder", + "crc32fast", + "crossbeam-utils", + "flate2", +] diff --git a/third_party/rust/minidump-writer/Cargo.toml b/third_party/rust/minidump-writer/Cargo.toml index fa1ea8916723..9f84056d6a3c 100644 --- a/third_party/rust/minidump-writer/Cargo.toml +++ b/third_party/rust/minidump-writer/Cargo.toml @@ -12,7 +12,7 @@ [package] edition = "2021" name = "minidump-writer" -version = "0.7.0" +version = "0.8.0" authors = ["Martin Sirringhaus"] description = "Rust rewrite of Breakpad's minidump_writer" homepage = "https://github.com/rust-minidump/minidump-writer" @@ -20,24 +20,40 @@ readme = "README.md" license = "MIT" repository = "https://github.com/rust-minidump/minidump-writer" -[dependencies] -byteorder = "1.3.2" -cfg-if = "1.0" -crash-context = "0.5" -memoffset = "0.8" -minidump-common = "0.15" -scroll = "0.11" -tempfile = "3.1.0" -thiserror = "1.0.21" +[dependencies.byteorder] +version = "1.3.2" -[dev-dependencies] -memmap2 = "0.5" -minidump = "0.15" +[dependencies.cfg-if] +version = "1.0" + +[dependencies.crash-context] +version = "0.6" + +[dependencies.memoffset] +version = "0.8" + +[dependencies.minidump-common] +version = "0.15" + +[dependencies.scroll] +version = "0.11" + +[dependencies.tempfile] +version = "3.1.0" + +[dependencies.thiserror] +version = "1.0.21" [dev-dependencies.futures] version = "0.3" features = ["executor"] +[dev-dependencies.memmap2] +version = "0.5" + +[dev-dependencies.minidump] +version = "0.15" + [target."cfg(any(target_os = \"linux\", target_os = \"android\"))".dependencies.nix] version = "0.26" features = [ @@ -48,12 +64,8 @@ features = [ ] default-features = false -[target."cfg(target_os = \"macos\")".dependencies] -mach2 = "0.4" - -[target."cfg(target_os = \"macos\")".dev-dependencies] -similar-asserts = "1.2" -uuid = "1.0" +[target."cfg(target_os = \"macos\")".dependencies.mach2] +version = "0.4" [target."cfg(target_os = \"macos\")".dev-dependencies.dump_syms] version = "2.0.0" @@ -63,16 +75,20 @@ default-features = false version = "0.15" default-features = false -[target."cfg(target_os = \"windows\")".dependencies.winapi] -version = "0.3" -features = [ - "handleapi", - "minwindef", - "processthreadsapi", - "winnt", -] +[target."cfg(target_os = \"macos\")".dev-dependencies.similar-asserts] +version = "1.2" -[target."cfg(unix)".dependencies] -goblin = "0.6" -libc = "0.2.74" -memmap2 = "0.5" +[target."cfg(target_os = \"macos\")".dev-dependencies.uuid] +version = "1.0" + +[target."cfg(target_os = \"windows\")".dependencies.bitflags] +version = "2.0" + +[target."cfg(unix)".dependencies.goblin] +version = "0.6" + +[target."cfg(unix)".dependencies.libc] +version = "0.2.74" + +[target."cfg(unix)".dependencies.memmap2] +version = "0.5" diff --git a/third_party/rust/minidump-writer/src/bin/test.rs b/third_party/rust/minidump-writer/src/bin/test.rs index accbc998210f..21555fdbd953 100644 --- a/third_party/rust/minidump-writer/src/bin/test.rs +++ b/third_party/rust/minidump-writer/src/bin/test.rs @@ -295,14 +295,17 @@ mod linux { #[cfg(target_os = "windows")] mod windows { - use minidump_writer::ffi::{ - GetCurrentProcessId, GetCurrentThread, GetCurrentThreadId, GetThreadContext, - EXCEPTION_POINTERS, EXCEPTION_RECORD, - }; - use super::*; use std::mem; + #[link(name = "kernel32")] + extern "system" { + pub fn GetCurrentProcessId() -> u32; + pub fn GetCurrentThreadId() -> u32; + pub fn GetCurrentThread() -> isize; + pub fn GetThreadContext(thread: isize, context: *mut crash_context::CONTEXT) -> i32; + } + #[inline(never)] pub(super) fn real_main(args: Vec) -> Result<()> { let exception_code = u32::from_str_radix(&args[0], 16).unwrap(); @@ -310,7 +313,7 @@ mod windows { // Generate the exception and communicate back where the exception pointers // are unsafe { - let mut exception_record: EXCEPTION_RECORD = mem::zeroed(); + let mut exception_record: crash_context::EXCEPTION_RECORD = mem::zeroed(); let mut exception_context = std::mem::MaybeUninit::uninit(); let pid = GetCurrentProcessId(); @@ -320,12 +323,12 @@ mod windows { let mut exception_context = exception_context.assume_init(); - let exception_ptrs = EXCEPTION_POINTERS { + let exception_ptrs = crash_context::EXCEPTION_POINTERS { ExceptionRecord: &mut exception_record, ContextRecord: &mut exception_context, }; - exception_record.ExceptionCode = exception_code; + exception_record.ExceptionCode = exception_code as _; let exc_ptr_addr = &exception_ptrs as *const _ as usize; diff --git a/third_party/rust/minidump-writer/src/windows.rs b/third_party/rust/minidump-writer/src/windows.rs index 1717ad033716..34b72444c1f7 100644 --- a/third_party/rust/minidump-writer/src/windows.rs +++ b/third_party/rust/minidump-writer/src/windows.rs @@ -1,3 +1,5 @@ pub mod errors; -pub mod ffi; +mod ffi; pub mod minidump_writer; + +pub use ffi::MinidumpType; diff --git a/third_party/rust/minidump-writer/src/windows/ffi.rs b/third_party/rust/minidump-writer/src/windows/ffi.rs index 9841075c68cb..933228f8e624 100644 --- a/third_party/rust/minidump-writer/src/windows/ffi.rs +++ b/third_party/rust/minidump-writer/src/windows/ffi.rs @@ -7,51 +7,151 @@ //! cause crashes or bad data, so the [`crash_context::ffi::CONTEXT`] is used //! instead. See [#63](https://github.com/rust-minidump/minidump-writer/issues/63) -#![allow(non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + non_snake_case, + non_camel_case_types, + non_upper_case_globals, + clippy::upper_case_acronyms +)] -pub use crash_context::ffi::{capture_context, CONTEXT, EXCEPTION_POINTERS, EXCEPTION_RECORD}; -pub use winapi::{ - shared::minwindef::BOOL, - um::{ - processthreadsapi::{ - GetCurrentProcess, GetCurrentProcessId, GetCurrentThread, GetCurrentThreadId, - OpenProcess, OpenThread, ResumeThread, SuspendThread, - }, - winnt::HANDLE, - }, -}; +pub use crash_context::{capture_context, CONTEXT, EXCEPTION_POINTERS, EXCEPTION_RECORD}; -pub type MINIDUMP_TYPE = u32; +pub type HANDLE = isize; +pub type BOOL = i32; +pub const FALSE: BOOL = 0; -pub const MiniDumpNormal: MINIDUMP_TYPE = 0u32; +pub type Hresult = i32; +pub const STATUS_NONCONTINUABLE_EXCEPTION: i32 = -1073741787; -pub type MINIDUMP_CALLBACK_ROUTINE = Option< - unsafe extern "system" fn( - callbackparam: *mut ::core::ffi::c_void, - callbackinput: *const MINIDUMP_CALLBACK_INPUT, - callbackoutput: *mut MINIDUMP_CALLBACK_OUTPUT, - ) -> BOOL, ->; +pub type PROCESS_ACCESS_RIGHTS = u32; +pub const PROCESS_ALL_ACCESS: PROCESS_ACCESS_RIGHTS = 2097151; -#[derive(Copy, Clone)] -#[repr(C, packed(4))] -pub struct MINIDUMP_CALLBACK_INPUT { - dummy: u32, +pub type THREAD_ACCESS_RIGHTS = u32; +pub const THREAD_SUSPEND_RESUME: THREAD_ACCESS_RIGHTS = 2; +pub const THREAD_GET_CONTEXT: THREAD_ACCESS_RIGHTS = 8; +pub const THREAD_QUERY_INFORMATION: THREAD_ACCESS_RIGHTS = 64; + +bitflags::bitflags! { + /// + #[derive(Copy, Clone, Debug)] + #[repr(transparent)] + pub struct MinidumpType: u32 { + /// Include just the information necessary to capture stack traces for all + /// existing threads in a process. + const Normal = 0; + /// Include the data sections from all loaded modules. + /// + /// This results in the inclusion of global variables, which can make + /// the minidump file significantly larger. + const WithDataSegs = 1 << 0; + /// Include all accessible memory in the process. + /// + /// The raw memory data is included at the end, so that the initial + /// structures can be mapped directly without the raw memory information. + /// This option can result in a very large file. + const WithFullMemory = 1 << 1; + /// Include high-level information about the operating system handles that + /// are active when the minidump is made. + const WithHandleData = 1 << 2; + /// Stack and backing store memory written to the minidump file should be + /// filtered to remove all but the pointer values necessary to reconstruct a + /// stack trace. + const FilterMemory = 1 << 3; + /// Stack and backing store memory should be scanned for pointer references + /// to modules in the module list. + /// + /// If a module is referenced by stack or backing store memory, the + /// [`MINIDUMP_CALLBACK_OUTPUT_0::ModuleWriteFlags`] field is set to + /// [`ModuleWriteFlags::ModuleReferencedByMemory`]. + const ScanMemory = 1 << 4; + /// Include information from the list of modules that were recently + /// unloaded, if this information is maintained by the operating system. + const WithUnloadedModules = 1 << 5; + /// Include pages with data referenced by locals or other stack memory. + /// This option can increase the size of the minidump file significantly. + const WithIndirectlyReferencedMemory = 1 << 6; + /// Filter module paths for information such as user names or important + /// directories. + /// + /// This option may prevent the system from locating the image file and + /// should be used only in special situations. + const FilterModulePaths = 1 << 7; + /// Include complete per-process and per-thread information from the + /// operating system. + const WithProcessThreadData = 1 << 8; + /// Scan the virtual address space for [`PAGE_READWRITE`](https://learn.microsoft.com/en-us/windows/win32/memory/memory-protection-constants) + /// memory to be included. + const WithPrivateReadWriteMemory = 1 << 9; + /// Reduce the data that is dumped by eliminating memory regions that + /// are not essential to meet criteria specified for the dump. + /// + /// This can avoid dumping memory that may contain data that is private + /// to the user. However, it is not a guarantee that no private information + /// will be present. + const WithoutOptionalData = 1 << 10; + /// Include memory region information. + /// + /// See [MINIDUMP_MEMORY_INFO_LIST](https://learn.microsoft.com/en-us/windows/win32/api/minidumpapiset/ns-minidumpapiset-minidump_memory_info_list) + const WithFullMemoryInfo = 1 << 11; + /// Include thread state information. + /// + /// See [MINIDUMP_THREAD_INFO_LIST](https://learn.microsoft.com/en-us/windows/win32/api/minidumpapiset/ns-minidumpapiset-minidump_thread_info_list) + const WithThreadInfo = 1 << 12; + /// Include all code and code-related sections from loaded modules to + /// capture executable content. + /// + /// For per-module control, use the [`ModuleWriteFlags::ModuleWriteCodeSegs`] + const WithCodeSegs = 1 << 13; + /// Turns off secondary auxiliary-supported memory gathering. + const WithoutAuxiliaryState = 1 << 14; + /// Requests that auxiliary data providers include their state in the + /// dump image; the state data that is included is provider dependent. + /// + /// This option can result in a large dump image. + const WithFullAuxiliaryState = 1 << 15; + /// Scans the virtual address space for [`PAGE_WRITECOPY`](https://learn.microsoft.com/en-us/windows/win32/memory/memory-protection-constants) memory to be included. + const WithPrivateWriteCopyMemory = 1 << 16; + /// If you specify [`MinidumpType::MiniDumpWithFullMemory`], the + /// `MiniDumpWriteDump` function will fail if the function cannot read + /// the memory regions; however, if you include + /// [`IgnoreInaccessibleMemory`], the `MiniDumpWriteDump` function will + /// ignore the memory read failures and continue to generate the dump. + /// + /// Note that the inaccessible memory regions are not included in the dump. + const IgnoreInaccessibleMemory = 1 << 17; + /// Adds security token related data. + /// + /// This will make the "!token" extension work when processing a user-mode dump. + const WithTokenInformation = 1 << 18; + /// Adds module header related data. + const WithModuleHeaders = 1 << 19; + /// Adds filter triage related data. + const FilterTriage = 1 << 20; + /// Adds AVX crash state context registers. + const WithAvxXStateContext = 1 << 21; + /// Adds Intel Processor Trace related data. + const WithIptTrace = 1 << 22; + /// Scans inaccessible partial memory pages. + const ScanInaccessiblePartialPages = 1 << 23; + /// Exclude all memory with the virtual protection attribute of [`PAGE_WRITECOMBINE`](https://learn.microsoft.com/en-us/windows/win32/memory/memory-protection-constants). + const FilterWriteCombinedMemory = 1 << 24; + } } -#[derive(Copy, Clone)] +pub type VS_FIXEDFILEINFO_FILE_FLAGS = u32; + #[repr(C, packed(4))] -pub struct MINIDUMP_CALLBACK_OUTPUT { - dummy: u32, +pub struct MINIDUMP_USER_STREAM { + pub Type: u32, + pub BufferSize: u32, + pub Buffer: *mut std::ffi::c_void, } -#[derive(Copy, Clone)] #[repr(C, packed(4))] -pub struct MINIDUMP_CALLBACK_INFORMATION { - pub CallbackRoutine: MINIDUMP_CALLBACK_ROUTINE, - pub CallbackParam: *mut ::core::ffi::c_void, +pub struct MINIDUMP_USER_STREAM_INFORMATION { + pub UserStreamCount: u32, + pub UserStreamArray: *mut MINIDUMP_USER_STREAM, } -#[derive(Copy, Clone)] #[repr(C, packed(4))] pub struct MINIDUMP_EXCEPTION_INFORMATION { pub ThreadId: u32, @@ -59,30 +159,291 @@ pub struct MINIDUMP_EXCEPTION_INFORMATION { pub ClientPointers: BOOL, } -#[derive(Copy, Clone)] +pub type VS_FIXEDFILEINFO_FILE_OS = i32; +pub type VS_FIXEDFILEINFO_FILE_TYPE = i32; +pub type VS_FIXEDFILEINFO_FILE_SUBTYPE = i32; + +#[repr(C)] +pub struct VS_FIXEDFILEINFO { + pub dwSignature: u32, + pub dwStrucVersion: u32, + pub dwFileVersionMS: u32, + pub dwFileVersionLS: u32, + pub dwProductVersionMS: u32, + pub dwProductVersionLS: u32, + pub dwFileFlagsMask: u32, + pub dwFileFlags: VS_FIXEDFILEINFO_FILE_FLAGS, + pub dwFileOS: VS_FIXEDFILEINFO_FILE_OS, + pub dwFileType: VS_FIXEDFILEINFO_FILE_TYPE, + pub dwFileSubtype: VS_FIXEDFILEINFO_FILE_SUBTYPE, + pub dwFileDateMS: u32, + pub dwFileDateLS: u32, +} #[repr(C, packed(4))] -pub struct MINIDUMP_USER_STREAM { +pub struct MINIDUMP_MODULE_CALLBACK { + pub FullPath: *mut u16, + pub BaseOfImage: u64, + pub SizeOfImage: u32, + pub CheckSum: u32, + pub TimeDateStamp: u32, + pub VersionInfo: VS_FIXEDFILEINFO, + pub CvRecord: *mut std::ffi::c_void, + pub SizeOfCvRecord: u32, + pub MiscRecord: *mut std::ffi::c_void, + pub SizeOfMiscRecord: u32, +} + +#[repr(C, packed(4))] +pub struct MINIDUMP_INCLUDE_THREAD_CALLBACK { + pub ThreadId: u32, +} + +#[repr(C, packed(4))] +pub struct MINIDUMP_INCLUDE_MODULE_CALLBACK { + pub BaseOfImage: u64, +} + +#[repr(C, packed(4))] +pub struct MINIDUMP_IO_CALLBACK { + pub Handle: HANDLE, + pub Offset: u64, + pub Buffer: *mut std::ffi::c_void, + pub BufferBytes: u32, +} + +#[repr(C, packed(4))] +pub struct MINIDUMP_READ_MEMORY_FAILURE_CALLBACK { + pub Offset: u64, + pub Bytes: u32, + pub FailureStatus: Hresult, +} + +#[repr(C, packed(4))] +pub struct MINIDUMP_VM_QUERY_CALLBACK { + pub Offset: u64, +} + +#[repr(C, packed(4))] +pub struct MINIDUMP_VM_PRE_READ_CALLBACK { + pub Offset: u64, + pub Buffer: *mut std::ffi::c_void, + pub Size: u32, +} + +#[repr(C, packed(4))] +pub struct MINIDUMP_VM_POST_READ_CALLBACK { + pub Offset: u64, + pub Buffer: *mut std::ffi::c_void, + pub Size: u32, + pub Completed: u32, + pub Status: Hresult, +} + +/// Oof, so we have a problem with these structs, they are all packed(4), but +/// `CONTEXT` is aligned by either 4 (x86) or 16 (x86_64/aarch64)...which Rust +/// doesn't currently allow https://github.com/rust-lang/rust/issues/59154, so +/// we need to basically cheat with a big byte array until that issue is fixed (possibly never) +#[repr(C)] +pub struct CALLBACK_CONTEXT([u8; std::mem::size_of::()]); + +cfg_if::cfg_if! { + if #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] { + #[repr(C, packed(4))] + pub struct MINIDUMP_THREAD_CALLBACK { + pub ThreadId: u32, + pub ThreadHandle: HANDLE, + pub Context: CALLBACK_CONTEXT, + pub SizeOfContext: u32, + pub StackBase: u64, + pub StackEnd: u64, + } + + #[repr(C, packed(4))] + pub struct MINIDUMP_THREAD_EX_CALLBACK { + pub ThreadId: u32, + pub ThreadHandle: HANDLE, + pub Context: CALLBACK_CONTEXT, + pub SizeOfContext: u32, + pub StackBase: u64, + pub StackEnd: u64, + pub BackingStoreBase: u64, + pub BackingStoreEnd: u64, + } + } else if #[cfg(target_arch = "aarch64")] { + #[repr(C, packed(4))] + pub struct MINIDUMP_THREAD_CALLBACK { + pub ThreadId: u32, + pub ThreadHandle: HANDLE, + pub Pad: u32, + pub Context: CALLBACK_CONTEXT, + pub SizeOfContext: u32, + pub StackBase: u64, + pub StackEnd: u64, + } + + #[repr(C, packed(4))] + pub struct MINIDUMP_THREAD_EX_CALLBACK { + pub ThreadId: u32, + pub ThreadHandle: HANDLE, + pub Pad: u32, + pub Context: CALLBACK_CONTEXT, + pub SizeOfContext: u32, + pub StackBase: u64, + pub StackEnd: u64, + pub BackingStoreBase: u64, + pub BackingStoreEnd: u64, + } + } +} + +#[repr(C)] +pub union MINIDUMP_CALLBACK_INPUT_0 { + pub Status: Hresult, + pub Thread: std::mem::ManuallyDrop, + pub ThreadEx: std::mem::ManuallyDrop, + pub Module: std::mem::ManuallyDrop, + pub IncludeThread: std::mem::ManuallyDrop, + pub IncludeModule: std::mem::ManuallyDrop, + pub Io: std::mem::ManuallyDrop, + pub ReadMemoryFailure: std::mem::ManuallyDrop, + pub SecondaryFlags: u32, + pub VmQuery: std::mem::ManuallyDrop, + pub VmPreRead: std::mem::ManuallyDrop, + pub VmPostRead: std::mem::ManuallyDrop, +} + +#[repr(C, packed(4))] +pub struct MINIDUMP_CALLBACK_INPUT { + pub ProcessId: u32, + pub ProcessHandle: HANDLE, + pub CallbackType: u32, + pub Anonymous: MINIDUMP_CALLBACK_INPUT_0, +} + +pub type VIRTUAL_ALLOCATION_TYPE = u32; + +#[repr(C, packed(4))] +pub struct MINIDUMP_MEMORY_INFO { + pub BaseAddress: u64, + pub AllocationBase: u64, + pub AllocationProtect: u32, + __alignment1: u32, + pub RegionSize: u64, + pub State: VIRTUAL_ALLOCATION_TYPE, + pub Protect: u32, pub Type: u32, - pub BufferSize: u32, - pub Buffer: *mut ::core::ffi::c_void, + __alignment2: u32, } -#[derive(Copy, Clone)] #[repr(C, packed(4))] -pub struct MINIDUMP_USER_STREAM_INFORMATION { - pub UserStreamCount: u32, - pub UserStreamArray: *mut MINIDUMP_USER_STREAM, +pub struct MINIDUMP_CALLBACK_OUTPUT_0_0 { + pub MemoryBase: u64, + pub MemorySize: u32, } +#[repr(C)] +pub struct MINIDUMP_CALLBACK_OUTPUT_0_1 { + pub CheckCancel: BOOL, + pub Cancel: BOOL, +} + +#[repr(C)] +pub struct MINIDUMP_CALLBACK_OUTPUT_0_2 { + pub VmRegion: MINIDUMP_MEMORY_INFO, + pub Continue: BOOL, +} + +#[repr(C)] +pub struct MINIDUMP_CALLBACK_OUTPUT_0_3 { + pub VmQueryStatus: Hresult, + pub VmQueryResult: MINIDUMP_MEMORY_INFO, +} + +#[repr(C)] +pub struct MINIDUMP_CALLBACK_OUTPUT_0_4 { + pub VmReadStatus: Hresult, + pub VmReadBytesCompleted: u32, +} + +bitflags::bitflags! { + /// Identifies the type of module information that will be written to the + /// minidump file by the MiniDumpWriteDump function. + #[derive(Copy, Clone)] + #[repr(transparent)] + pub struct ModuleWriteFlags: u32 { + /// Only module information will be written to the minidump file. + const ModuleWriteModule = 0x0001; + const ModuleWriteDataSeg = 0x0002; + const ModuleWriteMiscRecord = 0x0004; + const ModuleWriteCvRecord = 0x0008; + const ModuleReferencedByMemory = 0x0010; + const ModuleWriteTlsData = 0x0020; + const ModuleWriteCodeSegs = 0x0040; + } +} + +#[repr(C)] +pub union MINIDUMP_CALLBACK_OUTPUT_0 { + pub ModuleWriteFlags: ModuleWriteFlags, + pub ThreadWriteFlags: u32, + pub SecondaryFlags: u32, + pub Anonymous1: std::mem::ManuallyDrop, + pub Anonymous2: std::mem::ManuallyDrop, + pub Handle: HANDLE, + pub Anonymous3: std::mem::ManuallyDrop, + pub Anonymous4: std::mem::ManuallyDrop, + pub Anonymous5: std::mem::ManuallyDrop, + pub Status: Hresult, +} + +#[repr(C, packed(4))] +pub struct MINIDUMP_CALLBACK_OUTPUT { + pub Anonymous: MINIDUMP_CALLBACK_OUTPUT_0, +} + +pub type MINIDUMP_CALLBACK_ROUTINE = Option< + unsafe extern "system" fn( + CallbackParam: *mut std::ffi::c_void, + CallbackInput: *const MINIDUMP_CALLBACK_INPUT, + CallbackOutput: *mut MINIDUMP_CALLBACK_OUTPUT, + ) -> BOOL, +>; + +#[repr(C, packed(4))] +pub struct MINIDUMP_CALLBACK_INFORMATION { + pub CallbackRoutine: MINIDUMP_CALLBACK_ROUTINE, + pub CallbackParam: *mut std::ffi::c_void, +} + +#[link(name = "kernel32")] +extern "system" { + pub fn CloseHandle(handle: HANDLE) -> BOOL; + pub fn GetCurrentProcess() -> HANDLE; + pub fn GetCurrentThreadId() -> u32; + pub fn OpenProcess( + desired_access: PROCESS_ACCESS_RIGHTS, + inherit_handle: BOOL, + process_id: u32, + ) -> HANDLE; + pub fn OpenThread( + desired_access: THREAD_ACCESS_RIGHTS, + inherit_handle: BOOL, + thread_id: u32, + ) -> HANDLE; + pub fn ResumeThread(thread: HANDLE) -> u32; + pub fn SuspendThread(thread: HANDLE) -> u32; + pub fn GetThreadContext(thread: HANDLE, context: *mut CONTEXT) -> BOOL; +} + +#[link(name = "dbghelp")] extern "system" { - pub fn GetThreadContext(hthread: HANDLE, lpcontext: *mut CONTEXT) -> BOOL; pub fn MiniDumpWriteDump( - hprocess: HANDLE, - processid: u32, - hfile: HANDLE, - dumptype: MINIDUMP_TYPE, - exceptionparam: *const MINIDUMP_EXCEPTION_INFORMATION, - userstreamparam: *const MINIDUMP_USER_STREAM_INFORMATION, - callbackparam: *const MINIDUMP_CALLBACK_INFORMATION, + process: HANDLE, + process_id: u32, + file: HANDLE, + dump_type: MinidumpType, + exception_param: *const MINIDUMP_EXCEPTION_INFORMATION, + user_stream_param: *const MINIDUMP_USER_STREAM_INFORMATION, + callback_param: *const MINIDUMP_CALLBACK_INFORMATION, ) -> BOOL; } diff --git a/third_party/rust/minidump-writer/src/windows/minidump_writer.rs b/third_party/rust/minidump-writer/src/windows/minidump_writer.rs index e538907bfa89..70cc420e579a 100644 --- a/third_party/rust/minidump-writer/src/windows/minidump_writer.rs +++ b/third_party/rust/minidump-writer/src/windows/minidump_writer.rs @@ -1,22 +1,17 @@ +#![allow(unsafe_code)] + use crate::windows::errors::Error; use crate::windows::ffi::{ - capture_context, GetCurrentProcess, GetCurrentThreadId, GetThreadContext, MiniDumpNormal, - MiniDumpWriteDump, OpenProcess, OpenThread, ResumeThread, SuspendThread, EXCEPTION_POINTERS, - HANDLE, MINIDUMP_EXCEPTION_INFORMATION, MINIDUMP_USER_STREAM, MINIDUMP_USER_STREAM_INFORMATION, + capture_context, CloseHandle, GetCurrentProcess, GetCurrentThreadId, GetThreadContext, + MiniDumpWriteDump, MinidumpType, OpenProcess, OpenThread, ResumeThread, SuspendThread, + EXCEPTION_POINTERS, EXCEPTION_RECORD, FALSE, HANDLE, MINIDUMP_EXCEPTION_INFORMATION, + MINIDUMP_USER_STREAM, MINIDUMP_USER_STREAM_INFORMATION, PROCESS_ALL_ACCESS, + STATUS_NONCONTINUABLE_EXCEPTION, THREAD_GET_CONTEXT, THREAD_QUERY_INFORMATION, + THREAD_SUSPEND_RESUME, }; use minidump_common::format::{BreakpadInfoValid, MINIDUMP_BREAKPAD_INFO, MINIDUMP_STREAM_TYPE}; use scroll::Pwrite; use std::os::windows::io::AsRawHandle; -use winapi::{ - shared::minwindef::FALSE, - um::{ - handleapi::CloseHandle, - winnt::{ - EXCEPTION_RECORD, PROCESS_ALL_ACCESS, STATUS_NONCONTINUABLE_EXCEPTION, - THREAD_GET_CONTEXT, THREAD_QUERY_INFORMATION, THREAD_SUSPEND_RESUME, - }, - }, -}; pub struct MinidumpWriter { /// Optional exception information @@ -29,7 +24,7 @@ pub struct MinidumpWriter { tid: u32, /// The exception code for the dump #[allow(dead_code)] - exception_code: u32, + exception_code: i32, /// Whether we are dumping the current process or not is_external_process: bool, } @@ -49,8 +44,9 @@ impl MinidumpWriter { /// function can also fail if `thread_id` is specified and we are unable to /// acquire the thread's context pub fn dump_local_context( - exception_code: Option, + exception_code: Option, thread_id: Option, + minidump_type: Option, destination: &mut std::fs::File, ) -> Result<(), Error> { let exception_code = exception_code.unwrap_or(STATUS_NONCONTINUABLE_EXCEPTION); @@ -76,7 +72,7 @@ impl MinidumpWriter { tid, // thread id ); - if thread_handle.is_null() { + if thread_handle == 0 { return Err(Error::ThreadOpen(std::io::Error::last_os_error())); } @@ -134,7 +130,7 @@ impl MinidumpWriter { exception_code, }; - Self::dump_crash_context(cc, destination) + Self::dump_crash_context(cc, minidump_type, destination) } } @@ -154,6 +150,7 @@ impl MinidumpWriter { /// for the duration of this function call. pub fn dump_crash_context( crash_context: crash_context::CrashContext, + minidump_type: Option, destination: &mut std::fs::File, ) -> Result<(), Error> { let pid = crash_context.process_id; @@ -167,7 +164,7 @@ impl MinidumpWriter { pid, // pid ); - if proc.is_null() { + if proc == 0 { return Err(std::io::Error::last_os_error().into()); } @@ -208,11 +205,15 @@ impl MinidumpWriter { is_external_process, }; - mdw.dump(destination) + mdw.dump(minidump_type, destination) } /// Writes a minidump to the specified file - fn dump(mut self, destination: &mut std::fs::File) -> Result<(), Error> { + fn dump( + mut self, + minidump_type: Option, + destination: &mut std::fs::File, + ) -> Result<(), Error> { let exc_info = self.exc_info.take(); let mut user_streams = Vec::with_capacity(1); @@ -241,7 +242,7 @@ impl MinidumpWriter { self.crashing_process, // HANDLE to the process with the crash we want to capture self.pid, // process id destination.as_raw_handle() as HANDLE, // file to write the minidump to - MiniDumpNormal, // MINIDUMP_TYPE - we _might_ want to make this configurable + minidump_type.unwrap_or(MinidumpType::Normal), exc_info .as_ref() .map_or(std::ptr::null(), |ei| ei as *const _), // exceptionparam - the actual exception information @@ -276,7 +277,7 @@ impl MinidumpWriter { validity: BreakpadInfoValid::DumpThreadId.bits() | BreakpadInfoValid::RequestingThreadId.bits(), dump_thread_id: self.tid, - // Safety: syscall + // SAFETY: syscall requesting_thread_id: unsafe { GetCurrentThreadId() }, }; diff --git a/third_party/rust/minidump-writer/tests/windows_minidump_writer.rs b/third_party/rust/minidump-writer/tests/windows_minidump_writer.rs index 9a6efa654962..1b2c1d4bb955 100644 --- a/third_party/rust/minidump-writer/tests/windows_minidump_writer.rs +++ b/third_party/rust/minidump-writer/tests/windows_minidump_writer.rs @@ -8,10 +8,11 @@ use minidump_writer::minidump_writer::MinidumpWriter; mod common; use common::start_child_and_return; -use winapi::um::{minwinbase::EXCEPTION_ILLEGAL_INSTRUCTION, winnt::STATUS_INVALID_PARAMETER}; - +const EXCEPTION_ILLEGAL_INSTRUCTION: i32 = -1073741795; +const STATUS_INVALID_PARAMETER: i32 = -1073741811; +#[link(name = "kernel32")] extern "system" { - pub(crate) fn GetCurrentThreadId() -> u32; + fn GetCurrentThreadId() -> u32; } fn get_crash_reason<'a, T: std::ops::Deref + 'a>( @@ -35,8 +36,13 @@ fn dump_current_process() { .tempfile() .unwrap(); - MinidumpWriter::dump_local_context(Some(STATUS_INVALID_PARAMETER), None, tmpfile.as_file_mut()) - .expect("failed to write minidump"); + MinidumpWriter::dump_local_context( + Some(STATUS_INVALID_PARAMETER), + None, + None, + tmpfile.as_file_mut(), + ) + .expect("failed to write minidump"); let md = Minidump::read_path(tmpfile.path()).expect("failed to read minidump"); @@ -83,6 +89,7 @@ fn dump_specific_thread() { MinidumpWriter::dump_local_context( Some(STATUS_INVALID_PARAMETER), Some(crashing_thread_id), + None, tmpfile.as_file_mut(), ) .expect("failed to write minidump"); @@ -140,6 +147,7 @@ fn dump_external_process() { (process_id, exception_pointers, thread_id, exception_code) }; + let exception_code = exception_code as i32; assert_eq!(exception_code, EXCEPTION_ILLEGAL_INSTRUCTION); let crash_context = crash_context::CrashContext { @@ -156,7 +164,7 @@ fn dump_external_process() { // SAFETY: We keep the process we are dumping alive until the minidump is written // and the test process keep the pointers it sent us alive until it is killed - MinidumpWriter::dump_crash_context(crash_context, tmpfile.as_file_mut()) + MinidumpWriter::dump_crash_context(crash_context, None, tmpfile.as_file_mut()) .expect("failed to write minidump"); child.kill().expect("failed to kill child"); diff --git a/toolkit/crashreporter/rust_minidump_writer_linux/Cargo.toml b/toolkit/crashreporter/rust_minidump_writer_linux/Cargo.toml index 50a68c4ecb70..b6028f6af9a5 100644 --- a/toolkit/crashreporter/rust_minidump_writer_linux/Cargo.toml +++ b/toolkit/crashreporter/rust_minidump_writer_linux/Cargo.toml @@ -8,8 +8,8 @@ license = "MPL-2.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -crash-context = "0.5.1" -minidump-writer = "0.7.0" +crash-context = "0.6.0" +minidump-writer = "0.8.0" libc = "0.2.74" anyhow = "1.0" nsstring = { path = "../../../xpcom/rust/nsstring/" }