Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Commit

Permalink
update 3rd-party Rust dependencies (#1040)
Browse files Browse the repository at this point in the history
  • Loading branch information
bmc-msft authored Jul 6, 2021
1 parent 51ddaaa commit aa4ed28
Show file tree
Hide file tree
Showing 11 changed files with 214 additions and 454 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ env:
CARGO_TERM_COLOR: always
SCCACHE_DIR: ${{github.workspace}}/sccache/
SCCACHE_CACHE_SIZE: 1G
ACTIONS_CACHE_KEY_DATE: 2021-06-30-01
ACTIONS_CACHE_KEY_DATE: 2021-07-06-01

jobs:
agent:
Expand Down Expand Up @@ -171,11 +171,10 @@ jobs:
id: cache-rust-prereqs
with:
path: |
sccache
~/.cargo/registry
~/.cargo/git
~/.cargo/bin
key: rust-${{ runner.os }}-2020-06-25-01
key: rust-${{ runner.os }}-${{ env.ACTIONS_CACHE_KEY_DATE }}
restore-keys: |
rust-${{ runner.os }}
- name: Install Rust Prereqs
Expand Down
37 changes: 19 additions & 18 deletions src/agent/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 src/agent/coverage/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ pdb = "0.7"
winapi = "0.3"

[target.'cfg(target_os = "linux")'.dependencies]
pete = "0.5"
pete = "0.6"
procfs = "0.9"

[dev-dependencies]
Expand Down
14 changes: 8 additions & 6 deletions src/agent/coverage/src/block/linux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,18 +85,20 @@ impl<'c> Recorder<'c> {

while let Some(mut tracee) = self.tracer.wait().context("main tracing loop")? {
match tracee.stop {
Stop::SyscallEnterStop(..) => log::trace!("syscall-enter: {:?}", tracee.stop),
Stop::SyscallExitStop(..) => {
Stop::SyscallEnter => log::trace!("syscall-enter: {:?}", tracee.stop),
Stop::SyscallExit => {
self.update_images(&mut tracee)
.context("updating module images after syscall-stop")?;
}
Stop::SignalDeliveryStop(_pid, Signal::SIGTRAP) => {
Stop::SignalDelivery {
signal: Signal::SIGTRAP,
} => {
self.on_breakpoint(&mut tracee)
.context("calling breakpoint handler")?;
}
Stop::Clone(pid, tid) => {
Stop::Clone { new: pid } => {
// Only seen when the `VM_CLONE` flag is set, as of Linux 4.15.
log::info!("new thread: {} -> {}", pid, tid);
log::info!("new thread: {}", pid);
}
_ => {
log::debug!("stop: {:?}", tracee.stop);
Expand Down Expand Up @@ -411,7 +413,7 @@ impl Breakpoints {

fn continue_to_init_execve(tracer: &mut Ptracer) -> Result<Tracee> {
while let Some(tracee) = tracer.wait()? {
if let Stop::SyscallExitStop(..) = &tracee.stop {
if let Stop::SyscallExit = &tracee.stop {
return Ok(tracee);
}

Expand Down
12 changes: 2 additions & 10 deletions src/agent/coverage/src/code.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,20 +128,12 @@ impl ModuleIndex {
}

if sym.is_function() {
let name = match elf.strtab.get(sym.st_name) {
let name = match elf.strtab.get_at(sym.st_name) {
None => {
log::error!("symbol not found in symbol string table: {:?}", sym);
continue;
}
Some(Err(err)) => {
log::error!(
"unable to parse symbol name: sym = {:?}, err = {}",
sym,
err
);
continue;
}
Some(Ok(name)) => name.to_owned(),
Some(name) => name.to_owned(),
};

// For executables and shared objects, `st_value` contains the VA of the symbol.
Expand Down
4 changes: 2 additions & 2 deletions src/agent/coverage/src/elf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ impl<'d, 'e> ElfContext<'d, 'e> {
let name = self
.elf
.strtab
.get(sym.st_name)
.ok_or_else(|| format_err!("symbol index out of bounds: {}", sym.st_name))??
.get_at(sym.st_name)
.ok_or_else(|| format_err!("symbol index out of bounds: {}", sym.st_name))?
.to_owned();

Ok(name)
Expand Down
2 changes: 1 addition & 1 deletion src/agent/onefuzz-supervisor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
storage-queue = { path = "../storage-queue" }
structopt = "0.3"
tokio = { version = "1.7", features = ["full"] }
tokio = { version = "1.8", features = ["full"] }
url = { version = "2.2", features = ["serde"] }
uuid = { version = "0.8", features = ["serde", "v4"] }
clap = "2.33"
Expand Down
2 changes: 1 addition & 1 deletion src/agent/onefuzz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,6 @@ cpp_demangle = "0.3"
nix = "0.21"

[target.'cfg(target_os = "linux")'.dependencies]
pete = "0.5"
pete = "0.6"
rstack = "0.3"
proc-maps = "0.1"
25 changes: 11 additions & 14 deletions src/agent/onefuzz/src/triage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,24 +54,21 @@ impl TriageCommand {
let mut exit_status = None;

while let Some(tracee) = self.tracer.wait()? {
if let Stop::SignalDeliveryStop(pid, signal) = tracee.stop {
if CRASH_SIGNALS.contains(&signal) {
// Can unwrap due to signal-delivery-stop.
let siginfo = tracee.siginfo()?.unwrap();
crashes.push(Crash::new(pid, signal, siginfo)?);
match tracee.stop {
Stop::SignalDelivery { signal } => {
if CRASH_SIGNALS.contains(&signal) {
// Can unwrap due to signal-delivery-stop.
let siginfo = tracee.siginfo()?.unwrap();
crashes.push(Crash::new(self.pid, signal, siginfo)?);
}
}
}

if let Stop::Exiting(pid, exit_code) = tracee.stop {
if pid == self.pid {
Stop::Exiting { exit_code } => {
exit_status = Some(ExitStatus::Exited(exit_code));
}
}

if let Stop::Signaling(pid, signal, _core_dump) = tracee.stop {
if pid == self.pid {
Stop::Signaling { signal, .. } => {
exit_status = Some(ExitStatus::Signaled(signal));
}
_ => {}
}

self.tracer.restart(tracee, Restart::Continue)?;
Expand Down Expand Up @@ -369,7 +366,7 @@ mod se {

fn continue_to_init_execve(tracer: &mut Ptracer) -> Result<Tracee> {
while let Some(tracee) = tracer.wait()? {
if let Stop::SyscallExitStop(..) = &tracee.stop {
if let Stop::SyscallExit = &tracee.stop {
return Ok(tracee);
}

Expand Down
Loading

0 comments on commit aa4ed28

Please sign in to comment.