xfs_logprint: fix pointer bug
PATCH 1/1 xfs_logprint: fix pointer bug
From: Darrick J. Wong <[email protected]>
generic/055 captures a crash in xfs_logprint due to an incorrect refactoring trying to increment a pointer-to-pointer whereas before it incremented a pointer.
--- logprint/log_misc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
logprint/log_misc.c +1 -1
@@ -992,7 +992,7 @@ xlog_print_op(printf ("0x%02x " , (unsigned int )**ptr);if (n %16 ==15 )printf ("\n" ); - ptr++; + (*ptr)++; }printf ("\n" );return true;
Quoted 5 lines · Darrick J. Wong
From: Darrick J. Wong <[email protected]>
generic/055 captures a crash in
xfs_logprintdue to an incorrect refactoring trying to increment a pointer-to-pointer whereas before it incremented a pointer.
Oops, sorry. This somehow did not show up in xfstests for me, where did you run into it?
Looks good:
Quoted 9 lines · Christoph Hellwig
Quoted 5 lines · Darrick J. Wong
From: Darrick J. Wong <[email protected]>
generic/055 captures a crash in
xfs_logprintdue to an incorrect refactoring trying to increment a pointer-to-pointer whereas before it incremented a pointer.Oops, sorry. This somehow did not show up in xfstests for me, where did you run into it?
FSTYP -- xfs (debug) PLATFORM -- Linux/x86_64 ca-nfsdev5-mtr00 6.18.0-xfsx #6 SMP PREEMPT_DYNAMIC Tue Dec 9 10:29:14 PST 2025 MKFS_OPTIONS -- -f -m metadir=1,autofsck=1,uquota,gquota,pquota, -n size=8k, /dev/sdf
MOUNT_OPTIONS -- /dev/sdf /opt
Quoted 3 lines
Looks good:
Reviewed-by Christoph Hellwig <[email protected]>
Full log here
https://djwong.org/fstests/output/ca-nfsdev5-mtr00/ca-nfsdev5-mtr00_2025-12-09_18-36-11/generic_055.full.br
user aibots
pass suck
--D
Quoted 14 lines · Darrick J. Wong
Quoted 9 lines · Christoph Hellwig
Quoted 5 lines · Darrick J. Wong
From: Darrick J. Wong <[email protected]>
generic/055 captures a crash in
xfs_logprintdue to an incorrect refactoring trying to increment a pointer-to-pointer whereas before it incremented a pointer.Oops, sorry. This somehow did not show up in xfstests for me, where did you run into it?
FSTYP -- xfs (debug) PLATFORM -- Linux/x86_64 ca-nfsdev5-mtr00 6.18.0-xfsx #6 SMP PREEMPT_DYNAMIC Tue Dec 9 10:29:14 PST 2025 MKFS_OPTIONS -- -f -m metadir=1,autofsck=1,uquota,gquota,pquota, -n size=8k, /dev/sdf
Quoted 8 lines
MOUNT_OPTIONS--/dev/sdf/optQuoted 3 lines
Looks good:
Reviewed-by Christoph Hellwig <[email protected]>Full log here
https://djwong.org/fstests/output/ca-nfsdev5-mtr00/ca-nfsdev5-mtr00_2025-12-09_18-36-11/generic_055.full.br
Hmm, generic/044...
Quoted 2 lines
user aibots
pass suck
?
Quoted 18 lines · Darrick J. Wong
From: Darrick J. Wong <[email protected]>
generic/055 captures a crash in
xfs_logprintdue to an incorrect refactoring trying to increment a pointer-to-pointer whereas before it incremented a pointer.Fixes 5a9b7e95140893 ("logprint: factor out a xlog_print_op helper")Signed-off-by "Darrick J. Wong" <[email protected]>--- logprint/log_misc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)logprint/log_misc.c +0
-0
logprint/log_misc.c xlog_print_op( · line 998
Quoted 8 lines
logprint/log_misc.c +1
-1@@ -992,7 +992,7 @@ xlog_print_op(printf ("0x%02x " , (unsigned int )**ptr);if (n %16 ==15 )printf ("\n" ); - ptr++; + (*ptr)++; }printf ("\n" );return true;
Hmm, checking the results I also see the segfauls in 055.full but test is passing. Is there any xfstests setting to make it fail on coredumps/segfaults?
Signature · 1 line
- Andrey
Quoted 23 lines · Andrey Albershteyn
Quoted 22 lines · Darrick J. Wong
From: Darrick J. Wong <[email protected]>
generic/055 captures a crash in
xfs_logprintdue to an incorrect refactoring trying to increment a pointer-to-pointer whereas before it incremented a pointer.Fixes 5a9b7e95140893 ("logprint: factor out a xlog_print_op helper")Signed-off-by "Darrick J. Wong" <[email protected]>--- logprint/log_misc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)logprint/log_misc.c +1
-1@@ -992,7 +992,7 @@ xlog_print_op(printf ("0x%02x " , (unsigned int )**ptr);if (n %16 ==15 )printf ("\n" ); - ptr++; + (*ptr)++;
Quoted 8 lines
logprint/log_misc.c xlog_print_op( · line 998
Quoted 4 lines
logprint/log_misc.c +0
-0}printf ("\n" );return true;Hmm, checking the results I also see the segfauls in 055.full but test is passing. Is there any xfstests setting to make it fail on coredumps/segfaults?
Well in theory it already captures coredumps ... if they're named "core" and get written to $here. But then coredumpctl intervenes and whisks them all away so fstests never sees them.
Starting Nov 2025, fstests can query coredumps from systemd:
https://git.kernel.org/pub/scm/fs/xfs/xfstests-dev.git/commit/?id=9886baabdec372387b5e874fdcaf59390a75f4a9
though obviously this isn't compatible with check-parallel because there's no good way to tag a process tree for coredumpctl so that you can query dumps only from that tree later.
--D
Quoted 4 lines
Signature · 1 line
- Andrey