How to disable arena allocation without rewriting code?

78 views
Skip to first unread message

Mikihito Matsuura

unread,
Dec 20, 2024, 1:07:39 AM12/20/24
to Protocol Buffers
Hi,

Is there any way to quickly disable arena allocation and serve allocations via a system allocator, either by build flag or runtime configuration?
We are trying to debug OOB issue in arena allocation, but it can not be caught by e.g. ASan.
It would be great if we have a "debug mode" which splits an arena into individual allocations so that we can utilize existing memory debugging tools.

Mikihito

Samuel Benzaquen

unread,
Dec 20, 2024, 10:38:09 AM12/20/24
to Mikihito Matsuura, Protocol Buffers
On Fri, Dec 20, 2024 at 1:07 AM 'Mikihito Matsuura' via Protocol Buffers <prot...@googlegroups.com> wrote:
Hi,

Is there any way to quickly disable arena allocation and serve allocations via a system allocator, either by build flag or runtime configuration?

I have not tested this, but you might be able to do what you need by passing a very small `max_block_size` in the arena options. That would force each allocation to go its own block.
 
We are trying to debug OOB issue in arena allocation, but it can not be caught by e.g. ASan.
It would be great if we have a "debug mode" which splits an arena into individual allocations so that we can utilize existing memory debugging tools.

Mikihito

--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/protobuf/9d9f54cc-521d-4148-956e-201cf1d8ad3an%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages