[MDEV-24778] Assertion `dstlen >= srclen * cs->casedn_multiply' failed in my_casedn_ujis / innobase_fts_casedn_str Created: 2021-02-03  Updated: 2023-04-27

Status: Open
Project: MariaDB Server
Component/s: Character Sets, Full-text Search, Storage Engine - InnoDB
Affects Version/s: 10.3, 10.4, 10.5, 10.6
Fix Version/s: 10.4, 10.5

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Marko Mäkelä
Resolution: Unresolved Votes: 0
Labels: None


 Description   

I am not sure to which component the root cause belongs to, but since I can only reproduce it with InnoDB fulltext, it goes to InnoDB first.

--source include/have_innodb.inc
 
CREATE TABLE t1 (
  pk INT,
  a CHAR(255),
  PRIMARY KEY(pk),
  FULLTEXT(a)
) ENGINE=InnoDB CHARACTER SET ujis;
 
INSERT INTO t1 VALUES (1,REPEAT(_UCS2 0x6FB6, 68));
ALTER TABLE t1 FORCE;
 
# Cleanup
DROP TABLE t1;

10.3 59eda73e

mysqld: /data/src/10.3/strings/ctype-ujis.c:67214: my_casedn_ujis: Assertion `dstlen >= srclen * cs->casedn_multiply' failed.
210203 16:54:46 [ERROR] mysqld got signal 6 ;
 
#7  0x00007f1519b98f36 in __GI___assert_fail (assertion=0x56107a0629c0 "dstlen >= srclen * cs->casedn_multiply", file=0x56107a062998 "/data/src/10.3/strings/ctype-ujis.c", line=67214, function=0x56107a062bb0 <__PRETTY_FUNCTION__.11952> "my_casedn_ujis") at assert.c:101
#8  0x0000561079b61927 in my_casedn_ujis (cs=0x56107a56a700 <my_charset_ujis_japanese_ci>, src=0x7f14bff98910 "\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310"..., srclen=204, dst=0x7f14eaffc990 "", dstlen=337) at /data/src/10.3/strings/ctype-ujis.c:67214
#9  0x00005610794c8c4a in innobase_fts_casedn_str (cs=0x56107a56a700 <my_charset_ujis_japanese_ci>, src=0x7f14bff98910 "\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310\371\217\310"..., src_len=204, dst=0x7f14eaffc990 "", dst_len=337) at /data/src/10.3/storage/innobase/handler/ha_innodb.cc:6695
#10 0x00005610796190a1 in row_merge_fts_doc_tokenize (sort_buf=0x7f14bc059148, doc_id=2, doc=0x7f14eaffcbf0, merge_file=0x7f14bc059178, opt_doc_id_size=1, t_ctx=0x7f14eaffcca0) at /data/src/10.3/storage/innobase/row/row0ftsort.cc:560
#11 0x000056107961a161 in fts_parallel_tokenization (arg=0x7f14bc059140) at /data/src/10.3/storage/innobase/row/row0ftsort.cc:854
#12 0x00007f151a0a8609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#13 0x00007f1519c84293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Reproducible on 10.3-10.6.
Could not reproduce on 10.2.
No obvious problem on a non-debug build.

The failure started happening in 10.3 after this commit:

commit 4e75bfcb21469c9efbbc55d2ff3978e11475d40d
Author: Marko Mäkelä
Date:   Fri Jan 18 12:39:19 2019 +0200
 
    MDEV-18152 Assertion 'num_fts_index <= 1' failed


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