Re:Debugging memory corruption: who the hell writes "2" into...
by alexvitkov on Tuesday December 31, 2024 @08:23AM
(#42558545)
He mentioned in the article that the corruption happens at a seemingly random spot the middle of a large buffer, and you can only have a HW breakpoint on 4 addresses in x86-64.
[ Parent
| on HN ]
Re:Debugging memory corruption: who the hell writes "2" into...
by quotemstr on Tuesday December 31, 2024 @09:23AM
(#42558851)
Reproduce the corruption under rr. Replay the rr trace. Replay is totally deterministic, so you can just seek to the end of the trace, set a hardware breakpoint on the damaged stack location, and reverse-continue until you find the culprit.
Re:Debugging memory corruption: who the hell writes "2" into...
by pm215 on Tuesday December 31, 2024 @10:29AM
(#42559244)
I would certainly try with a reverse debugger if I had one, but where the repro instructions are "run this big complex interactive program for 10 minutes" I wouldn't be super confident about successfully recording a repro. At least in my experience with rr the slowdown is enough to make that painful, especially if you need to do multiple "chaos mode" runs to get a timing sensitive bug to trigger. It might still be worth spending time trying to get a faster repro case to make reverse debug a bit more tractable.
Re:Debugging memory corruption: who the hell writes "2" into...
by IshKebab on Tuesday December 31, 2024 @10:11AM
(#42559129)
Sure let me just run `rr` on Windows...
Re:Debugging memory corruption: who the hell writes "2" into...
by zorgmonkey on Tuesday December 31, 2024 @10:29AM
(#42559251)
rr is only works on Linux and the release of Windows TTD was after this blog post was published. Also the huge slowdown from time travel debuggers can sometimes make tricky bugs like this much harder to reproduce.