Skip to content

Conversation

@Maxxen
Copy link
Member

@Maxxen Maxxen commented Mar 22, 2024

This PR fixes a ubsan issue I encountered when constructing some gnarly sql to output function documentation into a large nested structure for further processing. Even though the list segment code tries it best to ensure any allocations it makes are aligned by rounding up, if the shared aggregate arena is used by other aggregate functions this alignment can get out of sync.

This PR adds a AlignNext() helper function to the ArenaAllocator which moves the current position in the head chunk forwards until it is a multiple of 8 (if required), additionally I've also changed the AllocateAligned and ReallocateAligned to call this function before allocating anything to to ensure the next allocation actually will be aligned regardless of how the state of the allocator is left from previously performed allocations.

…also ensure AllocateAligned and ReallocAligned actually aligns the pointer before allocating
@Mytherin Mytherin merged commit ef62c27 into duckdb:main Mar 22, 2024
@Mytherin
Copy link
Collaborator

Thanks!

github-actions bot pushed a commit to duckdb/duckdb-r that referenced this pull request Mar 22, 2024
krlmlr added a commit to duckdb/duckdb-r that referenced this pull request Mar 23, 2024
github-actions bot pushed a commit to duckdb/duckdb-r that referenced this pull request Mar 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants