[MDEV-31223] UBSan error: sql_select.h:969:7: runtime error: load of value 214, which is not a valid value for type 'bool' Created: 2023-05-09  Updated: 2023-05-09  Resolved: 2023-05-09

Status: Closed
Project: MariaDB Server
Component/s: Optimizer
Affects Version/s: 11.0
Fix Version/s: 11.0.2

Type: Bug Priority: Major
Reporter: Sergei Petrunia Assignee: Sergei Petrunia
Resolution: Fixed Votes: 0
Labels: None


 Description   

Buildbot reports failures like this one:

https://buildbot.mariadb.net/buildbot/builders/kvm-ubsan/builds/5638/steps/mtr_nm/logs/stdio

main.stat_tables_innodb 'innodb'         w3 [ fail ]  Found warnings/errors in server log file!
        Test ended at 2023-05-09 09:07:24
line
/home/buildbot/buildbot/build/mariadb-11.0.2/sql/sql_select.h:969:7: runtime error: load of value 165, which is not a valid value for type 'bool'
^ Found warnings in /dev/shm/var/3/log/mysqld.1.err

main.subselect_sj2_mat 'innodb'          w2 [ fail ]  Found warnings/errors in server log file!
        Test ended at 2023-05-09 09:09:42
line
/home/buildbot/buildbot/build/mariadb-11.0.2/sql/sql_select.h:969:7: runtime error: load of value 45, which is not a valid value for type 'bool'

main.group_min_max 'innodb'              w2 [ fail ]  Found warnings/errors in server log file!
        Test ended at 2023-05-09 09:10:28
line
/home/buildbot/buildbot/build/mariadb-11.0.2/sql/sql_select.h:969:7: runtime error: load of value 173, which is not a valid value for type 'bool'

Also main.subselect_sj2 , main.subselect_sj2_jcl6, etc.

Failing tests:

binlog_encryption.encrypted_master_switch_to_unencrypted_gtid (different failure)
 
main.stat_tables_innodb \
main.subselect_sj2_mat \
main.group_min_max \
main.subselect_sj2 \
main.subselect_sj2_jcl6 \
main.update_use_source \
main.blackhole \
main.stat_tables \
main.selectivity



 Comments   
Comment by Sergei Petrunia [ 2023-05-09 ]

UBSAN_OPTIONS=print_stacktrace=1 ./mtr subselect_no_semijoin

shows

/home/psergey/dev-git2/11.0-review2/sql/sql_select.h:969:7: runtime error: load of value 214, which is not a valid value for type 'bool'
    #0 0x55cfec49f4f7 in POSITION::operator=(POSITION const&) /home/psergey/dev-git2/11.0-review2/sql/sql_select.h:969
    #1 0x55cfec3e13e3 in optimize_wo_join_buffering(JOIN*, unsigned int, unsigned int, unsigned long long, bool, unsigned int, double*, double*)
 /home/psergey/dev-git2/11.0-review2/sql/sql_select.cc:19455
    #2 0x55cfec9ac642 in LooseScan_picker::check_qep(JOIN*, unsigned int, unsigned long long, st_join_table const*, double*, double*, unsigned l
ong long*, sj_strategy_enum*, POSITION*) /home/psergey/dev-git2/11.0-review2/sql/opt_subselect.cc:3384
    #3 0x55cfec9a7df6 in optimize_semi_joins(JOIN*, unsigned long long, unsigned int, double*, double*, POSITION*) /home/psergey/dev-git2/11.0-review2/sql/opt_subselect.cc:2977
    #4 0x55cfec39afd4 in best_extension_by_limited_search /home/psergey/dev-git2/11.0-review2/sql/sql_select.cc:11362
    #5 0x55cfec39c6dd in best_extension_by_limited_search /home/psergey/dev-git2/11.0-review2/sql/sql_select.cc:11528
    #6 0x55cfec39c6dd in best_extension_by_limited_search /home/psergey/dev-git2/11.0-review2/sql/sql_select.cc:11528
    #7 0x55cfec394aa0 in greedy_search /home/psergey/dev-git2/11.0-review2/sql/sql_select.cc:10275
    #8 0x55cfec392007 in choose_plan(JOIN*, unsigned long long, TABLE_LIST*) /home/psergey/dev-git2/11.0-review2/sql/sql_select.cc:9796
    #9 0x55cfec36f212 in make_join_statistics /home/psergey/dev-git2/11.0-review2/sql/sql_select.cc:6085
    #10 0x55cfec346e50 in JOIN::optimize_inner() /home/psergey/dev-git2/11.0-review2/sql/sql_select.cc:2577
    #11 0x55cfec33f27d in JOIN::optimize() /home/psergey/dev-git2/11.0-review2/sql/sql_select.cc:1905
    #12 0x55cfec363c2e in mysql_select(THD*, TABLE_LIST*, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned lon g long, select_result*, st_select_lex_unit*, st_select_lex*) /home/psergey/dev-git2/11.0-review2/sql/sql_select.cc:5144

Generated at Thu Feb 08 10:22:12 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.