Quote:
Piru wrote:
MorphOS 3.16 introduced a built-in "memtrack" functionality in many ways surpasses what Mungwall or Wipeout does. In fact, all MorphOS Beta builds have the memtrack feature enabled by default to promote buggy code being detected early. In production builds this memtrack feature can be enabled via the boot option "ed=permmemtrack".
In AROS it's built in as well. It's just called "mungwall", but it's not really the AOS-mungwall.
Quote:
There however are certain types of memory corruption issues that evade simple checks like this. This network stack one sounds one of those cases.
That's when you have to use other tricks as said (like make it check things at each task switch), but on MOS it may be difficult/impossible to temporarily hack such things in for normal non-mos-kernel coders.
The hosted version of AROS also can be run in gdb and you have complete symbols for all the OS, the libs, all the apps running, etc. The hosted OS is just like one big (Linux) program with user level threading (the Exec Tasks). It does not matter if something happens in Forbid/Disable state or if there is a deadlock or whatever. You can always CTRL-Z into the debugger. And then see symbolized backtraces of the current tasks (or other tasks in ready/wait queue).
For mem trashes you can use (hardware) watchpoints if you know what is trashed. You can use gdb tricks to install/remove such watchpoints dynamically/on the fly. Like by telling gdb to add a breakpoint in function xyz() and then tell gdb to execute some instructions whenever this breakpoint is reached. This could be ~"add hw watch point to xyz() param "taglist" + 1234, add another breakpoint at end of function, continue running, remove hw watch point again". For cases where a mem trash happens while inside xzy(), but only 1 out of 1000 times it gets called.
Sometimes very random memtrashes (like when you cannot pinpoint the crash to happening in a specifc task/function even with tricks like above) may have cause in "locking" bugs. Like TDNestCnt going "bad" because of mismatched Forbid()/Permit() calls. If somewhere Permit() is called too often (without matching Forbid()) it will cause task's future code execution inside Forbid()/Permit() protection to not be protected anymore. If Forbid() is called too often, a long time it may go unnoticed (because Wait() still breaks the forbid state), but if TDNestCnt is overflown there will be 1 time where code inside Forbid() block is not protected.