[MDEV-32254] Server crashes when adding records to table after setting redirect_url with empty variable Created: 2023-09-26  Updated: 2023-10-03  Resolved: 2023-10-03

Status: Closed
Project: MariaDB Server
Component/s: Server
Affects Version/s: 11.3
Fix Version/s: 11.3.1

Type: Bug Priority: Critical
Reporter: Ramesh Sivaraman Assignee: Yuchen Pei
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Problem/Incident
is caused by MDEV-15935 Connection Redirection Mechanism in M... Closed

 Description   

SET GLOBAL redirect_url=@empty_value;
CREATE TABLE t (c1 INT) ENGINE=INNODB;
INSERT INTO t VALUES (1),(1);

Leads to

11.3.0 b09e99ff759f66c29e3f67911ef4c7c0591c8a4e (Optimized)

Core was generated by `/test/mtest/MD180923-mariadb-11.3.0-linux-x86_64-opt/bin/mariadbd --no-defaults'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  __strlen_avx2 () at ../sysdeps/x86_64/multiarch/strlen-avx2.S:65
[Current thread is 1 (Thread 0x14aef61f0700 (LWP 210291))]
(gdb) bt
#0  __strlen_avx2 () at ../sysdeps/x86_64/multiarch/strlen-avx2.S:65
#1  0x000055d21b311921 in my_strdup (key=0, from=0x0, my_flags=my_flags@entry=65552) at /test/mtest/11.3_opt/mysys/my_malloc.c:236
#2  0x000055d21ac1a0a8 in plugin_thdvar_init (thd=thd@entry=0x14ae94002f28) at /test/mtest/11.3_opt/sql/sql_plugin.cc:3271
#3  0x000055d21aba582b in THD::init (this=this@entry=0x14ae94002f28) at /test/mtest/11.3_opt/sql/sql_class.cc:1229
#4  0x000055d21abab87c in THD::THD (this=0x14ae94002f28, id=<optimized out>, is_wsrep_applier=<optimized out>) at /test/mtest/11.3_opt/sql/sql_class.cc:851
#5  0x000055d21ababd02 in create_background_thd () at /test/mtest/11.3_opt/sql/sql_list.h:680
#6  0x000055d21b0edfa4 in innobase_create_background_thd (name=name@entry=0x55d21b69e430 "InnoDB statistics") at /test/mtest/11.3_opt/storage/innobase/handler/ha_innodb.cc:1713
#7  0x000055d21b25634c in dict_stats_func () at /test/mtest/11.3_opt/storage/innobase/dict/dict0stats_bg.cc:374
#8  0x000055d21b2b336d in tpool::thread_pool_generic::timer_generic::run (this=0x55d21d0000e0) at /test/mtest/11.3_opt/tpool/tpool_generic.cc:343
#9  tpool::thread_pool_generic::timer_generic::execute (arg=0x55d21d0000e0) at /test/mtest/11.3_opt/tpool/tpool_generic.cc:363
#10 0x000055d21b2b400a in tpool::task::execute (this=0x55d21d000120) at /test/mtest/11.3_opt/tpool/task.cc:37
#11 tpool::task::execute (this=0x55d21d000120) at /test/mtest/11.3_opt/tpool/task.cc:27
#12 0x000055d21b2b1a97 in tpool::thread_pool_generic::worker_main (this=0x55d21cf67330, thread_var=0x55d21cf68460) at /test/mtest/11.3_opt/tpool/tpool_generic.cc:580
#13 0x000014af31279de4 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#14 0x000014af31393609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#15 0x000014af30f7f133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95



 Comments   
Comment by Yuchen Pei [ 2023-09-27 ]

Hi serg, ptal thanks:

commit 76e20f00772148fa928c6c6e42401f38ca89abf0 (HEAD -> bb-11.3-mdev-32254)
Author: Yuchen Pei <ycp@mariadb.com>
Date:   Wed Sep 27 13:08:34 2023 +1000
 
    MDEV-32254 Make NULL an illegal value for redirect_url

Comment by Sergei Golubchik [ 2023-09-30 ]

76e20f00772148fa928c6c6e42401f38ca89abf0 is ok to push

Comment by Yuchen Pei [ 2023-10-03 ]

Thanks for the review. Pushed 76e20f00772148fa928c6c6e42401f38ca89abf0 to preview-11.3-preview

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