Summary: Removes usage of the `bench_black_box` unstable feature. This brings us one step closer to removing all usage of unstable nightly features, which will allow publishing a crate on https://crates.io.
Reviewed By: rrnewton
Differential Revision: D41387686
fbshipit-source-id: 98bfcf053cd320137dbf62f4ef24beb835e1f0df
Summary: Removes usage of the `map_first_last` unstable feature. This brings us one step closer to removing all usage of unstable nightly features, which will allow publishing a crate on https://crates.io.
Reviewed By: rrnewton
Differential Revision: D41387687
fbshipit-source-id: 05184220a6d6cd5ec03339845741b46e9557ca83
Summary: Removes usage of the `async_closure` unstable feature. This brings us one step closer to removing all usage of unstable nightly features, which will allow publishing a crate on https://crates.io.
Reviewed By: rrnewton
Differential Revision: D41387688
fbshipit-source-id: 136c5c8d19876e732d18dca195e87e3bc2ab7661
Summary:
This contains a couple of big fixes for stack traces:
1. Fixes missing symbols for executables.
2. Fixes missing file and line numbers for libraries that use the `gnu_debuglink` feature (where the actual debug information is in a separate file).
Reviewed By: wkhughes
Differential Revision: D41366208
fbshipit-source-id: dd9bb8099ecdab4668846acc67c3b56a04cc96cf
Summary: We want to allow precise timers with an instruction offset. While single stepping we have target and current value of the counter and once we match branches we only increment instructions
Reviewed By: jasonwhite
Differential Revision: D41269879
fbshipit-source-id: 46b3307249663de10607513dc59d8436ca907f78
Summary: These previous launch_* functions can be simplified by using RunOpts to contain all the relevant information about a run, plus everything needed to print a reproducer command.
Reviewed By: VladimirMakaev
Differential Revision: D41329114
fbshipit-source-id: 5bab08dfbf28e1cee7fd244178e03ba2cdc1ba34
Summary: `libunwind` isn't able to resolve symbols from the symbol table. There seems to be a regression preventing this from working. This partially fixes symbol lookup for stack frames by using the `object` crate for looking up symbols in the symbol table. This is a partial fix because symbol lookup does not seem to work yet for executables (only shared libraries).
Reviewed By: VladimirMakaev
Differential Revision: D41290099
fbshipit-source-id: 5d4ad1173f6ab1ca6c2995369c2dedb4a9f30e86
Summary: Adds `ReadFamily` to make it easier to handle all `read` syscall variants.
Reviewed By: igorsugak
Differential Revision: D41239542
fbshipit-source-id: 2c847e421b38281aa5243d8dfc00a8d1de0c075a
Summary: These operations are misleading and should never be called. Since the address could be a remote address, dereferencing it like this is wildly wrong. Not quite sure how they got there in the first place.
Reviewed By: igorsugak
Differential Revision: D41193389
fbshipit-source-id: 143c491df81125b319f7d5d88049021a81981795
Summary:
This adds an ability to decode an instruction on top of the safeptrace::Stopped task and enables debug! tracing when single-stepping.
Note that performance overhead should not be present when higher tracing level is requested
Reviewed By: jasonwhite
Differential Revision: D40895393
fbshipit-source-id: 867f237a0517304314f4ac43313c1f26cee3f646
Summary:
Implementing Displayable can be quite annoying (see D40877692)
This macro provides a boilerplate implementation for a custom struct wrapper for AddrMut<T>
Additional customization can be achieved by implementing Displayable for T
Reviewed By: jasonwhite
Differential Revision: D40946491
fbshipit-source-id: daff74b2c0c23c6d970f920c7d43ab2c381a1dcb
Summary: While investigating a test failure I've narrowed down a divergence to a gettimeofday syscall having different result in trace-replay use case in certain conditions. In this diff I'm enhacing the syscalls DETLOGS with "output buffers" derefed. Currently barelly any of the parameters are supported but hopefully we'll handle Displayable in a more general purpose way in a future
Reviewed By: jasonwhite
Differential Revision: D40877692
fbshipit-source-id: 47c3d310713e400fb2ab18dc736b84999e8c7b99
Summary: this adds more compact and reusable way to display libc::user_regs_struct
Reviewed By: jasonwhite
Differential Revision: D40895319
fbshipit-source-id: fde83d834cc4179bfc6a6aa8d77a4de5f6598e1b
Summary: Now that `Tool` doesn't require `Serialize` and `Deserialize`, we can remove these unnecessary derives. Hopefully this will have a slight improvement to compile-times.
Reviewed By: wkhughes
Differential Revision: D40958697
fbshipit-source-id: 88aa1f4ee2b953ba287d749c88d200c2887ccd46
Summary: Nothing relies on this requirement nor do I think anything ever will rely on this requirement. If I recall correctly, the reason this was originally added is because a hypothetical in-guest Reverie backend might need to copy the process-level state after a fork/clone/execve. However, after getting far enough into the implementation of an in-guest backend, I don't think this is something we'll ever need to do. For fork/clone, the address space is just forked, so we already have the process-level state. If, for some reason, we need to re-copy some process-level state into a new process post-execve, we can just leave that up to the tool to implement (by doing RPC calls).
Reviewed By: wkhughes
Differential Revision: D40958698
fbshipit-source-id: a41244102ca20fdfd28ab34180d098a13273949a
Summary:
This was from the *before times* when `core::arch::asm` wasn't yet stable. `llvm_asm!()` has been removed from recent versions of rustc, so this stuff won't even compile anymore.
Note that this also removes a rather large block of `llvm_asm` (`check_for_xen_pmi_bug`) that hasn't yet been migrated over to the new asm syntax. This seems like a lot of work for little benefit, so I'm just deleting it for now.
Differential Revision: D40957341
fbshipit-source-id: 2b9bf97e93eaa9462295b9060907530dd797e288
Summary: The syscall `fstatat` is defined a bit weirdly on x86-64 as `newfstatat`. To make the platform differences slightly easier to deal with, lets just define a type alias for it.
Reviewed By: wkhughes
Differential Revision: D40910778
fbshipit-source-id: 4bf307e574d2d2c13f1cf764e7604b32113d209e
Summary: Fixes `skip_seccomp_syscall` on aarch64 to *actually* skip the syscall. I plan on cleaning this up a bit more in a later diff because we are calling `getregs` and `setregs` more than necessary on a per-interception basis.
Reviewed By: VladimirMakaev
Differential Revision: D40867423
fbshipit-source-id: d72b4998b5c1c44f426a9129eccb205ccfc320fa
Summary: This checks that intercepted syscalls are actually skipped (by setting the syscall to -1). This was found to not be working on aarch64 and is fixed in the next diff.
Reviewed By: VladimirMakaev
Differential Revision: D40867424
fbshipit-source-id: 7ac514c060a2611aac8cc4a8bb7540aa3d7302fb
Summary: This fixes the initial syscall injection on aarch64. This also does slight simplification of the instructions that get plopped down at the current instruction pointer so that we can fit the instructions into a single word. That is, instead of injecting `INT3; SYSCALL; INT3`, we inject `SYSCALL; INT3`.
Reviewed By: VladimirMakaev
Differential Revision: D40867427
fbshipit-source-id: 2afa96f2270e16284523a17b09da00529893c20e
Summary: Gets all tests in `reverie-process` successfully working on aarch64.
Reviewed By: VladimirMakaev
Differential Revision: D40867425
fbshipit-source-id: 4aa7b0be17a40f677baf5de312a0765f8c41c2a4
Summary: See comment for an explanation of why this is needed. These tests should eventually be updated to work on aarch64.
Reviewed By: VladimirMakaev
Differential Revision: D40867431
fbshipit-source-id: 089e8bd61bec21556bdebc8b1f89dd4d18aa0910
Summary: Change the `sub` instruction to `subs` as the latter is needed to update the condition code that `be.n` relies on.
Reviewed By: VladimirMakaev
Differential Revision: D40867430
fbshipit-source-id: b45987b5ccd4af784988f14fe0d6b3ac97b5ad80
Summary: This adds VDSO stubs for aarch64 so that we can intercept VDSO calls. See the comments in the code for more details.
Reviewed By: VladimirMakaev
Differential Revision: D40867428
fbshipit-source-id: 136818d9dbf52f4297dd4dae041e3e6dfe0764ae
Summary: Update from 0.2.135 to 0.2.137, the latest version on crates.io, in preparation for backporting a PR in the diff after this one.
Reviewed By: zertosh
Differential Revision: D40874274
fbshipit-source-id: debf9dae82ecc20201470e634f10904a2b308e51
Summary: To do proper feature detection on the CPU to know if we can get perf events, there is more work to do here. See the comment on `get_rcb_perf_config` for more info.
Reviewed By: VladimirMakaev
Differential Revision: D40701837
fbshipit-source-id: 4c7a7c00be0ab14e4fe9f4be09c8094567d5d031
Summary: This is a more architecture-independent name.
Reviewed By: VladimirMakaev
Differential Revision: D40701833
fbshipit-source-id: 66b77c6f62886ecd776a3efbc0b71248f875914e
Summary: These definitions are x86_64-specific, so they should be defined in their own file. Later, we'll add definitions for aarch64.
Reviewed By: VladimirMakaev
Differential Revision: D40701840
fbshipit-source-id: 0c52334dc7eb9bb60020c45c3f2ef58077c20322