]> git.ipfire.org Git - thirdparty/haproxy.git/commit
DEBUG: pools: report the data around the offending area in case of mismatch
authorWilly Tarreau <w@1wt.eu>
Fri, 12 Apr 2024 15:54:51 +0000 (17:54 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 12 Apr 2024 16:01:55 +0000 (18:01 +0200)
commitc0ee2d78d739c27891d4e230ef6ebc691806a03a
tree1c1a96fcd637df5b0cd8521ae3b146d5e83c46a7
parent16e3655fbd0955748892fa2fc75acf82ce9a9665
DEBUG: pools: report the data around the offending area in case of mismatch

When the integrity check fails, it's useful to get a dump of the area
around the first faulty byte. That's what this patch does. For example
it now shows this before reporting info about the tag itself:

  Contents around first corrupted address relative to pool item:.
  Contents around address 0xe4febc0792c0+40=0xe4febc0792e8:
    0xe4febc0792c8 [80 75 56 d8 fe e4 00 00] [.uV.....]
    0xe4febc0792d0 [a0 f7 23 a4 fe e4 00 00] [..#.....]
    0xe4febc0792d8 [90 75 56 d8 fe e4 00 00] [.uV.....]
    0xe4febc0792e0 [d9 93 fb ff fd ff ff ff] [........]
    0xe4febc0792e8 [d9 93 fb ff ff ff ff ff] [........]
    0xe4febc0792f0 [d9 93 fb ff ff ff ff ff] [........]
    0xe4febc0792f8 [d9 93 fb ff ff ff ff ff] [........]
    0xe4febc079300 [d9 93 fb ff ff ff ff ff] [........]

This may be backported to 2.9 and maybe even 2.8 as it does help spot
the cause of the memory corruption.
include/haproxy/pool.h
src/pool.c