Add CI for utils (#3224)

This commit is contained in:
WorksButNotTested 2025-05-15 05:45:17 +01:00 committed by GitHub
parent e3a3dfb41b
commit 2e0d6343af
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 59 additions and 13 deletions

View File

@ -412,6 +412,38 @@ jobs:
shell: bash
run: unset RUSTC && ARCH=${{ matrix.arch }} RUN_ON_CI=1 LLVM_CONFIG=llvm-config-${{env.MAIN_LLVM_VERSION}} cargo run --manifest-path ./utils/ci_runner/Cargo.toml -- ${{ matrix.fuzzer }}
utils:
strategy:
matrix:
os: [ubuntu-24.04]
fuzzer:
# Binary only
- ./utils/gdb_qemu
arch:
# unless somebody pays us for the servers.
# - aarch64
# - arm
# - i386
# - ppc
- x86_64
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: ./.github/workflows/ubuntu-prepare
- name: Add rustfmt nightly
shell: bash
run: rustup component add --toolchain nightly-x86_64-unknown-linux-gnu rustfmt
- name: Install deps
run: sudo apt-get update && sudo apt-get install -y g++-powerpc-linux-gnu gcc-powerpc-linux-gnu gdb-multiarch
- name: Add rust targets
shell: bash
run: rustup target add --toolchain nightly-x86_64-unknown-linux-gnu powerpc-unknown-linux-gnu
- name: Build and run utils (Linux)
if: runner.os == 'Linux'
shell: bash
run: just -d ${{ matrix.fuzzer }} --justfile ${{ matrix.fuzzer }}/Justfile test
librasan-build:
runs-on: ubuntu-24.04
needs:

View File

@ -24,7 +24,22 @@ build: format
run: demo
cargo run -p gdb_qemu --profile {{PROFILE}} -- -p 1234 -L trace qemu-ppc -- -L /usr/powerpc-linux-gnu -g 1234 {{DEMO_DIR}}/gdb_demo
gdb:
gdb-multiarch -ex "set architecture powerpc:MPC8XX" -ex "set pagination off" -ex "set confirm off" -ex "file {{DEMO_DIR}}/gdb_demo" -ex "target remote | {{HOST_DIR}}/gdb_qemu -p 1234 -L trace qemu-ppc -- -L /usr/powerpc-linux-gnu -g 1234 {{DEMO_DIR}}/gdb_demo"
gdb: demo build
gdb-multiarch \
-ex "set architecture powerpc:MPC8XX" \
-ex "set pagination off" \
-ex "set confirm off" \
-ex "file {{DEMO_DIR}}/gdb_demo" \
-ex "target remote | {{HOST_DIR}}/gdb_qemu -p 1234 -L trace qemu-ppc -- -L /usr/powerpc-linux-gnu -g 1234 {{DEMO_DIR}}/gdb_demo"
test: demo build
gdb-multiarch \
-ex "set architecture powerpc:MPC8XX" \
-ex "set pagination off" \
-ex "set confirm off" \
-ex "file {{DEMO_DIR}}/gdb_demo" \
-ex "target remote | {{HOST_DIR}}/gdb_qemu -p 1234 -L trace qemu-ppc -- -L /usr/powerpc-linux-gnu -g 1234 {{DEMO_DIR}}/gdb_demo" \
-ex "c" \
-ex "q"
all: demo build

View File

@ -1,6 +1,6 @@
use std::fmt::Write;
use clap::{builder::Str, Parser};
use clap::{Parser, builder::Str};
#[derive(Default)]
pub struct Version;

View File

@ -3,7 +3,7 @@ use std::{
os::fd::{AsRawFd, RawFd},
};
use anyhow::{anyhow, Result};
use anyhow::{Result, anyhow};
use nix::unistd::{dup2, execvp};
use crate::{args::ChildArgs, exit::Exit};

View File

@ -1,9 +1,9 @@
use anyhow::{anyhow, Result};
use libc::{_exit, prctl, PR_SET_PDEATHSIG};
use anyhow::{Result, anyhow};
use libc::{_exit, PR_SET_PDEATHSIG, prctl};
use nix::{
sys::{
signal::{sigaction, SaFlags, SigAction, SigHandler, SigSet, SIGCHLD, SIGKILL},
wait::{waitpid, WaitStatus::Exited},
signal::{SIGCHLD, SIGKILL, SaFlags, SigAction, SigHandler, SigSet, sigaction},
wait::{WaitStatus::Exited, waitpid},
},
unistd::Pid,
};

View File

@ -1,6 +1,6 @@
use std::fs::File;
use anyhow::{anyhow, Result};
use anyhow::{Result, anyhow};
use simplelog::{Config, LevelFilter, WriteLogger};
use crate::args::LogArgs;

View File

@ -11,9 +11,9 @@ extern crate simplelog;
use std::os::fd::AsRawFd;
use anyhow::{anyhow, Result};
use anyhow::{Result, anyhow};
use clap::Parser;
use nix::unistd::{fork, pipe, ForkResult};
use nix::unistd::{ForkResult, fork, pipe};
use crate::{args::Args, child::Child, exit::Exit, logger::Logger, parent::Parent};

View File

@ -7,7 +7,7 @@ use std::{
time::{Duration, SystemTime},
};
use anyhow::{anyhow, Result};
use anyhow::{Result, anyhow};
use nix::unistd::read;
use crate::{args::ParentArgs, exit::Exit};

View File

@ -286,7 +286,6 @@ async fn main() -> io::Result<()> {
let rust_excluded_directories = RegexSet::new([
r".*target.*",
r".*utils/noaslr.*",
r".*utils/gdb_qemu.*",
r".*docs/listings/baby_fuzzer/listing-.*",
r".*LibAFL/Cargo.toml.*",
r".*AFLplusplus.*",