libafl_qemu: Continue build with outdated LLVM, ignore TUI race conditions (#2461)

* libafl_qemu: Continue build with outdated LLVM

* Ignore race condition

* ignore more race conditions, remove useless clones

* fix fixes
This commit is contained in:
Dominik Maier 2024-07-30 14:48:17 +02:00 committed by GitHub
parent c319fe2033
commit 8fb80c3f3a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 40 additions and 36 deletions

View File

@ -10,6 +10,7 @@ edition = "2021"
[features] [features]
default = ["std", "injections"] default = ["std", "injections"]
std = [] std = []
clippy = [] # Only for clippy, don't use.
## Build with a simple event manager instead of Launcher - don't fork, and crash after the first bug. ## Build with a simple event manager instead of Launcher - don't fork, and crash after the first bug.
simplemgr = [] simplemgr = []

View File

@ -0,0 +1,2 @@
sqltest
static

View File

@ -148,8 +148,7 @@ impl TuiUi {
.constraints([Constraint::Length(3), Constraint::Min(0)].as_ref()) .constraints([Constraint::Length(3), Constraint::Min(0)].as_ref())
.split(left_top_layout[0]); .split(left_top_layout[0]);
let mut status_bar: String = self.title.clone(); let status_bar: String = format!("{} ({})", self.title, self.version.as_str());
status_bar = status_bar + " (" + self.version.as_str() + ")";
let text = vec![Line::from(Span::styled( let text = vec![Line::from(Span::styled(
&status_bar, &status_bar,
@ -425,18 +424,22 @@ impl TuiUi {
area: Rect, area: Rect,
is_overall: bool, is_overall: bool,
) { ) {
let item_geometry: ItemGeometry = if is_overall { let tui_context = app.read().unwrap();
app.read().unwrap().total_item_geometry.clone() let empty_geometry: ItemGeometry = ItemGeometry::new();
let item_geometry: &ItemGeometry = if is_overall {
&tui_context.total_item_geometry
} else if self.clients < 2 { } else if self.clients < 2 {
ItemGeometry::new() &empty_geometry
} else { } else {
app.read() let clients = &tui_context.clients;
.unwrap() let client = clients.get(&self.clients_idx);
.clients let client = client.as_ref();
.get(&self.clients_idx) if let Some(client) = client {
.unwrap() &client.item_geometry
.item_geometry } else {
.clone() log::warn!("Client {} was `None`. Race condition?", &self.clients_idx);
&empty_geometry
}
}; };
let items = vec![ let items = vec![
@ -458,7 +461,7 @@ impl TuiUi {
]), ]),
Row::new(vec![ Row::new(vec![
Cell::from(Span::raw("stability")), Cell::from(Span::raw("stability")),
Cell::from(Span::raw(item_geometry.stability)), Cell::from(Span::raw(&item_geometry.stability)),
]), ]),
]; ];
@ -495,26 +498,25 @@ impl TuiUi {
area: Rect, area: Rect,
is_overall: bool, is_overall: bool,
) { ) {
let tup: (Duration, ProcessTiming) = if is_overall { let tui_context = app.read().unwrap();
let tui_context = app.read().unwrap(); let empty_timing: ProcessTiming = ProcessTiming::new();
( let tup: (Duration, &ProcessTiming) = if is_overall {
tui_context.start_time, (tui_context.start_time, &tui_context.total_process_timing)
tui_context.total_process_timing.clone(),
)
} else if self.clients < 2 { } else if self.clients < 2 {
(current_time(), ProcessTiming::new()) (current_time(), &empty_timing)
} else { } else {
let client = app let clients = &tui_context.clients;
.read() let client = clients.get(&self.clients_idx);
.unwrap() let client = client.as_ref();
.clients if let Some(client) = client {
.get(&self.clients_idx) (
.unwrap() client.process_timing.client_start_time,
.clone(); &client.process_timing,
( )
client.process_timing.client_start_time, } else {
client.process_timing, log::warn!("Client {} was `None`. Race condition?", &self.clients_idx);
) (current_time(), &empty_timing)
}
}; };
let items = vec![ let items = vec![
Row::new(vec![ Row::new(vec![
@ -523,7 +525,7 @@ impl TuiUi {
]), ]),
Row::new(vec![ Row::new(vec![
Cell::from(Span::raw("exec speed")), Cell::from(Span::raw("exec speed")),
Cell::from(Span::raw(tup.1.exec_speed)), Cell::from(Span::raw(&tup.1.exec_speed)),
]), ]),
Row::new(vec![ Row::new(vec![
Cell::from(Span::raw("last new entry")), Cell::from(Span::raw("last new entry")),

View File

@ -108,11 +108,10 @@ fn find_llvm_config() -> Result<String, String> {
if which("llvm-config").is_ok() { if which("llvm-config").is_ok() {
if let Some(ver) = find_llvm_version("llvm-config".to_owned()) { if let Some(ver) = find_llvm_version("llvm-config".to_owned()) {
if ver >= rustc_llvm_ver { if ver < rustc_llvm_ver {
return Ok("llvm-config".to_owned()); println!("cargo:warning=Version of llvm-config is {ver} but needs to be at least rustc's version ({rustc_llvm_ver})! We will (try to) continue to build. Continue at your own risk, or rebuild with a set LLVM_CONFIG_PATH env variable, pointing to a newer version.");
} }
return Ok("llvm-config".to_owned());
return Err(format!("Version of llvm-config is {ver} but needs to be at least rustc's version({rustc_llvm_ver})"));
} }
} }