On 200618 0934, Thomas Huth wrote: > On 29/01/2020 06.34, Bulekov, Alexander wrote: > > The qtest-based fuzzer makes use of forking to reset-state between > > tests. Keep the callback enabled, so the call_rcu thread gets created > > within the child process. > > > > Signed-off-by: Alexander Bulekov <[email protected]> > > --- > > vl.c | 9 ++++++++- > > 1 file changed, 8 insertions(+), 1 deletion(-) > > > > diff --git a/vl.c b/vl.c > > index bb77935f04..cf8e2d3ebb 100644 > > --- a/vl.c > > +++ b/vl.c > > @@ -3794,7 +3794,14 @@ void qemu_init(int argc, char **argv, char **envp) > > set_memory_options(&ram_slots, &maxram_size, machine_class); > > > > os_daemonize(); > > - rcu_disable_atfork(); > > + > > + /* > > + * If QTest is enabled, keep the rcu_atfork enabled, since system > > processes > > + * may be forked testing purposes (e.g. fork-server based fuzzing) > > + */ > > + if (!qtest_enabled()) { > > + rcu_disable_atfork(); > > + } > > > > if (pid_file && !qemu_write_pidfile(pid_file, &err)) { > > error_reportf_err(err, "cannot create PID file: "); > > Hi Alexander, > > I think this patch might maybe not work as expected: The qtest_enabled() > has been added before configure_accelerators() is called in main(). So > qtest_enabled() should always return "false" and thus > rcu_disabled_fork() is still called in any case... could you please > double-check whether it works for you and I just made a mistake, or > whether this is a bug indeed? Hi, This is a problem.. I think we can work around this by calling rcu_enable_atfork from the fuzzer, after qemu_init. I'll send a patch soon. Thanks -Alex
> Thanks, > Thomas >
