Skip to content

Bump dependencies to latest versions #246

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

Merged
merged 3 commits into from
Feb 24, 2025
Merged
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
10 changes: 5 additions & 5 deletions casr/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@ shell-words = "1.1"
anyhow = "1.0"
clap = { version = "4.5", features = ["wrap_help", "cargo", "env"] }
chrono = "0.4"
goblin = "0.8"
goblin = "0.9"
log = "0.4"
simplelog = "0.12"
cursive = { version = "0.21", default-features = false, features = ["termion-backend"] }
cursive_tree_view = "0.9"
gdb-command = "0.7"
nix = "0.26"
nix = { version = "0.29", features = ["fs"] }
rayon = "1.10"
num_cpus = "1.16"
is_executable = "1.0"
linux-personality = "2.0"
colored = "2.0"
colored = "3.0"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
regex = "1"
Expand All @@ -36,7 +36,7 @@ reqwest = { version = "0.12", features = ["json", "multipart", "rustls-tls"], de
tokio = { version = "1", features = ["rt", "macros"], optional = true }
toml = { version = "0.8", optional = true }
wait-timeout = "0.2"
which = "6.0"
which = "7.0"
copy_dir = "0.1"

libcasr = { path = "../libcasr", version = "2.12.1", features = ["serde", "exploitable"] }
Expand All @@ -52,5 +52,5 @@ name = "casr-dojo"
required-features = ["dojo"]

[dev-dependencies]
lazy_static = "1.4"
lazy_static = "1.5"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we replace this crate with LazyLock?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We agreed to do it in a separate PR

lsb_release = "0.1"
12 changes: 7 additions & 5 deletions casr/src/bin/casr-cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -325,11 +325,13 @@
Placement::LastChild,
row,
);
tree.insert_item(
report.execution_class.description.to_string(),
Placement::LastChild,
row,
);
if !report.execution_class.description.is_empty() {
tree.insert_item(
report.execution_class.description.to_string(),
Placement::LastChild,
row,
);
}

Check warning on line 334 in casr/src/bin/casr-cli.rs

View check run for this annotation

Codecov / codecov/patch

casr/src/bin/casr-cli.rs#L328-L334

Added lines #L328 - L334 were not covered by tests
if !report.execution_class.explanation.is_empty() {
tree.insert_item(
report.execution_class.explanation.to_string(),
Expand Down
18 changes: 9 additions & 9 deletions casr/src/bin/casr-core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@
use goblin::container::Endian;
use goblin::elf::{Elf, header, note};
use log::{error, warn};
use nix::fcntl::{FlockArg, flock};
use nix::fcntl::{Flock, FlockArg};
use simplelog::*;
use std::fs::{File, OpenOptions};
use std::io::prelude::*;
use std::io::{self, Read};
use std::os::unix::io::AsRawFd;
use std::path::{Path, PathBuf};

use libcasr::error::Error;
Expand Down Expand Up @@ -259,7 +258,7 @@
"Ulimit is set to 0. Set ulimit greater than zero to analyze coredumps. Casr command line: {}",
&casr_cmd
);
drop(lockfile.unwrap());
let _ = lockfile.unwrap().unlock();

Check warning on line 261 in casr/src/bin/casr-core.rs

View check run for this annotation

Codecov / codecov/patch

casr/src/bin/casr-core.rs#L261

Added line #L261 was not covered by tests
bail!(
"Ulimit is set to 0. Set ulimit greater than zero to analyze coredumps. Casr command line: {}",
&casr_cmd
Expand Down Expand Up @@ -297,7 +296,7 @@
result.as_ref().err().unwrap(),
&casr_cmd
);
drop(lockfile.unwrap());
let _ = lockfile.unwrap().unlock();

Check warning on line 299 in casr/src/bin/casr-core.rs

View check run for this annotation

Codecov / codecov/patch

casr/src/bin/casr-core.rs#L299

Added line #L299 was not covered by tests
bail!(
"Coredump analysis error: {}. Casr command line: {}",
result.as_ref().err().unwrap(),
Expand All @@ -316,21 +315,22 @@
} else {
error!("Couldn't write report file: {}", report_path.display());
}
drop(lockfile.unwrap());
let _ = lockfile.unwrap().unlock();

Check warning on line 318 in casr/src/bin/casr-core.rs

View check run for this annotation

Codecov / codecov/patch

casr/src/bin/casr-core.rs#L318

Added line #L318 was not covered by tests
Ok(())
}

/// Method checks mutex.
fn check_lock() -> Result<File> {
fn check_lock() -> Result<Flock<File>> {

Check warning on line 323 in casr/src/bin/casr-core.rs

View check run for this annotation

Codecov / codecov/patch

casr/src/bin/casr-core.rs#L323

Added line #L323 was not covered by tests
let mut project_dir = PathBuf::from("/var/crash/");
project_dir.push("Casr.lock");
let file = OpenOptions::new()
.create(true)
.append(true)
.open(project_dir)?;
let fd = file.as_raw_fd();
flock(fd, FlockArg::LockExclusive).unwrap();
Ok(file)
match Flock::lock(file, FlockArg::LockExclusive) {
Ok(l) => Ok(l),
Err((_, errno)) => Err(errno.into()),

Check warning on line 332 in casr/src/bin/casr-core.rs

View check run for this annotation

Codecov / codecov/patch

casr/src/bin/casr-core.rs#L330-L332

Added lines #L330 - L332 were not covered by tests
}
}

/// Analyze coredump and put information to report.
Expand Down
5 changes: 4 additions & 1 deletion casr/src/bin/casr-java.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,10 @@ fn main() -> Result<()> {
let java_stderr_list: Vec<String> = java_stderr.split('\n').map(|l| l.to_string()).collect();
let re = Regex::new(r"Exception in thread .*? |== Java Exception: ").unwrap();
if let Some(start) = java_stderr_list.iter().position(|x| re.is_match(x)) {
report.java_report = java_stderr_list[start..].to_vec();
report.java_report = java_stderr_list[start..]
.iter()
.map(|line| line.replace('\t', " "))
.collect();
if let Some(end) = report
.java_report
.iter()
Expand Down
8 changes: 4 additions & 4 deletions libcasr/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ exclude = ["/fuzz"]

[dependencies]
regex = "1"
lazy_static = "1.4"
goblin = { version = "0.8", optional = true }
capstone = { version = "0.12", optional = true }
lazy_static = "1.5"
goblin = { version = "0.9", optional = true }
capstone = { version = "0.13", optional = true }
chrono = "0.4"
serde = { version = "1.0", features = ["derive"], optional = true }
serde_json = { version = "1.0", optional = true }
lexiclean = { version = "0.0", optional = true }
gdb-command = "0.7"
thiserror = "1.0"
thiserror = "2.0"
kodama = "0.3"

[features]
Expand Down
9 changes: 7 additions & 2 deletions libcasr/src/execution_class.rs
Original file line number Diff line number Diff line change
Expand Up @@ -559,15 +559,20 @@
}
impl fmt::Display for ExecutionClass {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let description = if !self.description.is_empty() {
format!("\nDescription: {}", self.description)
} else {
"".to_string()

Check warning on line 565 in libcasr/src/execution_class.rs

View check run for this annotation

Codecov / codecov/patch

libcasr/src/execution_class.rs#L565

Added line #L565 was not covered by tests
};
let explanation = if !self.explanation.is_empty() {
format!("\nExplanation: {}", self.explanation)
} else {
"".to_string()
};
write!(
f,
"Severity: {}\nShort description: {}\nDescription: {}{}",
self.severity, self.short_description, self.description, explanation
"Severity: {}\nShort description: {}{}{}",
self.severity, self.short_description, description, explanation
)
}
}
Expand Down
5 changes: 4 additions & 1 deletion libcasr/src/java.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ impl ParseStacktrace for JavaStacktrace {
return Err(Error::Casr("Empty stacktrace.".to_string()));
}

Ok(forward_stacktrace.iter().map(|x| x.to_string()).collect())
Ok(forward_stacktrace
.iter()
.map(|x| x.trim().to_string())
.collect())
}

fn parse_stacktrace_entry(entry: &str) -> Result<StacktraceEntry> {
Expand Down
Loading