Bug #115783 Valgrind error on test_services suite tests
Submitted: 6 Aug 2024 12:38 Modified: 30 Jan 12:37
Reporter: Laurynas Biveinis (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Connection Handling Severity:S3 (Non-critical)
Version:8.4, 9.2.0 OS:Any
Assigned to: CPU Architecture:Any

[6 Aug 2024 12:38] Laurynas Biveinis
Description:
Tested on x86_64 and aarch64, did not test 8.0 / 8.4 series yet.

 33%] test_services.test_execute_regular_statement  [ fail ]  Found warnings/errors in error log file!
        Test ended at 2024-08-06 12:34:32
include/load_error_log.inc
line
==19977== Thread 36 connection:
==19977== Conditional jump or move depends on uninitialised value(s)
==19977==    at 0x3F9C0E4: std::enable_if<((__exactly_once<std::variant_alternative<__accepted_index<MYSQL_LEX_CSTRING&>, std::variant<std::monostate, long*, unsigned long*, double*, MYSQL_TIME*, MYSQL_LEX_CSTRING, decimal*> >::type>)&&(is_constructible_v<std::variant_alternative<__accepted_index<MYSQL_LEX_CSTRING&>, std::variant<std::monostate, long*, unsigned long*, double*, MYSQL_TIME*, MYSQL_LEX_CSTRING, decimal*> >::type, MYSQL_LEX_CSTRING&>))&&(is_assignable_v<std::variant_alternative<__accepted_index<MYSQL_LEX_CSTRING&>, std::variant<std::monostate, long*, unsigned long*, double*, MYSQL_TIME*, MYSQL_LEX_CSTRING, decimal*> >::type&, MYSQL_LEX_CSTRING&>), std::variant<std::monostate, long*, unsigned long*, double*, MYSQL_TIME*, MYSQL_LEX_CSTRING, decimal*>&>::type std::variant<std::monostate, long*, unsigned long*, double*, MYSQL_TIME*, MYSQL_LEX_CSTRING, decimal*>::operator=<MYSQL_LEX_CSTRING&>(MYSQL_LEX_CSTRING&) (variant:1466)
==19977==    by 0x3F9A233: Protocol_local_v2::store_string(char const*, unsigned long, CHARSET_INFO const*, CHARSET_INFO const*) (protocol_local_v2.cc:127)
==19977==    by 0x3F9A487: Protocol_local_v2::store_string(char const*, unsigned long, CHARSET_INFO const*) (protocol_local_v2.cc:175)
==19977==    by 0x3C259AF: Protocol::store(String*) (protocol.h:164)
==19977==    by 0x3BF9797: Field::send_to_protocol(Protocol*) const (field.cc:1978)
==19977==    by 0x3F9A627: Protocol_local_v2::store_field(Field const*) (protocol_local_v2.cc:213)
==19977==    by 0x3CBFB73: Item_field::send(Protocol*, String*) (item.cc:8097)
==19977==    by 0x3716227: THD::send_result_set_row(mem_root_deque<Item*> const&) (sql_class.cc:2897)
==19977==    by 0x3F6D987: Query_result_send::send_data(THD*, mem_root_deque<Item*> const&) (query_result.cc:103)
==19977==    by 0x3963C47: Query_expression::ExecuteIteratorQuery(THD*) (sql_union.cc:1783)
==19977==    by 0x3963F17: Query_expression::execute(THD*) (sql_union.cc:1830)
==19977==    by 0x38A9F63: Sql_cmd_dml::execute_inner(THD*) (sql_select.cc:1064)
==19977==    by 0x38A92AB: Sql_cmd_dml::execute(THD*) (sql_select.cc:782)
==19977==    by 0x38C1CA7: Sql_cmd_show::execute(THD*) (sql_show.cc:221)
==19977==    by 0x381E957: mysql_execute_command(THD*, bool) (sql_parse.cc:4669)
==19977==    by 0x36871CF: Statement_runnable::execute_server_code(THD*) (statement_runnable.cc:107)
==19977==  Uninitialised value was created by a client request
==19977==    at 0x361BAA8: TRASH(void*, unsigned long) (memory_debugging.h:74)
==19977==    by 0x503981B: MEM_ROOT::AllocBlock(unsigned long, unsigned long) (my_alloc.cc:96)
==19977==    by 0x5039937: MEM_ROOT::AllocSlow(unsigned long) (my_alloc.cc:124)
==19977==    by 0x3604F2F: MEM_ROOT::Alloc(unsigned long) (my_alloc.h:165)
==19977==    by 0x3F9A9BB: Protocol_local_v2::start_row() (protocol_local_v2.cc:304)
==19977==    by 0x3F6D97B: Query_result_send::send_data(THD*, mem_root_deque<Item*> const&) (query_result.cc:102)
==19977==    by 0x3963C47: Query_expression::ExecuteIteratorQuery(THD*) (sql_union.cc:1783)
==19977==    by 0x3963F17: Query_expression::execute(THD*) (sql_union.cc:1830)
==19977==    by 0x38A9F63: Sql_cmd_dml::execute_inner(THD*) (sql_select.cc:1064)
==19977==    by 0x38A92AB: Sql_cmd_dml::execute(THD*) (sql_select.cc:782)
==19977==    by 0x38C1CA7: Sql_cmd_show::execute(THD*) (sql_show.cc:221)
==19977==    by 0x381E957: mysql_execute_command(THD*, bool) (sql_parse.cc:4669)
==19977==    by 0x36871CF: Statement_runnable::execute_server_code(THD*) (statement_runnable.cc:107)
==19977==    by 0x38669B3: Prepared_statement::execute_server_runnable(THD*, Server_runnable*) (sql_prepare.cc:3104)
==19977==    by 0x368214F: Regular_statement_handle::execute(Server_runnable*) (statement.cc:342)
==19977==    by 0x3681F6F: Regular_statement_handle::execute() (statement.cc:307)

How to repeat:
Server built with debug and Valgrind CMake options

./mtr test_services.test_execute_regular_statement --valgrind --valgrind-option=--track-origins=yes
[6 Aug 2024 12:46] Laurynas Biveinis
Same with test_services.test_execute_prepared_statement
[6 Aug 2024 12:57] MySQL Verification Team
HI Mr. Biveinis,

That test is in our source code, but not in our binaries ......

Hence, we have to check first whether it is still supported or not .......
[6 Aug 2024 12:58] MySQL Verification Team
Hi,

Also, are you sure that category is correct ?????
[6 Aug 2024 13:01] Laurynas Biveinis
There is no category for the server protocol implementation, thus I considered connection handling to be the closest match.
[6 Aug 2024 13:16] Laurynas Biveinis
Same on 8.4.2 (where the Valgrind log also shows bug 115229)
[6 Aug 2024 13:22] MySQL Verification Team
Hi Mr. Biveinis,

We have asked for some clarifications .....

Mostly for the reason of the absence of the component in our binaries ......

Hence, we do not know whether it is still supported or not.

Meanwhile, this will have to wait ....
[6 Aug 2024 13:30] Laurynas Biveinis
Hopefully you checked 8.4 or 9.0 because 8.0 does not have these tests.
Please also note that these tests (their suite) are the part of the default MTR run
[6 Aug 2024 13:40] MySQL Verification Team
Hi,

Problem is not in the test, but in the component .......
[6 Aug 2024 15:21] MySQL Verification Team
Hi Mr. Laurynas,

We were able to repeat the behaviour on the  8.4 and 9.0.

We shall send a full report in the hidden comment. Sorry for that ....

It affects latest 8.4 and 9.0 only.

Verified as reported.
[30 Jan 12:37] Laurynas Biveinis
Same on 9.2.0
[30 Jan 12:56] MySQL Verification Team
Thank you, Mr. Laurynas.