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

Assertion `src != ((void*)0)' failed in my_casedn_utf8mb4, UBSAN nullptr-with-offset in my_casedn_utf8mb4

    XMLWordPrintable

Details

    Description

      --source include/have_innodb.inc 
      --let $restart_parameters=--innodb-ft-min-token-size=0
      --source include/restart_mysqld.inc
       
      CREATE TABLE t (f CHAR,FULLTEXT (f)) ENGINE=INNODB;
      INSERT INTO t VALUES ('');
      

      Leads to:

      CS 12.2.0 e02f4d7e311e214ea62ff2e59599849e229f4165 (Debug, Clang) Build 07/08/2025

      mariadbd: /test/12.2_dbg/strings/ctype-utf8.c:2956: size_t my_casedn_utf8mb4(CHARSET_INFO *, const char *, size_t, char *, size_t): Assertion `src != ((void*)0)' failed.
      

      CS 12.2.0 e02f4d7e311e214ea62ff2e59599849e229f4165 (Debug, Clang) Build 07/08/2025

      Core was generated by `/test/MD070825-mariadb-12.2.0-linux-x86_64-dbg/bin/mariadbd --no-defaults --max'.
      Program terminated with signal SIGABRT, Aborted.
      Download failed: Invalid argument.  Continuing without source file ./nptl/./nptl/pthread_kill.c.
      #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
       
      [Current thread is 1 (LWP 3862701)]
      (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  0x000073bc65a4527e in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
      #4  0x000073bc65a288ff in __GI_abort () at ./stdlib/abort.c:79
      #5  0x000073bc65a2881b in __assert_fail_base (fmt=0x73bc65bd01e8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x5bd5b5f4d9b6 "src != ((void*)0)", file=file@entry=0x5bd5b5f54a9d "/test/12.2_dbg/strings/ctype-utf8.c", line=line@entry=2956, function=function@entry=0x5bd5b5f55dff "size_t my_casedn_utf8mb4(CHARSET_INFO *, const char *, size_t, char *, size_t)") at ./assert/assert.c:96
      #6  0x000073bc65a3b517 in __assert_fail (assertion=0x5bd5b5f4d9b6 "src != ((void*)0)", file=0x5bd5b5f54a9d "/test/12.2_dbg/strings/ctype-utf8.c", line=2956, function=0x5bd5b5f55dff "size_t my_casedn_utf8mb4(CHARSET_INFO *, const char *, size_t, char *, size_t)") at ./assert/assert.c:105
      #7  0x00005bd5b5b488b7 in my_casedn_utf8mb4 (cs=0x5bd5bef47df8, src=0x0, srclen=0, dst=0x73a150094248 "", dstlen=0)at /test/12.2_dbg/strings/ctype-utf8.c:2956
      #8  0x00005bd5b4c3485d in charset_info_st::casedn (this=0x5bd5bef47df8, src=0x0, srclen=0, dst=0x73a150094248 "", dstlen=0)at /test/12.2_dbg/include/m_ctype.h:897
      #9  0x00005bd5b4c347fe in charset_info_st::casedn_z (this=0x5bd5bef47df8, src=0x0, srclen=0, dst=0x73a150094248 "", dstlen=1)at /test/12.2_dbg/include/m_ctype.h:917
      #10 0x00005bd5b59d784a in fts_add_token (result_doc=0x73b8876f87c8, str={f_str = 0x0, f_len = 0, f_n_char = 0}, position=1)at /test/12.2_dbg/storage/innobase/fts/fts0fts.cc:4476
      #11 0x00005bd5b59d75e7 in fts_process_token (doc=0x73b8876f87c8, result=0x0, start_pos=0, add_pos=0)at /test/12.2_dbg/storage/innobase/fts/fts0fts.cc:4537
      #12 0x00005bd5b59ccb02 in fts_tokenize_document (doc=0x73b8876f87c8, result=0x0, parser=0x0)at /test/12.2_dbg/storage/innobase/fts/fts0fts.cc:4722
      #13 0x00005bd5b59d5374 in fts_fetch_doc_from_rec (get_doc=0x73a150044eb8, clust_index=0x73a15002e6c8, pcur=0x73b8876f8838, offsets=0x73a150092228, doc=0x73b8876f87c8) at /test/12.2_dbg/storage/innobase/fts/fts0fts.cc:3218
      #14 0x00005bd5b59cbcc9 in fts_add_doc_by_id (ftt=0x73a150093da8, doc_id=1)at /test/12.2_dbg/storage/innobase/fts/fts0fts.cc:3504
      #15 0x00005bd5b59cb263 in fts_add (ftt=0x73a150093da8, row=0x73a150093b40)at /test/12.2_dbg/storage/innobase/fts/fts0fts.cc:2818
      #16 0x00005bd5b59cc533 in fts_commit_table (ftt=0x73a150093da8)at /test/12.2_dbg/storage/innobase/fts/fts0fts.cc:2980
      #17 0x00005bd5b59cc306 in fts_commit (trx=0x73bc64a13b80)at /test/12.2_dbg/storage/innobase/fts/fts0fts.cc:3029
      #18 0x00005bd5b5861a4c in trx_t::commit_low (this=0x73bc64a13b80, mtr=0x73b8876f91c8) at /test/12.2_dbg/storage/innobase/trx/trx0trx.cc:1556
      #19 0x00005bd5b5863063 in trx_t::commit_persist (this=0x73bc64a13b80)at /test/12.2_dbg/storage/innobase/trx/trx0trx.cc:1608
      #20 0x00005bd5b5863165 in trx_t::commit (this=0x73bc64a13b80)at /test/12.2_dbg/storage/innobase/trx/trx0trx.cc:1617
      #21 0x00005bd5b586421b in trx_commit_for_mysql (trx=0x73bc64a13b80)at /test/12.2_dbg/storage/innobase/trx/trx0trx.cc:1732
      #22 0x00005bd5b5592eb4 in innobase_commit_low (trx=0x73bc64a13b80)at /test/12.2_dbg/storage/innobase/handler/ha_innodb.cc:4336
      #23 0x00005bd5b55bf61c in innobase_commit_ordered_2 (trx=0x73bc64a13b80, thd=0x73a150000d58)at /test/12.2_dbg/storage/innobase/handler/ha_innodb.cc:4428
      #24 0x00005bd5b55b6cb3 in innobase_commit (thd=0x73a150000d58, commit_trx=false)at /test/12.2_dbg/storage/innobase/handler/ha_innodb.cc:4574
      #25 0x00005bd5b519b9bf in commit_one_phase_2 (thd=0x73a150000d58, all=false, trans=0x73a1500049b0, is_real_trans=true)at /test/12.2_dbg/sql/handler.cc:2247
      #26 0x00005bd5b519c0ec in ha_commit_one_phase (thd=0x73a150000d58, all=false)at /test/12.2_dbg/sql/handler.cc:2187
      #27 0x00005bd5b519a5ce in ha_commit_trans (thd=0x73a150000d58, all=false)at /test/12.2_dbg/sql/handler.cc:1979
      #28 0x00005bd5b4f66189 in trans_commit_stmt (thd=0x73a150000d58)at /test/12.2_dbg/sql/transaction.cc:498
      #29 0x00005bd5b4d697bb in mysql_execute_command (thd=0x73a150000d58, is_called_from_prepared_stmt=false) at /test/12.2_dbg/sql/sql_parse.cc:5943
      #30 0x00005bd5b4d58664 in mysql_parse (thd=0x73a150000d58, rawbuf=0x73a150019e80 "INSERT INTO t VALUES ('')", length=25, parser_state=0x73b8876fba10) at /test/12.2_dbg/sql/sql_parse.cc:7883
      #31 0x00005bd5b4d55a38 in dispatch_command (command=COM_QUERY, thd=0x73a150000d58, packet=0x73a15000b1f9 "INSERT INTO t VALUES ('')", packet_length=25, blocking=true) at /test/12.2_dbg/sql/sql_parse.cc:1878
      #32 0x00005bd5b4d59213 in do_command (thd=0x73a150000d58, blocking=true)at /test/12.2_dbg/sql/sql_parse.cc:1417
      #33 0x00005bd5b4f464b9 in do_handle_one_connection (connect=0x5bd5bf60b038, put_in_cache=true) at /test/12.2_dbg/sql/sql_connect.cc:1414
      #34 0x00005bd5b4f4625e in handle_one_connection (arg=0x5bd5bf53f3a8)at /test/12.2_dbg/sql/sql_connect.cc:1326
      #35 0x000073bc65a9caa4 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447
      #36 0x000073bc65b29c3c in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      

      Bug Detection Matrix

          Rel    o/d  Build   Commit                                    UniqueID observed             
      CS  10.6   dbg  080825  13f337ce1f295f4aac75db681e00c71f2bf8acaf  No bug found                  
      CS  10.6   opt  080825  13f337ce1f295f4aac75db681e00c71f2bf8acaf  No bug found                  
      CS  10.11  dbg  080825  c45a34b2fb10e4e8f768e7e5fe846e9592eb6ea8  No bug found                  
      CS  10.11  opt  080825  c45a34b2fb10e4e8f768e7e5fe846e9592eb6ea8  No bug found                  
      CS  11.4   dbg  080825  03b31c0bd99390c1984f19a19f22dd6e77b7692e  No bug found                  
      CS  11.4   opt  080825  03b31c0bd99390c1984f19a19f22dd6e77b7692e  No bug found                  
      CS  11.8   dbg  080825  1a446ccc48528e88a3cd6cd1d1ec9e7492d342ca  src != ((void*)0)|SIGABRT|my_casedn_utf8mb4|charset_info_st::casedn|charset_info_st::casedn_z|fts_add_token
      CS  11.8   opt  080825  1a446ccc48528e88a3cd6cd1d1ec9e7492d342ca  No bug found                  
      CS  12.0   dbg  080825  aab83aecdca15738d114cf5a2f223f1d12e4e6bd  src != ((void*)0)|SIGABRT|my_casedn_utf8mb4|charset_info_st::casedn|charset_info_st::casedn_z|fts_add_token
      CS  12.0   opt  080825  aab83aecdca15738d114cf5a2f223f1d12e4e6bd  No bug found                  
      CS  12.1   dbg  080825  033471a367b4c60b7262e64f43f46b02e95b9d74  src != ((void*)0)|SIGABRT|my_casedn_utf8mb4|charset_info_st::casedn|charset_info_st::casedn_z|fts_add_token
      CS  12.1   opt  080825  033471a367b4c60b7262e64f43f46b02e95b9d74  No bug found                  
      CS  12.2   dbg  080825  e02f4d7e311e214ea62ff2e59599849e229f4165  src != ((void*)0)|SIGABRT|my_casedn_utf8mb4|charset_info_st::casedn|charset_info_st::casedn_z|fts_add_token
      CS  12.2   opt  080825  e02f4d7e311e214ea62ff2e59599849e229f4165  No bug found                  
      ES  10.5   dbg  080825  70586522eacf09d04d49962072e14325a75d8155  No bug found                  
      ES  10.5   opt  080825  70586522eacf09d04d49962072e14325a75d8155  No bug found                  
      ES  10.6   dbg  080825  9b794f34b48fb7eee490b6da44edc0f33a947447  No bug found                  
      ES  10.6   opt  080825  9b794f34b48fb7eee490b6da44edc0f33a947447  No bug found                  
      ES  11.4   dbg  080825  a1c03ccd54b582e75506687ee19b273ca897f261  No bug found                  
      ES  11.4   opt  080825  a1c03ccd54b582e75506687ee19b273ca897f261  No bug found                  
      ES  11.8   dbg  080825  4cdf75ab6ba37d4e7e208690785e880ed3176f2f  src != ((void*)0)|SIGABRT|my_casedn_utf8mb4|charset_info_st::casedn|charset_info_st::casedn_z|fts_add_token
      ES  11.8   opt  080825  4cdf75ab6ba37d4e7e208690785e880ed3176f2f  No bug found                  
      MS  5.5    dbg  070123  bac287c315b1792e7ae33f91add6a60292f9bae8  No bug found                  
      MS  5.5    opt  070123  bac287c315b1792e7ae33f91add6a60292f9bae8  No bug found                  
      MS  5.6    dbg  070123  dab95781a1244104d6b87020ac2fc4d190ba2946  No bug found                  
      MS  5.6    opt  070123  dab95781a1244104d6b87020ac2fc4d190ba2946  No bug found                  
      MS  5.7    dbg  070525  f7680e98b6bbe3500399fbad465d08a6b75d7a5c  No bug found                  
      MS  5.7    opt  070525  f7680e98b6bbe3500399fbad465d08a6b75d7a5c  No bug found                  
      MS  8.0    dbg  060224  49ef33f7edadef3ae04665e73d1babd40179a4f1  No bug found                  
      MS  8.0    opt  060224  49ef33f7edadef3ae04665e73d1babd40179a4f1  No bug found                  
      MS  9.1    dbg  211024  61a3a1d8ef15512396b4c2af46e922a19bf2b174  No bug found                  
      MS  9.1    opt  211024  61a3a1d8ef15512396b4c2af46e922a19bf2b174  No bug found                  
      

      Attachments

        Activity

          People

            thiru Thirunarayanan Balathandayuthapani
            ramesh Ramesh Sivaraman
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

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