[MDEV-22245] sortlength: Conditional jump or move depends on uninitialised value Created: 2020-04-14  Updated: 2020-06-09  Resolved: 2020-06-09

Status: Closed
Project: MariaDB Server
Component/s: Server, Tests
Affects Version/s: 10.5
Fix Version/s: 10.5.4

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: valgrind


 Description   

$ perl ./mtr type_inet.type_inet6 --valgrind

10.5 91e79dff

type_inet.type_inet6                     [ fail ]  Found warnings/errors in server log file!
        Test ended at 2020-04-14 22:40:39
line
==22724== Thread 6:
==22724== Conditional jump or move depends on uninitialised value(s)
==22724==    at 0xD19FD2: sortlength(THD*, Sort_keys*, bool*, bool*) (filesort.cc:2269)
==22724==    by 0xD139DF: filesort(THD*, TABLE*, Filesort*, Filesort_tracker*, JOIN*, unsigned long long) (filesort.cc:252)
==22724==    by 0xA49543: create_sort_index(THD*, JOIN*, st_join_table*, Filesort*) (sql_select.cc:23860)
==22724==    by 0xA43523: st_join_table::sort_table() (sql_select.cc:21589)
==22724==    by 0xA430FA: join_init_read_record(st_join_table*) (sql_select.cc:21528)
==22724==    by 0xA40E8C: sub_select(JOIN*, st_join_table*, bool) (sql_select.cc:20602)
==22724==    by 0xA40343: do_select(JOIN*, Procedure*) (sql_select.cc:20139)
==22724==    by 0xA13F0D: JOIN::exec_inner() (sql_select.cc:4463)
==22724==    by 0xA13036: JOIN::exec() (sql_select.cc:4244)
==22724==    by 0xA14769: mysql_select(THD*, TABLE_LIST*, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*) (sql_select.cc:4668)
==22724==    by 0xA040DF: handle_select(THD*, LEX*, select_result*, unsigned long) (sql_select.cc:429)
==22724==    by 0x9C8833: execute_sqlcom_select(THD*, TABLE_LIST*) (sql_parse.cc:6168)
==22724==    by 0x9BF2B9: mysql_execute_command(THD*) (sql_parse.cc:3901)
==22724==    by 0x9CD83D: mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool) (sql_parse.cc:7953)
==22724==    by 0x9B8F40: dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool) (sql_parse.cc:1840)
==22724==    by 0x9B7676: do_command(THD*) (sql_parse.cc:1359)
==22724==    by 0xB61B36: do_handle_one_connection(CONNECT*, bool) (sql_connect.cc:1422)
==22724==    by 0xB61865: handle_one_connection (sql_connect.cc:1319)
==22724==    by 0x10B30F9: pfs_spawn_thread (pfs.cc:2201)
==22724==    by 0x4E3F4A3: start_thread (pthread_create.c:456)
^ Found warnings in /dev/shm/var_valgrind/log/mysqld.1.err

The test only exists in 10.5, I have no information yet whether the failure happens on any other tests.



 Comments   
Comment by Alexander Barkov [ 2020-06-01 ]

Hi elenst,

I can't reproduce this with the current 10.5:

commit 35cbbd4d70e300d25077ece1971c9f7266f347e9 

I tried a -DWITH_VALGRIND debug build.

Can you please check?

Thanks.

Comment by Elena Stepanova [ 2020-06-01 ]

I will check. Not surprised, I expect many Valgrind bug reports to become irrelevant after the recent crusade against Valgrind failures.

Comment by Elena Stepanova [ 2020-06-09 ]

The failure stopped happening after this commit:

commit c4bf4b7aefcd95b898ea9c8714d09fc1045f304c
Author: Monty
Date:   Fri May 15 16:15:49 2020 +0300
 
    Fixed access to undefined memory found by valgrind and MSAN
    
    When my_vsnprintf() is patched, the code protected disabled with
    'WAITING_FOR_BUGFIX_TO_VSPRINTF' should be enabled again. Also all %b
    formats in this patch should be revert to %s again

Generated at Thu Feb 08 09:13:17 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.