mirror of https://github.com/pwndbg/pwndbg.git
Fix vmmap coredump test (#1391)
* fix shlint * Fix crash when unable to get ehdr and fix vmmap coredump test This commit fixes two issues and test them. 1. It changes the reads in `get_ehdr` to partial reads so that inability to read the `vmmap.start` address there will not crash Pwndbg with `gdb.error` but instead we will simply return `None` as expected from this function. This crash could happen on Debian 10 (GDB 8.2.1) and Ubuntu 18.04 (not sure which GDB) when you did: - gdb ./binary-that-crashes - `run` - `generate-core-file /tmp/core` - `file` - to unload the binary - `core-file /tmp/core` - to load the generated core At this point I think we may have preserved the old vmmap info and use it in `get_ehdr` maybe, which then crashed? I am not sure, but this fix here works. To test this behavior properly I also added the `unload_file` parametrization to the `test_command_vmmap_on_coredump_on_crash_simple_binary` test. 2. We fix the vmmap coredump test case when the `info proc mappings` returns nothing on core dumps on old GDBs. In such case we are missing the vmmap info about the binary mapping, so now we properly remove it in the test.pull/1393/head
parent
117e69f842
commit
c6ab8dc671
Loading…
Reference in new issue