Skip to content

MDEV-38669: ASAN fail in Item_func_collect::add during ST_COLLECT#5247

Open
DaveGosselin-MariaDB wants to merge 1 commit into
12.3from
12.3-mdev-38669-stcollect-asan-fail
Open

MDEV-38669: ASAN fail in Item_func_collect::add during ST_COLLECT#5247
DaveGosselin-MariaDB wants to merge 1 commit into
12.3from
12.3-mdev-38669-stcollect-asan-fail

Conversation

@DaveGosselin-MariaDB

Copy link
Copy Markdown
Member

st_collect read past the end of its input because it assumed that the input was a valid geometry. Check that the length of the input is at least long enough to possibly contain a valid geometry.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request addresses MDEV-38669, where ST_COLLECT could read past the end of a non-geometry argument, by introducing a helper method Geometry::is_valid_geometry_length to validate geometry buffer lengths. However, the review highlights an inconsistency: short invalid geometries are silently ignored during aggregation, whereas longer invalid geometries pass the initial length check and cause the aggregate to fail later. It is recommended to handle all invalid geometries consistently and add mixed-validity test cases.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread sql/item_sum.cc
st_collect read past the end of its input because it assumed
that the input was a valid geometry.  Check that the length of the
input is at least long enough to possibly contain a valid geometry.
@DaveGosselin-MariaDB DaveGosselin-MariaDB force-pushed the 12.3-mdev-38669-stcollect-asan-fail branch from a56f974 to a344f1d Compare June 16, 2026 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

1 participant