RTEMS | Libdebugger register block corruption (#5634)
Chris Johns (@chris)
gitlab at rtems.org
Sun Jul 5 11:11:24 UTC 2026
Issue created by Chris Johns: https://gitlab.rtems.org/rtems/rtos/rtems/-/work_items/5634
Assignee: Chris Johns
## Summary
If more than 32 threads are active the `thread->register` pointer may end up referencing an old block pointer depending on the value returned by a `realloc` call. This has not been a problem on ARM or AARCH64 builds but is a problem on PowerPC although it is a definite issue on all architectures.
I suspect a key difference is PowerPC has a 412 byte register buffer per thread, significantly more than ARM and AARCH64, so a block resize using `realloc` is more likely to results in the pointer returned having a different address. The corruption is each thread has taken a pointer to the registers from the original block for each thread and it is not re-based after the `realloc` moves the pointer.
## Solution
Add a rebase handler to the block code that is called if the base pointer of a block moves so the pointer can be remapped.
_Note_, only the `registers` is effected as all other blocks do not have references taken.
## Steps to reproduce
Run a simple EPICS IOC application on PowerPC, connect then list the threads and then print thread's registers. The values are garbage.
--
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/work_items/5634
You're receiving this email because of your account on gitlab.rtems.org. Unsubscribe from this thread: https://gitlab.rtems.org/-/sent_notifications/4-1e8x0rlhrtvcz8s69mnz513im-1d/unsubscribe | Manage all notifications: https://gitlab.rtems.org/-/profile/notifications | Help: https://gitlab.rtems.org/help
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20260705/a70ddab3/attachment.htm>
More information about the bugs
mailing list