Bug #58140 Dbug_violation_helper::~Dbug_violation_helper(): Assertion `!_entered' failed.
Submitted: 11 Nov 2010 15:36 Modified: 19 Apr 2011 16:16
Reporter: Shane Bester (Platinum Quality Contributor) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: General Severity:S1 (Critical)
Version:5.1.54, 5.5.8 OS:Any
Assigned to: CPU Architecture:Any
Tags: PROCEDURE ANALYSE, regression

[11 Nov 2010 15:36] Shane Bester
Description:
Version: '5.1.54-valgrind-max-debug'  socket: '/tmp/mysql.sock'  port: 3306  Source distribution
[New Thread 0x7ffff40a8710 (LWP 21231)]
mysqld: ../include/my_dbug.h:39: Dbug_violation_helper::~Dbug_violation_helper(): Assertion `!_entered' failed.

Program received signal SIGABRT, Aborted.
[Switching to Thread 0x7ffff40a8710 (LWP 21231)]
0x00000030e14329a5 in raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
64        return INLINE_SYSCALL (tgkill, 3, pid, selftid, sig);
(gdb) bt
#0  in raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1  in abort () at abort.c:92
#2  in __assert_fail at assert.c:81
#3  in Dbug_violation_helper::~Dbug_violation_helper at ../include/my_dbug.h:39
#4  in test_if_number at sql_analyse.cc:265
#5  in field_str::add at sql_analyse.cc:328
#6  in analyse::send_row at sql_analyse.cc:679
#7  in end_send at sql_select.cc:12324
#8  in evaluate_join_record at sql_select.cc:11546
#9  in sub_select at sql_select.cc:11426
#10 in do_select at sql_select.cc:11178
#11 in JOIN::exec at sql_select.cc:2334
#12 in mysql_select at sql_select.cc:2544
#13 in handle_select at sql_select.cc:269
#14 in execute_sqlcom_select at sql_parse.cc:5144
#15 in mysql_execute_command at sql_parse.cc:2293
#16 in mysql_parse at sql_parse.cc:6068
#17 in dispatch_command at sql_parse.cc:1261
#18 in do_command at sql_parse.cc:889
#19 in handle_one_connection at sql_connect.cc:1136
#20 in start_thread at pthread_create.c:301
#21  in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:115

5.5.8 asserts slightly different and says this:

Version: '5.5.8-rc-valgrind-max-debug'  socket: '/tmp/mysql.sock'  port: 3306  Source distribution
[New Thread 0x7ffff406e710 (LWP 21329)]
/home/sbester/mysql/5.5/mysql-5.5.8-rc-linux-x86_64/bin/mysqld: debugger aborting because missing DBUG_RETURN or DBUG_VOID_RETURN macro in function "test_if_number"

5.0.92 did not crash.

How to repeat:
drop table if exists `t1`;
create table `t1` (`a` varchar(2) charset utf8 not null)engine=myisam;
insert into `t1` values ('e'),('e'),('e-');
select * from t1 procedure analyse();
[11 Nov 2010 15:56] Valeriy Kravchuk
Verified on 32-bit Ubuntu 10.04:

openxs@ubuntu:/home2/openxs/dbs/5.1$ cd /home/openxs/dbs/5.5/
openxs@ubuntu:~/dbs/5.5$ bin/mysql -uroot test
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.1.54-valgrind-max-debug Source distribution

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> exit
Bye
openxs@ubuntu:~/dbs/5.5$ bin/mysql --default-auth=auth_test_plugin -uroot test
bin/mysql: unknown variable 'default-auth=auth_test_plugin'
openxs@ubuntu:~/dbs/5.5$ bin/mysql --plugin-dir=/tmp -uroot testbin/mysql: unknown variable 'plugin-dir=/tmp'
openxs@ubuntu:~/dbs/5.5$ bin/mysql --version
bin/mysql  Ver 14.14 Distrib 5.5.7-rc, for Linux (i686) using readline 5.1
openxs@ubuntu:~/dbs/5.5$ cd ../5.1
bash: cd: ../5.1: No such file or directory
openxs@ubuntu:~/dbs/5.5$ cd -
/home2/openxs/dbs/5.1
openxs@ubuntu:/home2/openxs/dbs/5.1$ bin/mysql -uroot test
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.1.54-valgrind-max-debug Source distribution

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> drop table if exists `t1`;
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> create table `t1` (`a` varchar(2) charset utf8 not null)engine=myisam;
Query OK, 0 rows affected (0.02 sec)

mysql> insert into `t1` values ('e'),('e'),('e-');
Query OK, 3 rows affected (0.00 sec)
Records: 3  Duplicates: 0  Warnings: 0

mysql> select * from t1 procedure analyse();
ERROR 2013 (HY000): Lost connection to MySQL server during query
mysql> 101111 17:54:39 mysqld_safe Number of processes running now: 0
101111 17:54:39 mysqld_safe mysqld restarted

mysql> exit
Bye
openxs@ubuntu:/home2/openxs/dbs/5.1$ tail -80 var/ubuntu.err
101111 11:35:05  InnoDB: Shutdown completed; log sequence number 0 84687012
101111 11:35:05 [Note] /home2/openxs/dbs/5.1/libexec/mysqld: Shutdown complete

101111 11:35:05 mysqld_safe mysqld from pid file /home2/openxs/dbs/5.1/var/ubuntu.pid ended
101111 11:35:19 mysqld_safe Starting mysqld daemon with databases from /home2/openxs/dbs/5.1/var
101111 11:35:19 [Note] Plugin 'FEDERATED' is disabled.
101111 11:35:19  InnoDB: Started; log sequence number 0 84687012
101111 11:35:19 [Note] Event Scheduler: Loaded 0 events
101111 11:35:19 [Note] /home2/openxs/dbs/5.1/libexec/mysqld: ready for connections.
Version: '5.1.54-valgrind-max-debug'  socket: '/tmp/mysql.sock'  port: 3306  Source distribution
mysqld: ../include/my_dbug.h:29: Dbug_violation_helper::~Dbug_violation_helper(): Assertion `!_entered' failed.
101111 17:54:39 - mysqld got signal 6 ;
...
[19 Apr 2011 16:16] Paul DuBois
Noted in 5.1.57, 5.5.11, 5.6.3 changelogs.

The code for PROCEDURE ANALYSE() had a missing DBUG_RETURN statement, 
which could cause a server crash in debug builds.

CHANGESET - http://lists.mysql.com/commits/132945