Skip to content

MDEV-39523 UBSAN on ST_COLLECT (has_cached_value)#5044

Open
grooverdan wants to merge 1 commit intoMariaDB:12.3from
grooverdan:MDEV-39523
Open

MDEV-39523 UBSAN on ST_COLLECT (has_cached_value)#5044
grooverdan wants to merge 1 commit intoMariaDB:12.3from
grooverdan:MDEV-39523

Conversation

@grooverdan
Copy link
Copy Markdown
Member

UBSAN errored with UBSAN: load of value 165, which is not a valid value for type 'bool' on SELECT ST_COLLECT.

This was Item_func_collect::val_str reading the has_cached_value. The member variable has_cached_value was set to true later in this function when it had a cached value. There was no initialization of has_cached_value to false in the constructor.

@grooverdan grooverdan added the MariaDB Foundation Pull requests created by MariaDB Foundation label May 6, 2026
Copy link
Copy Markdown

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

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 a UBSAN error (MDEV-38755) by initializing the has_cached_result member variable in the Item_func_collect constructors. It also adds regression tests for spatial utility functions when processing empty tables. I have no feedback to provide.

@grooverdan grooverdan force-pushed the MDEV-39523 branch 2 times, most recently from 40e3400 to 1c95e68 Compare May 6, 2026 03:19
UBSAN errored with UBSAN: load of value 165, which is not a valid value for
type 'bool' on SELECT ST_COLLECT.

This was Item_func_collect::val_str reading the has_cached_value. The
member variable has_cached_value was set to true later in this function
when it had a cached value. There was no initialization of
has_cached_value to false in the constructor.

We copy the cached value if the Item_func_collect is copied.
@grooverdan grooverdan changed the title MDEV-38755 UBSAN on ST_COLLECT (has_cached_value) MDEV-39523 UBSAN on ST_COLLECT (has_cached_value) May 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

MariaDB Foundation Pull requests created by MariaDB Foundation

Development

Successfully merging this pull request may close these issues.

2 participants