Signal 11 happened when I use 'SET PERSIST ONLY character ~'

During the set persist only syntax execution, the DB is terminated with Signal 11 error as shown below.
What is the problem with that bug?

#!/bin/bash

mysql -uawx -p -e "SET PERSIST_ONLY character_set_client = 'utf8mb3'"
sleep 10
mysql -uawx -p -e "SET PERSIST_ONLY character_set_connection = 'utf8mb3'"
sleep 10
mysql -uawx -p -e "SET PERSIST_ONLY character_set_client = 'utf8mb4'"
mysql -uawx -p -e "SET PERSIST_ONLY character_set_connection = 'utf8mb4'"
2023-12-21T04:51:46Z UTC - mysqld got signal 11 ;
Most likely, you have hit a bug, but this error can also be caused by malfunctioning hardware.
BuildID[sha1]=72ec6f0cba041274a205d4d298600c482628efa2
Server Version: 8.0.34-26 Percona Server (GPL), Release 26, Revision 0fe62c85

Thread pointer: 0x7fbf3c042110
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 7fbf402f0c10 thread_stack 0x100000
/usr/sbin/mysqld(my_print_stacktrace(unsigned char const*, unsigned long)+0x41) [0x21944d1]
/usr/sbin/mysqld(print_fatal_signal(int)+0x2c2) [0x121b3b2]
/usr/sbin/mysqld(handle_fatal_signal+0xd5) [0x121b595]
/lib64/libpthread.so.0(+0x12ce0) [0x7fc00544fce0]
/usr/sbin/mysqld() [0x119adc4]
/usr/sbin/mysqld() [0xf8fe24]
/usr/sbin/mysqld(std::_Function_handler<void (System_variable_tracker const&, sys_var*), System_variable_tracker::access_system_variable<bool>(THD*, std::function<bool (System_variable_tracker const&, sys_var*)>, Suppress_not_found_error, Force_sensitive_system_variable_access, Is_already_locked, Is_single_thread) const::{lambda(System_variable_tracker const&, sys_var*)#1}>::_M_invoke(std::_Any_data const&, System_variable_tracker const&, sys_var*&&)+0x39) [0xe15019]
/usr/sbin/mysqld(System_variable_tracker::access_system_variable(THD*, std::function<void (System_variable_tracker const&, sys_var*)>, Suppress_not_found_error, Force_sensitive_system_variable_access, Is_already_locked, Is_single_thread) const+0x95) [0xfbf6f5]
/usr/sbin/mysqld(std::optional<bool> System_variable_tracker::access_system_variable<bool>(THD*, std::function<bool (System_variable_tracker const&, sys_var*)>, Suppress_not_found_error, Force_sensitive_system_variable_access, Is_already_locked, Is_single_thread) const+0x12d) [0xf809ad]
/usr/sbin/mysqld(Persisted_variables_cache::set_variable(THD*, set_var*)+0xa1) [0xf80b41]
/usr/sbin/mysqld(sql_set_variables(THD*, List<set_var_base>*, bool)+0x130) [0xfbd3b0]
/usr/sbin/mysqld(mysql_execute_command(THD*, bool)+0x24f7) [0x10944e7]
/usr/sbin/mysqld(dispatch_sql_command(THD*, Parser_state*, bool)+0x5cb) [0x109670b]
/usr/sbin/mysqld(dispatch_command(THD*, COM_DATA const*, enum_server_command)+0x2487) [0x10991b7]
/usr/sbin/mysqld(do_command(THD*)+0x1d6) [0x1099d46]
/usr/sbin/mysqld() [0x120b178]
/usr/sbin/mysqld() [0x262d2b4]
/lib64/libpthread.so.0(+0x81cf) [0x7fc0054451cf]
/lib64/libc.so.6(clone+0x43) [0x7fc0037ead83]

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (7fbf3c0336c0): SET PERSIST_ONLY character_set_connection = 'utf8mb3'
Connection ID (thread ID): 9
Status: NOT_KILLED

Please help us make Percona Server better by reporting any
bugs at https://bugs.percona.com/

You may download the Percona Server operations manual by visiting
http://www.percona.com/software/percona-server/. You may find information
in the manual which will help you identify the cause of the crash.

And the value does not normally enter mysqld-auto.cnf.

cat mysqld-auto.cnf
{"Version": 2, "mysql_dynamic_variables": {"character_set_client": {"Value": "", "Metadata": {"Host": "localhost", "User": "root", "Timestamp": 1703134901191749}}, "character_set_connection": {"Value": "", "Metadata": {"Host": "localhost", "User": "awx", "Timestamp": 1703134814346602}}}}

This is obviously a bug, easy to reproduce in my test env. I did found a workaround though, almost by accident:

chgrp mysql /etc/mysql
chmod 775 /etc/mysql

No clue exactly why this is needed since the mysqld-auto.cnf file is not stored there. I’ll try to find the issue in the code.

Well, no so sure about the workaround, I am unable to revert it. At the same time, some is strange with the persisted variables, you (and I) have:

"Value": ""

I tried twice to set:

mysql> SET PERSIST_ONLY character_set_filesystem = "latin1";
ERROR 2013 (HY000): Lost connection to MySQL server during query
...
mysql> SET PERSIST_ONLY character_set_filesystem = "latin1";
No connection. Trying to reconnect...
Connection id:    8
Current database: *** NONE ***

Query OK, 0 rows affected (0,01 sec)

It worked the 2nd without any change, just waited a bit for mysql to restart. However:

{
  "Version": 2,
  "mysql_dynamic_variables": {
    "log_slow_verbosity": {
      "Value": "microtime,query_plan,innodb",
      "Metadata": {
        "Host": "localhost",
        "User": "root",
        "Timestamp": 1703180007162173
      }
    },
    "character_set_client": {
      "Value": "",
      "Metadata": {
        "Host": "localhost",
        "User": "root",
        "Timestamp": 1703179011200801
      }
    },
    "character_set_filesystem": {
      "Value": "",
      "Metadata": {
        "Host": "localhost",
        "User": "root",
        "Timestamp": 1703180162252645
      }
}

Why are the Value fields empty? Could well be related.

@DongyeongKim
Please open a bug report at https://jira.percona.com/ with your example script and the output. I reproduced it as well. I will submit confirmation when I see your bug.

Seems to be an issue with PERSIST_ONLY:

$ ./use -e "SET PERSIST_ONLY character_set_client = 'utf8mb4'"
$ cat data/mysqld-auto.cnf
{"Version": 2, "mysql_dynamic_variables": {"character_set_client": {"Value": "", "Metadata": {"Host": "localhost", "User": "msandbox", "Timestamp": 1703181465104374}}}}

$ rm data/mysqld-auto.cnf

$ ./use -e "SET PERSIST character_set_client = 'utf8mb4'"
$ cat data/mysqld-auto.cnf
{"Version": 2, "mysql_dynamic_variables": {"character_set_client": {"Value": "utf8mb4", "Metadata": {"Host": "localhost", "User": "msandbox", "Timestamp": 1703181481544031}}}}

@DongyeongKim I changed your script to PERSIST and it worked fine. Still a bug though for PERSIST_ONLY