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

Qemu signal refactoring #2920

Merged
merged 18 commits into from
Feb 4, 2025
Merged

Qemu signal refactoring #2920

merged 18 commits into from
Feb 4, 2025

Conversation

rmalmain
Copy link
Member

No description provided.

@tokatoka
Copy link
Member

Can we change

impl Default for AsanModuleBuilder {
    fn default() -> Self {
        Self::new(
            None,
            false,
            true,
            StdAddressFilter::default(),
            None,
            AsanTargetCrash::OnFirstError,
        )
    }
}

to this?

impl Default for AsanModuleBuilder {
    fn default() -> Self {
    let env = std::env::vars()
        .filter(|(k, _v)| k != "LD_LIBRARY_PATH")
        .collect::<Vec<(String, String)>>();
        Self::new(
            None,
            false,
            true,
            StdAddressFilter::default(),
            None,
            AsanTargetCrash::OnFirstError,
        )
    }
}

else you unwrap this env later so it's easy to misuse

@rmalmain
Copy link
Member Author

yes

log::debug!("Running crash hooks.");
run_target_crash_hooks::<ET, I, S>(signal.into());

assert!(data.maybe_report_crash::<E, EM, I, OF, S, Z>(None));
Copy link
Member

@tokatoka tokatoka Jan 31, 2025

Choose a reason for hiding this comment

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

maybe_report_crash calls run_observers_and_save_state.
and run_observers_and_save_state calls event_mgr.on_restart(state).unwrap();

it is mandatory to call on_restart to do restart but here you are only calling this in one of these branches. so you need to call in others too

log::debug!("Signal has been triggered while QEMU was running");

match qemu.signal_ctx() {
QemuSignalContext::OutOfQemuSignalHandler => {
Copy link
Member

Choose a reason for hiding this comment

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

I almost forgot what we discussed yesterday...
can you explain more on "In what case, you will end up in this branch?"

for example. if we receive a signal during harness execution, we go to which branch?

Copy link
Member

Choose a reason for hiding this comment

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

i guess this is the 1st signal?

Copy link
Member

Choose a reason for hiding this comment

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

and later InQemuSignalHandlerTarget is the 2nd signal after qemu delegated signal handling to us right?

@tokatoka
Copy link
Member

Also can you talk about the asanmodules' api change in MIGRATION.md too?

@tokatoka
Copy link
Member

tokatoka commented Feb 1, 2025

i changed asan builder

@tokatoka
Copy link
Member

tokatoka commented Feb 1, 2025

seems not yet working

Fuzzer is working
rm -f sqltest static fuzz
+ ./tests/qasan/test.sh
gcc qasan.c -o qasan
Running overflow detection test...

and this job is stuck for the 217 minutes

@tokatoka tokatoka merged commit 8398f8f into main Feb 4, 2025
107 checks passed
@tokatoka tokatoka deleted the qemu_signal_refactor branch February 4, 2025 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants