Skip to content

Commit

Permalink
Bug 1695646 - minidump_writer_linux mapping merge logic wrong r=gsvelto
Browse files Browse the repository at this point in the history
The logic missed a pair of brackets, leading to memory regions
being merged that shouldn't have been merged (anonymous regions
with access flags set getting merged into the previous mapping)

Differential Revision: https://phabricator.services.mozilla.com/D106772
  • Loading branch information
M. Sirringhaus committed Mar 5, 2021
1 parent 7ae7603 commit bcaf9b7
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .cargo/config.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ rev = "4af6c367603869a30fddb5ffb0aba2b9477ba92e"
[source."https://github.com/msirringhaus/minidump_writer_linux.git"]
git = "https://github.com/msirringhaus/minidump_writer_linux.git"
replace-with = "vendored-sources"
rev = "9191af36343846b2c7ada65b9602b481b717c4d8"
rev = "01c7a0da8d34059f7dae8ab9e7512529ff16347a"

[source."https://github.com/mozilla/neqo"]
git = "https://github.com/mozilla/neqo"
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ spirv_cross = { git = "https://github.com/kvark/spirv_cross", branch = "wgpu5" }
# failure's backtrace feature might break our builds, see bug 1608157.
failure = { git = "https://github.com/badboy/failure", rev = "64af847bc5fdcb6d2438bec8a6030812a80519a5" }
failure_derive = { git = "https://github.com/badboy/failure", rev = "64af847bc5fdcb6d2438bec8a6030812a80519a5" }
minidump_writer_linux = { git = "https://github.com/msirringhaus/minidump_writer_linux.git", rev = "9191af36343846b2c7ada65b9602b481b717c4d8" }
minidump_writer_linux = { git = "https://github.com/msirringhaus/minidump_writer_linux.git", rev = "01c7a0da8d34059f7dae8ab9e7512529ff16347a" }

[patch.crates-io.cranelift-codegen]
git = "https://github.com/mozilla-spidermonkey/wasmtime"
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"files":{"Cargo.toml":"61afd471ff97dc0bdae414fc55bdde602e25158b6d2813ea74d24fc0ce690ffb","LICENSE":"1ecdd8e8977af83c07c5f97bec87b47d27059b7ea323ca3160fbfa2314f5d99c","src/android.rs":"98ba5923bee1a08ea9e07f85fce47f8e09ddbd9b3619fc981e4bbf425db0f94b","src/app_memory.rs":"909676c916c0ffaa3a813632c162f5b1207f8502408b6b3bab48a5f842948c71","src/auxv_reader.rs":"29a03c082c179733ddefee59e903dc5a43b7e681f55a1fdd9cfdec7587bd7b35","src/bin/test.rs":"b4b119a25ab1fcd71958061c23f741e956b81db28c4d7f8c5728b62eff0913e0","src/cpu_set.rs":"8b60d5a9a37c49b105075b856d05a5d8c201554923bc40a52407e034fd21681d","src/crash_context/crash_context_aarch64.rs":"ce477360b5d16f11814b195fb12c461183bd06fd08cdd14e76c9c2bdcbaccd47","src/crash_context/crash_context_arm.rs":"6e2f1db21b93fadfa034a5246c70687d6654a40627f1ecf849511cf480a96bad","src/crash_context/crash_context_mips.rs":"430669c21f03cefd479e46265dc3c4d3495acaf8b01da09dc0b0e4168306b508","src/crash_context/crash_context_x86.rs":"136a1b0f8107986505df95a1a5423f352ae3ea383e25335e60c6242acdff34da","src/crash_context/crash_context_x86_64.rs":"8fb5f86944ec5a02bc6a7dba4ef698d088686de2cf5fb0a6014592ae394c2e47","src/crash_context/mod.rs":"0e09ca5489194586580a8da6eca274fe6db8af213b804f1e407612c03c02475c","src/dso_debug.rs":"16f1701f204f9cd418382a556de4205e73ea6505a5705babf2dceb6a31732cf9","src/dumper_cpu_info/cpu_info_arm.rs":"5a53da0411922cfea71330ff5d48ddb4bff581665abfb56cfaf05d3f7177e858","src/dumper_cpu_info/cpu_info_x86_mips.rs":"331f10edc5385282f3615bfa93049fe8a97bc81ebea761100fc56752ed2ad6b8","src/dumper_cpu_info/mod.rs":"5322108f35021cf03d61ccb4c54a2b4875dfdff774a4297148925d76525d125c","src/errors.rs":"95eed17b22b3b86ed13bb9be23e77e38319beaa9ce6138f47d906e3b8fb9599b","src/lib.rs":"65617923decad2a5aaf86a1f055b5fceb09390154a8f96c4cc6efab1b5cc24dc","src/linux_ptrace_dumper.rs":"1f3becdde18f03d8707b32328d81e6d217219c5a7388a8b9f8a5abe941b4f5ed","src/maps_reader.rs":"84bb973cc45cb7b46ba86236bd143d20524e8c2df666e60e7bca567f1322772c","src/minidump_cpu/minidump_cpu_aarch64.rs":"18524f8a3a3d3eda7d0fafb1c168ff06dee1886da0f4278f3c2a54147ef79bc9","src/minidump_cpu/minidump_cpu_amd64.rs":"c4b3cef86ea53864c026d7c598d8a7f59ca6b1ad7e881f94ce34f39dd6b72e33","src/minidump_cpu/minidump_cpu_arm.rs":"bfbcbf280da47d715189f76c8d9749cb2808d7730bb1fe906a21b42a16c3b044","src/minidump_cpu/minidump_cpu_mips.rs":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","src/minidump_cpu/minidump_cpu_ppc.rs":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","src/minidump_cpu/minidump_cpu_ppc64.rs":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","src/minidump_cpu/minidump_cpu_sparc.rs":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","src/minidump_cpu/minidump_cpu_x86.rs":"3dcb2aa4264d76f0727b9750ffce0032738bea97be95fde92089a9d11926c63c","src/minidump_cpu/mod.rs":"50e8df5e294e9d162c97dacb9448bba0ffc1e4bf992f8a2b9cc718f12b92a370","src/minidump_format.rs":"56f737bd95fbbd5b4b3d7773dc491e267887d78b12916645bccbcef16acf2cfc","src/minidump_writer.rs":"abc05364f455b0b119e07cba74b2aeb84c04bd9eec19178290eb2906a2769d87","src/sections/app_memory.rs":"6fb616e0aa495fd5d9a487231750ac3c2ffa275802adf0f7e60c7666f5e14a60","src/sections/exception_stream.rs":"5c49b80b5acf3694c0c2e275b083ae8f544ed7ba7b8d417303706bfaadf3419e","src/sections/mappings.rs":"f2b5fadb25848cf7d5dd46fae2ef52bfad380cd64738381f33e7c0884a565e81","src/sections/memory_list_stream.rs":"02e678bd28de10e854d673ccefeb574067e64bdaefda5212a8161ea194280a7d","src/sections/mod.rs":"616c70e74d01b1116df0c9c1883f2c80aa74ab3056aeea4ed4e3f8b7c8866582","src/sections/systeminfo_stream.rs":"d481a86c6aa86a32378bb3d60b6f7f09fd57155dfa728d0dfa50aa17ef72c836","src/sections/thread_list_stream.rs":"4dd6a6342d481307f25c3f49e8a1cd080aa4dd46338bf50b6bb2ab7c01a143c7","src/thread_info/mod.rs":"b12363de1898f1f36446f00dea4c3bad6d7bb3f24e724f95a44dbae05aca2073","src/thread_info/thread_info_aarch64.rs":"6e443b2401c651d7607df251015566e7e6183a7522594d51da210a4594d62434","src/thread_info/thread_info_arm.rs":"ed291949474db210ecc8bf77c0a1c0d4cdf04882e05f5c92531905aa3f1cc705","src/thread_info/thread_info_mips.rs":"332d7888bb08a36d3b77023a4a0385193a07b1c6c5bf0e91aacb5d948ba8b903","src/thread_info/thread_info_x86.rs":"fbde8930f8d277d58faa34d90ddf6f27d6438cd5a3c017df4f878897f6f84eca","tests/common/mod.rs":"57b9df4b02b48a82451a2352359ed78a6a7f05e8157762d324bfa5344c208715","tests/minidump_writer.rs":"50e1bf1dcdabfcc82ef992989a2b19db4d3d471ce6ecd44309f824da6c874236","tests/ptrace_dumper.rs":"47a31bcd5738d84a3699fb0753696ad6bf5caef77240b4ae9c30e5ca236d1132"},"package":null}
{"files":{"Cargo.toml":"61afd471ff97dc0bdae414fc55bdde602e25158b6d2813ea74d24fc0ce690ffb","LICENSE":"1ecdd8e8977af83c07c5f97bec87b47d27059b7ea323ca3160fbfa2314f5d99c","src/android.rs":"98ba5923bee1a08ea9e07f85fce47f8e09ddbd9b3619fc981e4bbf425db0f94b","src/app_memory.rs":"909676c916c0ffaa3a813632c162f5b1207f8502408b6b3bab48a5f842948c71","src/auxv_reader.rs":"29a03c082c179733ddefee59e903dc5a43b7e681f55a1fdd9cfdec7587bd7b35","src/bin/test.rs":"b4b119a25ab1fcd71958061c23f741e956b81db28c4d7f8c5728b62eff0913e0","src/cpu_set.rs":"8b60d5a9a37c49b105075b856d05a5d8c201554923bc40a52407e034fd21681d","src/crash_context/crash_context_aarch64.rs":"ce477360b5d16f11814b195fb12c461183bd06fd08cdd14e76c9c2bdcbaccd47","src/crash_context/crash_context_arm.rs":"6e2f1db21b93fadfa034a5246c70687d6654a40627f1ecf849511cf480a96bad","src/crash_context/crash_context_mips.rs":"430669c21f03cefd479e46265dc3c4d3495acaf8b01da09dc0b0e4168306b508","src/crash_context/crash_context_x86.rs":"136a1b0f8107986505df95a1a5423f352ae3ea383e25335e60c6242acdff34da","src/crash_context/crash_context_x86_64.rs":"8fb5f86944ec5a02bc6a7dba4ef698d088686de2cf5fb0a6014592ae394c2e47","src/crash_context/mod.rs":"0e09ca5489194586580a8da6eca274fe6db8af213b804f1e407612c03c02475c","src/dso_debug.rs":"16f1701f204f9cd418382a556de4205e73ea6505a5705babf2dceb6a31732cf9","src/dumper_cpu_info/cpu_info_arm.rs":"5a53da0411922cfea71330ff5d48ddb4bff581665abfb56cfaf05d3f7177e858","src/dumper_cpu_info/cpu_info_x86_mips.rs":"331f10edc5385282f3615bfa93049fe8a97bc81ebea761100fc56752ed2ad6b8","src/dumper_cpu_info/mod.rs":"5322108f35021cf03d61ccb4c54a2b4875dfdff774a4297148925d76525d125c","src/errors.rs":"95eed17b22b3b86ed13bb9be23e77e38319beaa9ce6138f47d906e3b8fb9599b","src/lib.rs":"65617923decad2a5aaf86a1f055b5fceb09390154a8f96c4cc6efab1b5cc24dc","src/linux_ptrace_dumper.rs":"1f3becdde18f03d8707b32328d81e6d217219c5a7388a8b9f8a5abe941b4f5ed","src/maps_reader.rs":"585fe31815421c7ca798a8277b6dc3a79254e7ef0aa1817a1b0c2bbd5e3dd623","src/minidump_cpu/minidump_cpu_aarch64.rs":"18524f8a3a3d3eda7d0fafb1c168ff06dee1886da0f4278f3c2a54147ef79bc9","src/minidump_cpu/minidump_cpu_amd64.rs":"c4b3cef86ea53864c026d7c598d8a7f59ca6b1ad7e881f94ce34f39dd6b72e33","src/minidump_cpu/minidump_cpu_arm.rs":"bfbcbf280da47d715189f76c8d9749cb2808d7730bb1fe906a21b42a16c3b044","src/minidump_cpu/minidump_cpu_mips.rs":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","src/minidump_cpu/minidump_cpu_ppc.rs":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","src/minidump_cpu/minidump_cpu_ppc64.rs":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","src/minidump_cpu/minidump_cpu_sparc.rs":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","src/minidump_cpu/minidump_cpu_x86.rs":"3dcb2aa4264d76f0727b9750ffce0032738bea97be95fde92089a9d11926c63c","src/minidump_cpu/mod.rs":"50e8df5e294e9d162c97dacb9448bba0ffc1e4bf992f8a2b9cc718f12b92a370","src/minidump_format.rs":"56f737bd95fbbd5b4b3d7773dc491e267887d78b12916645bccbcef16acf2cfc","src/minidump_writer.rs":"abc05364f455b0b119e07cba74b2aeb84c04bd9eec19178290eb2906a2769d87","src/sections/app_memory.rs":"6fb616e0aa495fd5d9a487231750ac3c2ffa275802adf0f7e60c7666f5e14a60","src/sections/exception_stream.rs":"5c49b80b5acf3694c0c2e275b083ae8f544ed7ba7b8d417303706bfaadf3419e","src/sections/mappings.rs":"f2b5fadb25848cf7d5dd46fae2ef52bfad380cd64738381f33e7c0884a565e81","src/sections/memory_list_stream.rs":"02e678bd28de10e854d673ccefeb574067e64bdaefda5212a8161ea194280a7d","src/sections/mod.rs":"616c70e74d01b1116df0c9c1883f2c80aa74ab3056aeea4ed4e3f8b7c8866582","src/sections/systeminfo_stream.rs":"d481a86c6aa86a32378bb3d60b6f7f09fd57155dfa728d0dfa50aa17ef72c836","src/sections/thread_list_stream.rs":"4dd6a6342d481307f25c3f49e8a1cd080aa4dd46338bf50b6bb2ab7c01a143c7","src/thread_info/mod.rs":"b12363de1898f1f36446f00dea4c3bad6d7bb3f24e724f95a44dbae05aca2073","src/thread_info/thread_info_aarch64.rs":"6e443b2401c651d7607df251015566e7e6183a7522594d51da210a4594d62434","src/thread_info/thread_info_arm.rs":"ed291949474db210ecc8bf77c0a1c0d4cdf04882e05f5c92531905aa3f1cc705","src/thread_info/thread_info_mips.rs":"332d7888bb08a36d3b77023a4a0385193a07b1c6c5bf0e91aacb5d948ba8b903","src/thread_info/thread_info_x86.rs":"fbde8930f8d277d58faa34d90ddf6f27d6438cd5a3c017df4f878897f6f84eca","tests/common/mod.rs":"57b9df4b02b48a82451a2352359ed78a6a7f05e8157762d324bfa5344c208715","tests/minidump_writer.rs":"50e1bf1dcdabfcc82ef992989a2b19db4d3d471ce6ecd44309f824da6c874236","tests/ptrace_dumper.rs":"47a31bcd5738d84a3699fb0753696ad6bf5caef77240b4ae9c30e5ca236d1132"},"package":null}
8 changes: 4 additions & 4 deletions third_party/rust/minidump_writer_linux/src/maps_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use std::path::PathBuf;
pub const LINUX_GATE_LIBRARY_NAME: &'static str = "linux-gate.so";
pub const DELETED_SUFFIX: &'static str = " (deleted)";
pub const MOZILLA_IPC_PREFIX: &'static str = "org.mozilla.ipc.";
pub const RESERVED_FLAGS: &'static str = " ---p";
pub const RESERVED_FLAGS: &'static str = "---p";

type Result<T> = std::result::Result<T, MapsReaderError>;

Expand Down Expand Up @@ -170,8 +170,8 @@ impl MappingInfo {
if (start_address == module_end_address)
&& module.executable
&& is_mapping_a_path(module.name.as_deref())
&& offset == 0
|| offset == module_end_address && perms == RESERVED_FLAGS
&& (offset == 0 || offset == module_end_address)
&& perms == RESERVED_FLAGS
{
module.size = end_address - module.start_address;
return Ok(MappingInfoParsingResult::SkipLine);
Expand Down Expand Up @@ -409,7 +409,7 @@ mod tests {
"7efd96d85000-7efd96d86000 ---p 001c1000 00:31 4996104 /lib64/libc-2.32.so",
"7efd96d86000-7efd96d89000 r--p 001c1000 00:31 4996104 /lib64/libc-2.32.so",
"7efd96d89000-7efd96d8c000 rw-p 001c4000 00:31 4996104 /lib64/libc-2.32.so",
"7efd96d8c000-7efd96d92000 rw-p 00000000 00:00 0",
"7efd96d8c000-7efd96d92000 ---p 00000000 00:00 0",
"7efd96da0000-7efd96da1000 r--p 00000000 00:31 5004379 /usr/lib/locale/en_US.utf8/LC_NUMERIC",
"7efd96da1000-7efd96da2000 r--p 00000000 00:31 5004382 /usr/lib/locale/en_US.utf8/LC_TIME",
"7efd96da2000-7efd96da3000 r--p 00000000 00:31 5004377 /usr/lib/locale/en_US.utf8/LC_MONETARY",
Expand Down

0 comments on commit bcaf9b7

Please sign in to comment.