Hi,
Has anyone out there had trouble with PTRACE_GETREGS on the aarch32 platform?
I'm writting a debugger for the aarch32 environment ( https://github.com/HPCguy/Squint/blob/main/cdb.c ). and I can usually capture the registers, until I get deep enough in the recursion tree using the 'step' operation in the debugger and the call stack starts unwinding. The PTRACE_GETREGS fails, then magically starts working again after some number of debugger 'step' operations.
The call to "ptrace(PTRACE_GETREGS, child, 0, &iregs);" just stops working for a while without the call returning a -1 value, and without the Linux errno value getting set to a failure condition. After some number of steps, it just "magically" starts updating the register structure again.
I have spent literally eight hours trying to prove to myself that I am the cause of the problem, and no matter what I do, I can't find a way to trace the problem back to me. The ptrace call simply stops populating the register array due to unknown mysterious conditions... sometimes.
If someone is willing to take a closer look, I would be happy to provide the steps to reproduce the error. I'm pretty sure that PTRACE_GETREGS is unreliable on ARM though. What is driving me crazy is that it 'usually' works as expected.
Thanks for reading this far, and for any suggestions.
Has anyone out there had trouble with PTRACE_GETREGS on the aarch32 platform?
I'm writting a debugger for the aarch32 environment ( https://github.com/HPCguy/Squint/blob/main/cdb.c ). and I can usually capture the registers, until I get deep enough in the recursion tree using the 'step' operation in the debugger and the call stack starts unwinding. The PTRACE_GETREGS fails, then magically starts working again after some number of debugger 'step' operations.
The call to "ptrace(PTRACE_GETREGS, child, 0, &iregs);" just stops working for a while without the call returning a -1 value, and without the Linux errno value getting set to a failure condition. After some number of steps, it just "magically" starts updating the register structure again.
I have spent literally eight hours trying to prove to myself that I am the cause of the problem, and no matter what I do, I can't find a way to trace the problem back to me. The ptrace call simply stops populating the register array due to unknown mysterious conditions... sometimes.
If someone is willing to take a closer look, I would be happy to provide the steps to reproduce the error. I'm pretty sure that PTRACE_GETREGS is unreliable on ARM though. What is driving me crazy is that it 'usually' works as expected.
Thanks for reading this far, and for any suggestions.
Statistics: Posted by HPCguy — Tue Feb 03, 2026 1:41 am