Heap protection check bad address

Chris Johns chrisj at rtems.org
Mon May 13 23:44:38 UTC 2019


On 14/5/19 9:41 am, Joel Sherrill wrote:
> On Mon, May 13, 2019, 6:04 PM Chris Johns <chrisj at rtems.org
> <mailto:chrisj at rtems.org>> wrote:
> 
>     Hi,
> 
>     I chased down a buffer overwrite bug in libdl (#3746). On the powerpc and sparc
>     the test dl05.exe crashed and on xilinx_zynq_a9_qemu I got a heap protection
>     error on free. This was really nice however it is a mission to take that error
>     message and figure out the block address that is the cause. A had to add a
>     couple of additional prints to get the block address and with that I could set a
>     watch point that triggered on the invalid write. The patch to fix the bug was
>     the easy part.
> 
>     Would a bad block variable set by the error handler that can be inspected by a
>     debugger or exit handler be useful?
> 
> I would like to see the ability to register a handler for various heap issues.
> And then pass all the info you have to it.

Oh yes that is a great idea.

Chris



More information about the devel mailing list