News for hackers. Stuff that matters.
Re:rr: lightweight recording and deterministic debugging by mijoharas on Tuesday November 06, 2018 @05:14AM (#18389728)
For anyone that isn't aware, this is a brilliant tool. I just wish it supported ARM hardware (as far as I remember there are some interrupts that clobber state, so this can't be used. Please fill in the details if anyone remembers).
Re:rr: lightweight recording and deterministic debugging by pm215 on Tuesday November 06, 2018 @06:42AM (#18390093)
The upstream issue with discussion about Arm support is https://github.com/mozilla/rr/issues/1373 -- the underlying problem is that rr's design assumes that if you execute N instructions you'll always deterministically end up in the same place. In architectures which implement atomics via a load-linked/store-conditional loop (including Alpha, Arm, MIPS, PPC,...) this isn't true, because differences at the OS level (eg timing of other interrupts or process scheduling) could cause an ll/sc loop to loop round more often. It's not clear how this could be addressed, because it's pretty deeply baked into rr's design.
Re:rr: lightweight recording and deterministic debugging by roca on Tuesday November 06, 2018 @09:07AM (#18391041)
CPU support for trapping on a failed LL/SC would suffice.
Re:rr: lightweight recording and deterministic debugging by pm215 on Tuesday November 06, 2018 @09:19AM (#18391159)
Do you have a sketch of how that would work? It seems plausible but I haven't thought through the details. Issue 1373 suggests a perf counter of failed-SC events and looking at "branches taken - failed_SC", which I'm definitely sceptical would be reliable.
Re:rr: lightweight recording and deterministic debugging by roca on Tuesday November 06, 2018 @09:27AM (#18391225)
Re:rr: lightweight recording and deterministic debugging by worldgeek on Tuesday November 06, 2018 @06:56AM (#18390158)
TLDR; If you want RR on ARM try UndoDB (which has a different instrumentation method). RR needs an accurate count of "retired instructions" to replay correctly. ARM has non-deterministic behaviour for this count because an instruction may fail for example due to a cache miss or a hardware interrupt,the instruction would be re-tried of course but the retired instruction count for a code path run multiple times can vary even if identical branches are taken. Longer / better description at this URL. https://github.com/mozilla/rr/issues/1373