[PATCH] bug in emergency cxa pool free()
Keef Aragon
keef.aragon@konscious.net
Tue Aug 16 19:14:31 GMT 2022
This probably has never actually affected anyone in practice. The normal
ABI implementation just uses malloc and only falls back to the pool on
malloc failure. But if that happens a bunch of times the freelist gets out
of order which violates some of the invariants of the freelist (as well as
the comments that follow the bug). The bug is just a comparison reversal
when traversing the freelist in the case where the pointer being returned
to the pool is after the existing freelist.
I'm not sure what to do as far as the test suite is concerned. It's a
private part of the implementation of the exception handling ABI and it can
only ever be triggered if malloc fails (repeatedly). So it seems like
reproducing it from the external interface will require hooking malloc to
forcibly return NULL.
But I'm a newb on these lists, so will obediently do as instructed.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: eh_alloc.patch
Type: text/x-patch
Size: 858 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/libstdc++/attachments/20220816/e9e57f99/attachment.bin>
More information about the Libstdc++
mailing list