Bug #89465 x.connection_local_scope crash: (host_arg != nullptr), function set_host_ptr
Submitted: 30 Jan 2018 7:37 Modified: 12 Apr 2018 5:41
Reporter: Laurynas Biveinis (OCA) Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Document Store: X Plugin Severity:S3 (Non-critical)
Version:8.0.4 OS:Any
Assigned to: CPU Architecture:Any

[30 Jan 2018 7:37] Laurynas Biveinis
Description:
This is on a debug + ASan build, I guess ASan is not required.

$ ./mtr --debug-server --suite=x connection_local_scope
...
x.connection_local_scope                 [ fail ]
        Test ended at 2018-01-30 09:33:43

CURRENT_TEST: x.connection_local_scope
mysqltest: In included file /Users/laurynas/percona/mysql-8.0.4/rapid/plugin/x/tests/mtr/include/connection_local_scope.inc at line 32:
included from /Users/laurynas/percona/mysql-8.0.4/rapid/plugin/x/tests/mtr/t/connection_local_scope.test at line 26:
At line 31: command "$execute_command -uuser1 --password='p1'
 -h$ip%$interface -e "SELECT USER()" 2>&1" failed

Output from before failure:
in main, line 0:ERROR: MySQL server has gone away (code 2006)
not ok
...
Assertion failed: (host_arg != nullptr), function set_host_ptr, file /Users/laurynas/percona/mysql-8.0.4/sql/auth/sql_security_ctx.h, line 565.
07:33:43 UTC - mysqld got signal 6 ;
...
0   mysqld-debug                        0x0000000108d7445e my_print_stacktrace + 238
1   mysqld-debug                        0x0000000107b8bc9f handle_fatal_signal + 1455
2   libsystem_platform.dylib            0x00007fffdf5efb3a _sigtramp + 26
3   ???                                 0x0000000000000000 0x0 + 0
4   libsystem_c.dylib                   0x00007fffdf474420 abort + 129
5   libsystem_c.dylib                   0x00007fffdf43b893 basename_r + 0
6   mysqld-debug                        0x0000000106c4bb14 Security_context::set_host_ptr(char const*, unsigned long) + 452
7   mysqld-debug                        0x0000000106c4af1c acl_getroot(THD*, Security_context*, char*, char*, char*, char const*) + 428
8   mysqld-debug                        0x0000000106d16b85 security_context_lookup + 165
9   mysqlx.so                           0x0000000122f3744c xpl::Sql_data_context::switch_to_user(char const*, char const*, char const*, char const*) + 1052
10  mysqlx.so                           0x0000000122f37920 xpl::Sql_data_context::authenticate(char const*, char const*, char const*, char const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, ngs::Authentication_interface const&, bool) + 464
11  mysqlx.so                           0x0000000122ee882d xpl::Account_verification_handler::authenticate(ngs::Authentication_interface const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const + 1837
12  mysqlx.so                           0x0000000122eb484f xpl::Sasl_challenge_response_auth<(ngs::Account_verification_interface::Account_type)4, xpl::Cache_based_verification>::handle_continue(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) + 367
13  mysqlx.so                           0x0000000122f74919 ngs::Session::handle_auth_message(ngs::Request&) + 1001
14  mysqlx.so                           0x0000000122f66005 ngs::Client::handle_message(ngs::Request&) + 453
15  mysqlx.so                           0x0000000122f6c758 ngs::Client::run(bool) + 536
16  mysqlx.so                           0x0000000122f7e902 ngs::Scheduler_dynamic::worker() + 738
17  mysqlx.so                           0x0000000122f7e619 ngs::Scheduler_dynamic::worker_proxy(void*) + 9
18  mysqld-debug                        0x0000000109764c5b pfs_spawn_thread(void*) + 539
19  libsystem_pthread.dylib             0x00007fffdf5f993b _pthread_body + 180
20  libsystem_pthread.dylib             0x00007fffdf5f9887 _pthread_body + 0
21  libsystem_pthread.dylib             0x00007fffdf5f908d thread_start + 13

How to repeat:
See above
[30 Jan 2018 8:55] MySQL Verification Team
Thank you for the bug report.
Creating var directory '/Users/miguel/Downloads/mysql-8.0.4-rc/mysql-test/var'...
Installing system database...
Using parallel: 1

==============================================================================

TEST                                      RESULT   TIME (ms) or COMMENT
--------------------------------------------------------------------------

worker[1] Using MTR_BUILD_THREAD 300, with reserved ports 13000..13019
x.connection_local_scope                 [ fail ]
        Test ended at 2018-01-30 06:52:26

0   mysqld                              0x0000000106938cce my_print_stacktrace + 238
1   mysqld                              0x000000010575089f handle_fatal_signal + 1455
2   libsystem_platform.dylib            0x00007fff6cc19f5a _sigtramp + 26
3   ???                                 0x000070000214fcd8 0x0 + 123145337240792
4   libsystem_c.dylib                   0x00007fff6ca44312 abort + 127
5   libsystem_c.dylib                   0x00007fff6ca0c368 basename_r + 0
6   mysqld                              0x0000000104811524 Security_context::set_host_ptr(char const*, unsigned long) + 452
7   mysqld                              0x000000010481092c acl_getroot(THD*, Security_context*, char*, char*, char*, char const*) + 428
8   mysqld                              0x00000001048dc595 security_context_lookup + 165
9   mysqlx.so                           0x0000000120997fbc xpl::Sql_data_context::switch_to_user(char const*, char const*, char const*, char const*) + 1052
10  mysqlx.so                           0x0000000120998490 xpl::Sql_data_context::authenticate(char const*, char const*, char const*, char const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, ngs::Authentication_interface const&, bool) + 464
11  mysqlx.so                           0x000000012094939d xpl::Account_verification_handler::authenticate(ngs::Authentication_interface const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const + 1837
12  mysqlx.so                           0x00000001209153bf xpl::Sasl_challenge_response_auth<(ngs::Account_verification_interface::Account_type)4, xpl::Cache_based_verification>::handle_continue(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) + 367
13  mysqlx.so                           0x00000001209d5489 ngs::Session::handle_auth_message(ngs::Request&) + 1001
14  mysqlx.so                           0x00000001209c6b75 ngs::Client::handle_message(ngs::Request&) + 453
15  mysqlx.so                           0x00000001209cd2c8 ngs::Client::run(bool) + 536
16  mysqlx.so                           0x00000001209df472 ngs::Scheduler_dynamic::worker() + 738
17  mysqlx.so                           0x00000001209df189 ngs::Scheduler_dynamic::worker_proxy(void*) + 9
18  mysqld                              0x000000010733766b pfs_spawn_thread(void*) + 539
19  libsystem_pthread.dylib             0x00007fff6cc236c1 _pthread_body + 340
20  libsystem_pthread.dylib             0x00007fff6cc2356d _pthread_body + 0
21  libsystem_pthread.dylib             0x00007fff6cc22c5d thread_start + 13
[12 Apr 2018 5:41] Erlend Dahl
Duplicate of

Bug#88925 x.connection_local_scope fails