Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-40838

SIGABRT's in duckdb::Value::GetValueInternal (opt) and duckdb::Cast::Operation (dbg) on SELECT from ALTER modified SET row

    XMLWordPrintable

Details

    • Can result in hang or crash

    Description

      INSTALL SONAME 'ha_duckdb';
      CREATE TABLE t (c SET('a','b') KEY) ENGINE=DuckDB ;
      INSERT INTO t SET c=1;
      ALTER TABLE t CHANGE IF EXISTS c c FLOAT(2,2);
      SELECT * FROM t;
      

      Leads to:

      CS 13.1.0 da18481158c81ca94689702073c3e04aad85a6a3 (Optimized, Clang 22.1.8-20260622) Build 18/08/2026

      Core was generated by `/test/MD180826-mariadb-13.1.0-linux-x86_64-opt/bin/mariadbd --no-defaults --loo'.
      Program terminated with signal SIGABRT, Aborted.
      #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
       
      [Current thread is 1 (LWP 3130419)]
      (gdb) bt
      #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
      #1  __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78
      #2  __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89
      #3  0x000077a64424527e in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
      #4  0x000077a6442288ff in __GI_abort () at ./stdlib/abort.c:79
      #5  0x000077a6446a5ff5 in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6
      #6  0x000077a6446bb0da in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6
      #7  0x000077a6446a5a55 in std::terminate() ()
         from /lib/x86_64-linux-gnu/libstdc++.so.6
      #8  0x000077a6446bb391 in __cxa_throw ()
         from /lib/x86_64-linux-gnu/libstdc++.so.6
      #9  0x000077a61100f09d in float duckdb::Value::GetValueInternal<float>() const()
         from /test/MD180826-mariadb-13.1.0-linux-x86_64-opt/lib/plugin/ha_duckdb.so
      #10 0x000077a610d03bf1 in store_duckdb_field_in_mysql_format (field=0x6fa570324ce0, value=@0x77a63a84a600: <incomplete type>, thd=<optimized out>)at /test/13.1_opt/storage/duckdb/convertor/duckdb_select.cc:145
      #11 0x000077a610ca982e in ha_duckdb_select_handler::next_row (this=0x6fa5703208e0)at /test/13.1_opt/storage/duckdb/ha_duckdb_pushdown.cc:922
      #12 0x000062957b6650ec in select_handler::execute (this=0x6fa5703208e0)at /test/13.1_opt/sql/select_handler.cc:172
      #13 0x000062957b61ab55 in JOIN::exec_inner (this=this@entry=0x6fa570019500)at /test/13.1_opt/sql/sql_select.cc:5104
      #14 0x000062957b6015a7 in JOIN::exec (this=0x6fa570019500)at /test/13.1_opt/sql/sql_select.cc:4914
      #15 mysql_select (thd=thd@entry=0x6fa570000c70, tables=<optimized out>, fields=@0x6fa570017f68: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x6fa5700182e0, last = 0x6fa5700182e0, elements = 1}, <No data fields>}, conds=<optimized out>, og_num=<optimized out>, order=<optimized out>, group=0x0, having=0x0, proc_param=0x0, select_options=<optimized out>, result=0x6fa5700194d0, unit=0x6fa570005230, select_lex=0x6fa570017cb0)at /test/13.1_opt/sql/sql_select.cc:5440
      #16 0x000062957b6011c0 in handle_select (thd=thd@entry=0x6fa570000c70, lex=lex@entry=0x6fa570005150, result=result@entry=0x6fa5700194d0, setup_tables_done_option=setup_tables_done_option@entry=0)at /test/13.1_opt/sql/sql_select.cc:637
      #17 0x000062957b5ccc87 in execute_sqlcom_select (thd=thd@entry=0x6fa570000c70, all_tables=0x6fa570018350) at /test/13.1_opt/sql/sql_parse.cc:6229
      #18 0x000062957b5c84c7 in mysql_execute_command (thd=thd@entry=0x6fa570000c70, is_called_from_prepared_stmt=false) at /test/13.1_opt/sql/sql_parse.cc:3997
      #19 0x000062957b5c372d in mysql_parse (thd=thd@entry=0x6fa570000c70, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x77a63a84b4e0)at /test/13.1_opt/sql/sql_parse.cc:7968
      #20 0x000062957b5c1f05 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x6fa570000c70, packet=packet@entry=0x6fa570008e61 "", packet_length=packet_length@entry=15, blocking=true)at /test/13.1_opt/sql/sql_parse.cc:1903
      #21 0x000062957b5c3bb0 in do_command (thd=thd@entry=0x6fa570000c70, blocking=true) at /test/13.1_opt/sql/sql_parse.cc:1437
      #22 0x000062957b6ef79d in do_handle_one_connection (connect=<optimized out>, connect@entry=0x6295ad680b40, put_in_cache=true)at /test/13.1_opt/sql/sql_connect.cc:1514
      #23 0x000062957b6ef5d2 in handle_one_connection (arg=arg@entry=0x6295ad680b40)at /test/13.1_opt/sql/sql_connect.cc:1426
      #24 0x000062957ba9cb73 in pfs_spawn_thread (arg=0x6295ad6a16a0)at /test/13.1_opt/storage/perfschema/pfs.cc:2198
      #25 0x000077a64429cb84 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447
      #26 0x000077a644329d6c in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      

      CS 13.1.0 da18481158c81ca94689702073c3e04aad85a6a3 (Debug, Clang 22.1.8-20260622) Build 18/08/2026

      Core was generated by `/test/MD180826-mariadb-13.1.0-linux-x86_64-dbg/bin/mariadbd --no-defaults --loo'.
      Program terminated with signal SIGABRT, Aborted.
      #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
       
      [Current thread is 1 (LWP 3126196)]
      (gdb) bt
      #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
      #1  __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78
      #2  __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89
      #3  0x000079526124527e in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
      #4  0x00007952612288ff in __GI_abort () at ./stdlib/abort.c:79
      #5  0x00007952616a5ff5 in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6
      #6  0x00007952616bb0da in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6
      #7  0x00007952616a5a55 in std::terminate() ()
         from /lib/x86_64-linux-gnu/libstdc++.so.6
      #8  0x00007952616bb391 in __cxa_throw ()
         from /lib/x86_64-linux-gnu/libstdc++.so.6
      #9  0x0000715127b9d855 in duckdb::Cast::Operation<duckdb::string_t, float> (input={static PREFIX_BYTES = 4, static INLINE_BYTES = 12, static HEADER_SIZE = 8, static MAX_STRING_SIZE = 4294967295, static PREFIX_LENGTH = 4, static INLINE_LENGTH = 12, value = {pointer = {length = 1, prefix = "a\000\000", ptr = 0x0}, inlined = {length = 1, inlined = "a\000\000\000\000\000\000\000\000\000\000"}}})at /test/13.1_dbg/storage/duckdb/third_parties/duckdb/src/include/duckdb/common/operator/cast_operators.hpp:76
      #10 0x0000715127b4e2fe in duckdb::Value::GetValueInternal<float> (this=0x7152202fd590)at /test/13.1_dbg/storage/duckdb/third_parties/duckdb/src/common/types/value.cpp:1217
      #11 0x0000715127a71225 in duckdb::Value::GetValue<float> (this=0x7152202fd590)at /test/13.1_dbg/storage/duckdb/third_parties/duckdb/src/common/types/value.cpp:1310
      #12 0x00007151276bafe9 in store_duckdb_field_in_mysql_format (field=0x71513035c1d0, value=@0x7152202fd590: {type_ = {id_ = duckdb::LogicalTypeId::VARCHAR, physical_type_ = duckdb::PhysicalType::VARCHAR, type_info_ = {internal = std::shared_ptr<struct duckdb::ExtraTypeInfo> (empty) = {        get() = 0x0      }}, static SQLNULL = duckdb::LogicalTypeId::SQLNULL, static UNKNOWN = duckdb::LogicalTypeId::UNKNOWN, static BOOLEAN = duckdb::LogicalTypeId::BOOLEAN, static TINYINT = duckdb::LogicalTypeId::TINYINT, static UTINYINT = duckdb::LogicalTypeId::UTINYINT, static SMALLINT = duckdb::LogicalTypeId::SMALLINT, static USMALLINT = duckdb::LogicalTypeId::USMALLINT, static INTEGER = duckdb::LogicalTypeId::INTEGER, static UINTEGER = duckdb::LogicalTypeId::UINTEGER, static BIGINT = duckdb::LogicalTypeId::BIGINT, static UBIGINT = duckdb::LogicalTypeId::UBIGINT, static FLOAT = duckdb::LogicalTypeId::FLOAT, static DOUBLE = duckdb::LogicalTypeId::DOUBLE, static DATE = duckdb::LogicalTypeId::DATE, static TIMESTAMP = duckdb::LogicalTypeId::TIMESTAMP, static TIMESTAMP_S = duckdb::LogicalTypeId::TIMESTAMP_SEC, static TIMESTAMP_MS = duckdb::LogicalTypeId::TIMESTAMP_MS, static TIMESTAMP_NS = duckdb::LogicalTypeId::TIMESTAMP_NS, static TIME = duckdb::LogicalTypeId::TIME, static TIME_NS = duckdb::LogicalTypeId::TIME_NS, static TIMESTAMP_TZ = duckdb::LogicalTypeId::TIMESTAMP_TZ, static TIME_TZ = duckdb::LogicalTypeId::TIME_TZ, static VARCHAR = duckdb::LogicalTypeId::VARCHAR, static ANY = duckdb::LogicalTypeId::ANY, static BLOB = duckdb::LogicalTypeId::BLOB, static BIT = duckdb::LogicalTypeId::BIT, static BIGNUM = duckdb::LogicalTypeId::BIGNUM, static INTERVAL = duckdb::LogicalTypeId::INTERVAL, static HUGEINT = duckdb::LogicalTypeId::HUGEINT, static UHUGEINT = duckdb::LogicalTypeId::UHUGEINT, static UUID = duckdb::LogicalTypeId::UUID, static HASH = duckdb::LogicalTypeId::UBIGINT, static POINTER = duckdb::LogicalTypeId::POINTER, static TABLE = duckdb::LogicalTypeId::TABLE, static LAMBDA = duckdb::LogicalTypeId::LAMBDA, static INVALID = duckdb::LogicalTypeId::INVALID, static ROW_TYPE = duckdb::LogicalTypeId::BIGINT, static JSON_TYPE_NAME = <optimized out>}, is_null = false, value_ = {boolean = 32, tinyint = 32 ' ', smallint = -10720, integer = 540005920, bigint = 124597541262880, utinyint = 32 ' ', usmallint = 54816, uinteger = 540005920, ubigint = 124597541262880, hugeint = {lower = 124597541262880, upper = 124593511710000}, uhugeint = {lower = 124597541262880, upper = 124593511710000}, float_ = 1.48939246e-19, double_ = 6.1559364694276173e-310, pointer = 124597541262880, hash = 124597541262880, date = {days = 540005920}, time = {micros = 124597541262880}, time_ns = {<duckdb::dtime_t> = {micros = 124597541262880}, <No data fields>}, timetz = {static TIME_BITS = 40, static OFFSET_BITS = 24, static OFFSET_MASK = 16777215, static MAX_OFFSET = 57599, static MIN_OFFSET = -57599, static OFFSET_MICROS = 1000000, bits = 124597541262880}, timestamp = {value = 124597541262880}, timestamp_s = {<duckdb::timestamp_t> = {value = 124597541262880}, <No data fields>}, timestamp_ms = {<duckdb::timestamp_t> = {value = 124597541262880}, <No data fields>}, timestamp_ns = {<duckdb::timestamp_t> = {value = 124597541262880}, <No data fields>}, timestamp_tz = {<duckdb::timestamp_t> = {value = 124597541262880}, <No data fields>}, interval = {months = 540005920, days = 29010, micros = 124593511710000}}, value_info_ = {internal = std::shared_ptr<struct duckdb::ExtraValueInfo> (use count 1, weak count 0) = {      get() = 0x715130037090    }}}, thd=0x715130000d60)at /test/13.1_dbg/storage/duckdb/convertor/duckdb_select.cc:145
      #13 0x000071512763b5af in ha_duckdb_select_handler::next_row (this=0x71513035a1a0)at /test/13.1_dbg/storage/duckdb/ha_duckdb_pushdown.cc:922
      #14 0x000061b9f0528e6e in select_handler::execute (this=0x71513035a1a0)at /test/13.1_dbg/sql/select_handler.cc:172
      #15 0x000061b9f04ba1ad in JOIN::exec_inner (this=0x71513001bd60)at /test/13.1_dbg/sql/sql_select.cc:5104
      #16 0x000061b9f04b9633 in JOIN::exec (this=0x71513001bd60)at /test/13.1_dbg/sql/sql_select.cc:4914
      #17 0x000061b9f04976db in mysql_select (thd=0x715130000d60, tables=0x71513001abb0, fields=@0x71513001a7c8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x71513001ab40, last = 0x71513001ab40, elements = 1}, <No data fields>}, conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2164525824, result=0x71513001bd30, unit=0x7151300052f8, select_lex=0x71513001a510) at /test/13.1_dbg/sql/sql_select.cc:5440
      #18 0x000061b9f049723d in handle_select (thd=0x715130000d60, lex=0x715130005218, result=0x71513001bd30, setup_tables_done_option=0)at /test/13.1_dbg/sql/sql_select.cc:637
      #19 0x000061b9f043d056 in execute_sqlcom_select (thd=0x715130000d60, all_tables=0x71513001abb0) at /test/13.1_dbg/sql/sql_parse.cc:6229
      #20 0x000061b9f04332bb in mysql_execute_command (thd=0x715130000d60, is_called_from_prepared_stmt=false) at /test/13.1_dbg/sql/sql_parse.cc:3997
      #21 0x000061b9f042c048 in mysql_parse (thd=0x715130000d60, rawbuf=0x71513001a490 "SELECT * FROM t", length=15, parser_state=0x7152202ff9c0) at /test/13.1_dbg/sql/sql_parse.cc:7968
      #22 0x000061b9f042976e in dispatch_command (command=COM_QUERY, thd=0x715130000d60, packet=0x71513000b6c1 "", packet_length=15, blocking=true) at /test/13.1_dbg/sql/sql_parse.cc:1903
      #23 0x000061b9f042caca in do_command (thd=0x715130000d60, blocking=true)at /test/13.1_dbg/sql/sql_parse.cc:1437
      #24 0x000061b9f060402e in do_handle_one_connection (connect=0x61b9fdad99c0, put_in_cache=true) at /test/13.1_dbg/sql/sql_connect.cc:1514
      #25 0x000061b9f0603e11 in handle_one_connection (arg=0x61b9fdabfab0)at /test/13.1_dbg/sql/sql_connect.cc:1426
      #26 0x000079526129cb84 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447
      #27 0x0000795261329d6c in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      

      Bug Detection Matrix

          Rel    o/d  Build   Commit                                    UniqueID observed             
      CS  10.11  dbg  180826  8f00e6caca633c783140db86d3a48a96de67cf38  No bug found                  
      CS  10.11  opt  180826  8f00e6caca633c783140db86d3a48a96de67cf38  No bug found                  
      CS  11.4   dbg  180826  1a052f27e374fc9b4cb5b1fd098cf10f0e1381cc  No bug found                  
      CS  11.4   opt  180826  1a052f27e374fc9b4cb5b1fd098cf10f0e1381cc  No bug found                  
      CS  11.8   dbg  180826  d26f9ab217a7fcf9d4eccc62c01020ff275ff42e  SIGABRT|__cxa_throw|duckdb::Cast::Operation<duckdb::string_t, float>|duckdb::Value::GetValueInternal<float>|duckdb::Value::GetValue<float>
      CS  11.8   opt  180826  d26f9ab217a7fcf9d4eccc62c01020ff275ff42e  SIGABRT|__cxa_throw|float duckdb::Value::GetValueInternal<float>|store_duckdb_field_in_mysql_format|ha_duckdb_select_handler::next_row
      CS  12.3   dbg  180826  add63991988734383c5e942de2a19c6c45f511f7  SIGABRT|__cxa_throw|duckdb::Cast::Operation<duckdb::string_t, float>|duckdb::Value::GetValueInternal<float>|duckdb::Value::GetValue<float>
      CS  12.3   opt  180826  add63991988734383c5e942de2a19c6c45f511f7  SIGABRT|__cxa_throw|float duckdb::Value::GetValueInternal<float>|store_duckdb_field_in_mysql_format|ha_duckdb_select_handler::next_row
      CS  13.0   dbg  180826  a848493c6fe031f23606144420c1ca1e467cbd81  SIGABRT|__cxa_throw|duckdb::Cast::Operation<duckdb::string_t, float>|duckdb::Value::GetValueInternal<float>|duckdb::Value::GetValue<float>
      CS  13.0   opt  180826  a848493c6fe031f23606144420c1ca1e467cbd81  SIGABRT|__cxa_throw|float duckdb::Value::GetValueInternal<float>|store_duckdb_field_in_mysql_format|ha_duckdb_select_handler::next_row
      CS  13.1   dbg  180826  da18481158c81ca94689702073c3e04aad85a6a3  SIGABRT|__cxa_throw|duckdb::Cast::Operation<duckdb::string_t, float>|duckdb::Value::GetValueInternal<float>|duckdb::Value::GetValue<float>
      CS  13.1   opt  180826  da18481158c81ca94689702073c3e04aad85a6a3  SIGABRT|__cxa_throw|float duckdb::Value::GetValueInternal<float>|store_duckdb_field_in_mysql_format|ha_duckdb_select_handler::next_row
      ES  10.6   dbg  180826  fcecb2620f25965723d640decede7c018bcb1dcc  No bug found                  
      ES  10.6   opt  180826  fcecb2620f25965723d640decede7c018bcb1dcc  No bug found                  
      ES  11.4   dbg  180826  3b34189bfe675c18c4ced3ef531d016ea74c76f4  No bug found                  
      ES  11.4   opt  180826  3b34189bfe675c18c4ced3ef531d016ea74c76f4  No bug found                  
      ES  11.8   dbg  180826  4694e931d10fecf733c34f83ea2146d31b708eb3  No bug found                  
      ES  11.8   opt  180826  4694e931d10fecf733c34f83ea2146d31b708eb3  No bug found                  
      ES  12.3   dbg  180826  f513f503feacabfb219d4a6f965b5f72b86d4db0  No bug found                  
      ES  12.3   opt  180826  f513f503feacabfb219d4a6f965b5f72b86d4db0  No bug found                   
      

      Attachments

        Issue Links

          Activity

            People

              drrtuy Roman
              Roel Roel Van de Paar
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - 0d
                  0d
                  Remaining:
                  Time Spent - 0.75h Remaining Estimate - 1h
                  1h
                  Logged:
                  Time Spent - 0.75h Remaining Estimate - 1h
                  0.75h

                  Git Integration

                    Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.