Skip to contentSkip to conversation

generic/574: don't fail the test on intentional coredump

PATCH In review Darrick J. Wong 3 participants 3 messages Mar 12, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 generic/574: don't fail the test on intentional coredump

From: Darrick J. Wong <[email protected]>

Don't fail this test just because the mmap read of a corrupt verity file causes xfs_io to segfault and then dump core.

---
 tests/generic/574 |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tests/generic/574 +2 -1
index 067b3033a8..cb42baaa67 100755
@@ -74,7 +74,8 @@ mread()
 	# shell instance from optimizing out the fork and directly exec'ing
 	# xfs_io.  The easiest way to do that is to append 'true' to the
 	# commands, so that xfs_io is no longer the last command the shell sees.
-	bash -c "trap '' SIGBUS; $XFS_IO_PROG -r $file \
+	# Don't let it write core files to the filesystem.
+	bash -c "trap '' SIGBUS; ulimit -c 0; $XFS_IO_PROG -r $file \
 		-c 'mmap -r 0 $map_len' \
 		-c 'mread -v $offset $length'; true"
 }
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Darrick J. Wong

From: Darrick J. Wong <[email protected]>

Don't fail this test just because the mmap read of a corrupt verity file causes xfs_io to segfault and then dump core.

Looks fine.

Quoted 19 lines
---
 tests/generic/574 |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tests/generic/574 +2 -1
index 067b3033a8..cb42baaa67 100755
@@ -74,7 +74,8 @@ mread()
 	# shell instance from optimizing out the fork and directly exec'ing
 	# xfs_io.  The easiest way to do that is to append 'true' to the
 	# commands, so that xfs_io is no longer the last command the shell sees.
-	bash -c "trap '' SIGBUS; $XFS_IO_PROG -r $file \
+	# Don't let it write core files to the filesystem.
+	bash -c "trap '' SIGBUS; ulimit -c 0; $XFS_IO_PROG -r $file \
 		-c 'mmap -r 0 $map_len' \
 		-c 'mread -v $offset $length'; true"
 }
Reviewed-by on v1 1/1
#2 lore raw
In reply to Darrick J. Wong
Quoted 15 lines · Darrick J. Wong

From: Darrick J. Wong <[email protected]>

Don't fail this test just because the mmap read of a corrupt verity file causes xfs_io to segfault and then dump core.

---
 tests/generic/574 |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tests/generic/574 +0 -0
index 067b3033a8..cb42baaa67 100755

tests/generic/574 mread() · line 81

Quoted 9 lines
tests/generic/574 +2 -1
@@ -74,7 +74,8 @@ mread()
 	# shell instance from optimizing out the fork and directly exec'ing
 	# xfs_io.  The easiest way to do that is to append 'true' to the
 	# commands, so that xfs_io is no longer the last command the shell sees.
-	bash -c "trap '' SIGBUS; $XFS_IO_PROG -r $file \
+	# Don't let it write core files to the filesystem.
+	bash -c "trap '' SIGBUS; ulimit -c 0; $XFS_IO_PROG -r $file \
 		-c 'mmap -r 0 $map_len' \
 		-c 'mread -v $offset $length'; true"
 }

- Eric