[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH v2 2/7] iotests: exclude killed processes from r
From: |
Roman Kagan |
Subject: |
Re: [Qemu-block] [PATCH v2 2/7] iotests: exclude killed processes from running under Valgrind |
Date: |
Mon, 17 Jun 2019 12:18:58 +0000 |
User-agent: |
Mutt/1.11.4 (2019-03-13) |
On Mon, Jun 17, 2019 at 01:15:04PM +0200, Kevin Wolf wrote:
> Am 11.06.2019 um 20:02 hat Andrey Shinkevich geschrieben:
> > The Valgrind tool fails to manage its termination when QEMU raises the
> > signal SIGKILL. Lets exclude such test cases from running under the
> > Valgrind because there is no sense to check memory issues that way.
> >
> > Signed-off-by: Andrey Shinkevich <address@hidden>
>
> I don't fully understand the reasoning here. Most interesting memory
> access errors happen before a process terminates. (I'm not talking about
> leaks here, but use-after-free, buffer overflows, uninitialised memory
> etc.)
Nothing of the above, and nothing in general, happens in the usermode
process upon SIGKILL delivery.
> However, I do see that running these test cases with -valgrind ends in a
> hang because the valgrind process keeps hanging around as a zombie
> process and the test case doesn't reap it. I'm not exactly sure why that
> is, but it looks more like a problem with the parent process (i.e. the
> bash script).
It rather looks like valgrind getting confused about what to do with
raise(SIGKILL) in the multithreaded case.
> If we can't figure out how to fix this, we can disable valgrind in these
> cases, but I think the explanation needs to be different.
>
> > diff --git a/tests/qemu-iotests/039 b/tests/qemu-iotests/039
> > index 0d4e963..95115e2 100755
> > --- a/tests/qemu-iotests/039
> > +++ b/tests/qemu-iotests/039
> > @@ -65,6 +65,7 @@ echo "== Creating a dirty image file =="
> > IMGOPTS="compat=1.1,lazy_refcounts=on"
> > _make_test_img $size
> >
> > +VALGRIND_QEMU="" \
> > $QEMU_IO -c "write -P 0x5a 0 512" \
> > -c "sigraise $(kill -l KILL)" "$TEST_IMG" 2>&1 \
> > | _filter_qemu_io
>
> I agree with Vladimir that setting VALGRIND_QEMU only once at the top of
> the script is probably the better option.
It is not, because there's no reason for qemu-io invocations that don't
perform raise(SIGKILL) to escape valgrinding.
Roman.
[Qemu-block] [PATCH v2 5/7] iotests: extend sleeping time under Valgrind, Andrey Shinkevich, 2019/06/11
[Qemu-block] [PATCH v2 7/7] iotests: new file to suppress Valgrind errors, Andrey Shinkevich, 2019/06/11