Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependencies to suppress cargo audit and deprecated code warnings #232

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/amd64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ jobs:
run: cargo build --all-features --verbose
- name: Run tests
run: |
sudo apt update && sudo apt install -y gdb pip curl python3.10-dev llvm \
sudo apt update && sudo apt install -y gdb pip curl python3-dev llvm \
openjdk-17-jdk ca-certificates gnupg
pip3 install atheris
# Atheris fails to install on Ubuntu 24.04, see https://github.com/google/atheris/issues/82
# pip3 install atheris
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
export NODE_MAJOR=20
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ env:
jobs:
ubuntu-latest:

runs-on: ubuntu-latest
# Atheris fails to install on Ubuntu 24.04, see https://github.com/google/atheris/issues/82
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4
Expand Down
7 changes: 4 additions & 3 deletions casr/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ chrono = "0.4"
goblin = "0.8"
log = "0.4"
simplelog = "0.12"
cursive = { version = "0.20", default-features = false, features = ["termion-backend"] }
cursive_tree_view = "0.8"
cursive = { version = "0.21", default-features = false, features = ["termion-backend"] }
cursive_tree_view = "0.9"
gdb-command = "0.7"
nix = "0.26"
rayon = "1.10"
num_cpus = "1.16"
is_executable = "1.0"
linux-personality = "1.0"
linux-personality = "2.0"
colored = "2.0"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
Expand Down Expand Up @@ -53,3 +53,4 @@ required-features = ["dojo"]

[dev-dependencies]
lazy_static = "1.4"
lsb_release = "0.1"
7 changes: 5 additions & 2 deletions casr/src/bin/casr-cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ fn build_tree_report(
}

for line in report.disassembly.iter() {
tree.insert_item(line.clone(), Placement::LastChild, row);
tree.insert_item(line.replace('\t', " "), Placement::LastChild, row);
}
}

Expand Down Expand Up @@ -627,7 +627,10 @@ fn build_slider_report(
});

if !report.disassembly.is_empty() {
state.push_str(&format!("\n{}", &report.disassembly.join("\n")));
state.push_str(&format!(
"\n{}",
&report.disassembly.join("\n").replace('\t', " ")
));
}
if !state.is_empty() {
select.add_item("CrashState", state);
Expand Down
4 changes: 2 additions & 2 deletions casr/src/bin/casr-san.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,11 @@ fn main() -> Result<()> {
}
#[cfg(target_os = "linux")]
{
use linux_personality::{personality, ADDR_NO_RANDOMIZE};
use linux_personality::{personality, Personality};

unsafe {
sanitizers_cmd.pre_exec(|| {
if personality(ADDR_NO_RANDOMIZE).is_err() {
if personality(Personality::ADDR_NO_RANDOMIZE).is_err() {
panic!("Cannot set personality");
}
Ok(())
Expand Down
16 changes: 16 additions & 0 deletions casr/tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4159,6 +4159,10 @@ fn test_casr_libfuzzer() {
#[test]
#[cfg(target_arch = "x86_64")]
fn test_casr_libfuzzer_atheris() {
if lsb_release::info().unwrap().version == "24.04" {
// Atheris fails to install, see https://github.com/google/atheris/issues/82
return;
}
use std::collections::HashMap;

let paths = [
Expand Down Expand Up @@ -4439,6 +4443,10 @@ fn test_casr_java_native_lib() {
#[test]
#[cfg(target_arch = "x86_64")]
fn test_casr_python_atheris() {
if lsb_release::info().unwrap().version == "24.04" {
// Atheris fails to install, see https://github.com/google/atheris/issues/82
return;
}
// Division by zero atheris test
let paths = [
abs_path("tests/casr_tests/python/test_casr_python_atheris.py"),
Expand Down Expand Up @@ -4577,6 +4585,10 @@ fn test_casr_san_python_df() {
#[test]
#[cfg(target_arch = "x86_64")]
fn test_casr_san_atheris_df() {
if lsb_release::info().unwrap().version == "24.04" {
// Atheris fails to install, see https://github.com/google/atheris/issues/82
return;
}
// Double free python C extension test
// Copy files to tmp dir
let work_dir = abs_path("tests/casr_tests/python");
Expand Down Expand Up @@ -4678,6 +4690,10 @@ fn test_casr_san_atheris_df() {
#[test]
#[cfg(target_arch = "x86_64")]
fn test_casr_python_call_san_df() {
if lsb_release::info().unwrap().version == "24.04" {
// Atheris fails to install, see https://github.com/google/atheris/issues/82
return;
}
// Double free python C extension test
// Copy files to tmp dir
let work_dir = abs_path("tests/casr_tests/python");
Expand Down
2 changes: 1 addition & 1 deletion libcasr/src/python.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ impl ParseStacktrace for PythonStacktrace {
fn parse_stacktrace(entries: &[String]) -> Result<Stacktrace> {
let mut stacktrace = Stacktrace::new();

let re = Regex::new(r"\[Previous line repeated (\d+) more times\]").unwrap();
for entry in entries.iter() {
if entry.starts_with('[') {
let re = Regex::new(r"\[Previous line repeated (\d+) more times\]").unwrap();
let Some(rep) = re.captures(entry) else {
return Err(Error::Casr(format!(
"Couldn't parse stacktrace line: {entry}"
Expand Down
Loading