stoneatom / stonedb

StoneDB is an Open-Source MySQL HTAP and MySQL-Native DataBase for OLTP, Real-Time Analytics, a counterpart of MySQLHeatWave. (https://stonedb.io)
https://stonedb.io/
GNU General Public License v2.0
865 stars 141 forks source link

feat: `void st_select_lex_unit::assert_not_fully_clean(): Assertion `cleaned < UC_CLEAN'` failed. #1129

Open RingsC opened 1 year ago

RingsC commented 1 year ago

Have you read the Contributing Guidelines on issues?

Please confirm if bug report does NOT exists already ?

Describe the problem

To run MTR with debug mode.

./mysql-test-run.pl  --suite=tianmu --nowarnings --force --nocheck-testcases --retry=0 --parallel=10
afe_process[225299]: Child process: 225300, killed by signal: 6
----------SERVER LOG END-------------

 - the logfile can be found in '/home/xxx/workshop/bin/mysql-test/var/log/tianmu.issue515/issue515.log'
[ 97%] tianmu.insert_into_select                w9 [ pass ]  43307
[ 98%] tianmu.issue947                          w8 [ fail ]
        Test ended at 2022-12-15 14:17:35

CURRENT_TEST: tianmu.issue947
mysqltest: At line 30: query 'SELECT * FROM test1 WHERE a NOT IN ( SELECT b FROM test2 WHERE b NOT IN ( SELECT a FROM test1))' failed: 2013: Lost connection to MySQL server during query

The result from queries just before the failure was:
USE test;
DROP TABLE IF EXISTS test1,test2;
CREATE TABLE test1 (a int) ENGINE=TIANMU;
CREATE TABLE test2 (b int, c int) ENGINE=TIANMU;
INSERT INTO test1 VALUES (1), (2), (3), (4), (null);
INSERT INTO test2 VALUES (1, 100), (1, 101), (2, 200),
(3, 300), (3, 301), (3, 302), (null, null);
SELECT * FROM test1 WHERE a NOT IN (SELECT b FROM test2 WHERE b = 7);
a
1
2
3
4
NULL
SELECT * FROM test1 WHERE a NOT IN ( SELECT b FROM test2 WHERE b=1);
a
2
3
4
safe_process[228150]: Child process: 228151, exit: 1

Server [mysqld.1 - pid: 227219, winpid: 227219, exit: 256] failed during test run
Server log from this test:
----------SERVER LOG START-----------
mysqld: /home/xxx/workshop/stonedb-dev/sql/sql_union.cc:959: void st_select_lex_unit::assert_not_fully_clean(): Assertion `cleaned < UC_CLEAN' failed.
06:16:52 UTC - mysqld got signal 6 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
Attempting to collect some information that could help diagnose the problem.
As this is a crash and something is definitely wrong, the information
collection process might fail.

key_buffer_size=1048576
read_buffer_size=131072
max_used_connections=1
max_threads=151
thread_count=1
connection_count=1
It is possible that mysqld could use up to 
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 61094 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x7fb638000e10
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 = 7fb8d8135618 thread_stack 0x40000
/home/xxx/workshop/bin/bin/mysqld(my_print_stacktrace+0x4b)[0x55925a2cb1f2]
/home/xxx/workshop/bin/bin/mysqld(handle_fatal_signal+0x3f7)[0x5592597b7624]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x14420)[0x7fb8f0b1c420]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0xcb)[0x7fb8f080800b]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x12b)[0x7fb8f07e7859]
/lib/x86_64-linux-gnu/libc.so.6(+0x22729)[0x7fb8f07e7729]
/lib/x86_64-linux-gnu/libc.so.6(+0x33fd6)[0x7fb8f07f8fd6]
/home/xxx/workshop/bin/bin/mysqld(_ZN18st_select_lex_unit22assert_not_fully_cleanEv+0x3e)[0x55925a011240]
/home/xxx/workshop/bin/bin/mysqld(_ZN18st_select_lex_unit22assert_not_fully_cleanEv+0x8e)[0x55925a011290]
/home/xxx/workshop/bin/bin/mysqld(_ZN18st_select_lex_unit22assert_not_fully_cleanEv+0x8e)[0x55925a011290]
/home/xxx/workshop/bin/bin/mysqld(_Z21mysql_execute_commandP3THDb+0x7586)[0x559259f55f1b]
/home/xxx/workshop/bin/bin/mysqld(_Z11mysql_parseP3THDP12Parser_state+0x648)[0x559259f578f0]
/home/xxx/workshop/bin/bin/mysqld(_Z16dispatch_commandP3THDPK8COM_DATA19enum_server_command+0xc48)[0x559259f4c43f]
/home/xxx/workshop/bin/bin/mysqld(_Z10do_commandP3THD+0x522)[0x559259f4b2b6]
/home/xxx/workshop/bin/bin/mysqld(handle_connection+0x1f0)[0x55925a093bd8]
/home/xxxx/workshop/bin/bin/mysqld(pfs_spawn_thread+0x174)[0x55925a7dd3bb]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x8609)[0x7fb8f0b10609]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x43)[0x7fb8f08e4133]

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (7fb63803acf0): SELECT * FROM test1 WHERE a NOT IN ( SELECT b FROM test2 WHERE b NOT IN ( SELECT a FROM test1))
Connection ID (thread ID): 12
Status: NOT_KILLED

The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.
Writing a core file
safe_process[227219]: Child process: 227220, killed by signal: 6
----------SERVER LOG END-------------

Expected behavior

without assertion failed.

How To Reproduce

See the message above.

Environment

Ubuntu

Are you interested in submitting a PR to solve the problem?

isredstar commented 1 year ago

ACK