From: Darren Kenny <darren.kenny@oracle.com>
To: Alexander Bulekov <alxndr@bu.edu>, qemu-devel@nongnu.org
Cc: Laurent Vivier <lvivier@redhat.com>,
Thomas Huth <thuth@redhat.com>, Alexander Bulekov <alxndr@bu.edu>,
Bandan Das <bsd@redhat.com>,
Stefan Hajnoczi <stefanha@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>,
dimastep@yandex-team.ru
Subject: Re: [PATCH] fuzz: Disable QEMU's signal handlers
Date: Tue, 13 Oct 2020 17:50:37 +0100 [thread overview]
Message-ID: <m2r1q2m5nm.fsf@oracle.com> (raw)
In-Reply-To: <20201013152920.448335-1-alxndr@bu.edu>
Hi Alex,
This mentions the use of atexit() to perform some cleanup, but I'm not
seeing that being added here, should it be?
Thanks,
Darren.
On Tuesday, 2020-10-13 at 11:29:20 -04, Alexander Bulekov wrote:
> With the fuzzer, we never call main_loop_should_exit, since we manually
> call main_loop_wait. This means that the only way to terminate the
> fuzzer is with SIGKILL. Disable the signal handlers, so there are
> reasonable ways to terminate the fuzzer and use atexit() to clean-up
> after the fuzzer.
>
> Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
> ---
> tests/qtest/fuzz/fuzz.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/tests/qtest/fuzz/fuzz.c b/tests/qtest/fuzz/fuzz.c
> index d926c490c5..eb0070437f 100644
> --- a/tests/qtest/fuzz/fuzz.c
> +++ b/tests/qtest/fuzz/fuzz.c
> @@ -217,5 +217,13 @@ int LLVMFuzzerInitialize(int *argc, char ***argv, char ***envp)
> /* re-enable the rcu atfork, which was previously disabled in qemu_init */
> rcu_enable_atfork();
>
> + /*
> + * Disable QEMU's signal handlers, since we manually control the main_loop,
> + * and don't check for main_loop_should_exit
> + */
> + signal(SIGINT, SIG_DFL);
> + signal(SIGHUP, SIG_DFL);
> + signal(SIGTERM, SIG_DFL);
> +
> return 0;
> }
> --
> 2.28.0
next prev parent reply other threads:[~2020-10-13 16:51 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-13 15:29 [PATCH] fuzz: Disable QEMU's signal handlers Alexander Bulekov
2020-10-13 16:50 ` Darren Kenny [this message]
2020-10-13 16:52 ` Daniel P. Berrangé
2020-10-14 9:09 ` Darren Kenny
2020-10-14 13:40 ` Alexander Bulekov
2020-10-13 17:02 ` Alexander Bulekov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m2r1q2m5nm.fsf@oracle.com \
--to=darren.kenny@oracle.com \
--cc=alxndr@bu.edu \
--cc=bsd@redhat.com \
--cc=dimastep@yandex-team.ru \
--cc=lvivier@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).