From: Eric Biggers <ebiggers@kernel.org>
To: Zorro Lang <zlang@redhat.com>
Cc: fstests@vger.kernel.org, linux-fscrypt@vger.kernel.org
Subject: Re: [PATCH v2 08/10] generic/574: test multiple Merkle tree block sizes
Date: Sun, 25 Dec 2022 21:21:34 -0800 [thread overview]
Message-ID: <Y6kvXs33MmxVovNO@sol.localdomain> (raw)
In-Reply-To: <20221225124600.faouh6a7suhq2wuu@zlang-mailbox>
On Sun, Dec 25, 2022 at 08:46:00PM +0800, Zorro Lang wrote:
> > + # Reading the full file via mmap should fail.
> > bash -c "trap '' SIGBUS; $XFS_IO_PROG -r $fsv_file \
> > -c 'mmap -r 0 $page_aligned_eof' \
> > - -c 'mread 0 $file_len'" |& filter_sigbus
> > + -c 'mread 0 $file_len'" >/dev/null 2>$tmp.out
> > + if ! grep -q 'Bus error' $tmp.out; then
> > + echo "Didn't see SIGBUS when reading file via mmap"
>
> Hmm... will sigbus error really be output to stderr? From a testing, the
> generic/574 fails as:
>
> # ./check -s simpledev generic/574
> SECTION -- simpledev
> FSTYP -- ext4
> PLATFORM -- Linux/x86_64 xx-xxxxxx-xxx 6.1.0-rc3 #5 SMP PREEMPT_DYNAMIC Tue Nov 1 01:08:52 CST 2022
> MKFS_OPTIONS -- -F /dev/sdb
> MOUNT_OPTIONS -- -o acl,user_xattr -o context=system_u:object_r:root_t:s0 /dev/sdb /mnt/scratch
>
> generic/574 - output mismatch (see /root/git/xfstests/results//simpledev/generic/574.out.bad)
> --- tests/generic/574.out 2022-12-25 20:02:41.609104749 +0800
> +++ /root/git/xfstests/results//simpledev/generic/574.out.bad 2022-12-25 20:21:57.430719504 +0800
> @@ -1,6 +1,32 @@
> QA output created by 574
>
> # Testing block_size=FSV_BLOCK_SIZE
> +/root/git/xfstests/tests/generic/574: line 69: 1949533 Bus error (core dumped) bash -c "trap '' SIGBUS; $XFS_IO_PROG -r $fsv_file -c 'mmap -r 0 $page_aligned_eof' -c 'mread 0 $file_len'" > /dev/null 2> $tmp.out
> +Didn't see SIGBUS when reading file via mmap
This test passes for me both before and after this patch series.
Both before and after, the way this is supposed to work is that in:
bash -c "trap '' SIGBUS; command_that_exits_with_sigbus"
... bash should print "Bus error" to stderr due to
'command_that_exits_with_sigbus'. That "Bus error" is then redirected. Before
it was redirected to a pipeline; after it is redirected to a file.
I think what's happening is that the version of bash your system has is not
forking before exec'ing 'command_that_exits_with_sigbus'. As a result, "Bus
error" is printed by the *parent* bash process instead, skipping any redirection
in the shell script.
Apparently skipping fork is a real thing in bash, and different versions of bash
have had subtly different conditions for enabling it. So this seems plausible.
Adding an extra command after 'command_that_exits_with_sigbus' should fix this:
bash -c "trap '' SIGBUS; command_that_exits_with_sigbus; true"
The joy of working with a shell scripting system where everyone has different
versions of everything installed...
- Eric
next prev parent reply other threads:[~2022-12-26 5:21 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-23 1:05 [PATCH v2 00/10] xfstests: update verity tests for non-4K block and page size Eric Biggers
2022-12-23 1:05 ` [PATCH v2 01/10] common/verity: add and use _fsv_can_enable() Eric Biggers
2022-12-23 1:05 ` [PATCH v2 02/10] common/verity: set FSV_BLOCK_SIZE to an appropriate value Eric Biggers
2022-12-23 1:05 ` [PATCH v2 03/10] common/verity: use FSV_BLOCK_SIZE by default Eric Biggers
2022-12-23 1:05 ` [PATCH v2 04/10] common/verity: add _filter_fsverity_digest() Eric Biggers
2022-12-23 1:05 ` [PATCH v2 05/10] generic/572: support non-4K Merkle tree block size Eric Biggers
2022-12-23 1:05 ` [PATCH v2 06/10] generic/573: " Eric Biggers
2022-12-23 1:05 ` [PATCH v2 07/10] generic/577: " Eric Biggers
2022-12-23 1:05 ` [PATCH v2 08/10] generic/574: test multiple Merkle tree block sizes Eric Biggers
2022-12-25 12:46 ` Zorro Lang
2022-12-26 5:21 ` Eric Biggers [this message]
2022-12-28 12:50 ` Theodore Ts'o
2022-12-29 16:32 ` Zorro Lang
2022-12-29 23:47 ` Eric Biggers
2022-12-23 1:05 ` [PATCH v2 09/10] generic/624: " Eric Biggers
2022-12-23 1:05 ` [PATCH v2 10/10] generic/575: test 1K Merkle tree block size Eric Biggers
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=Y6kvXs33MmxVovNO@sol.localdomain \
--to=ebiggers@kernel.org \
--cc=fstests@vger.kernel.org \
--cc=linux-fscrypt@vger.kernel.org \
--cc=zlang@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