Bug #52165 Assertion failed: file .\dtoa.c, line 465
Submitted: 18 Mar 2010 7:28 Modified: 12 May 2010 1:22
Reporter: Shane Bester (Platinum Quality Contributor) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Data Types Severity:S1 (Critical)
Version:5.6.99-m4-debug, 5.5.4-m3] OS:Any
Assigned to: Alexey Kopytov CPU Architecture:Any
Tags: assertion, regression

[18 Mar 2010 7:28] Shane Bester
Description:
Version: '5.6.99-m4-debug'  socket: ''  port: 3306  Source distribution
Assertion failed: str != ((void *)0) && end != ((void *)0) && *end != ((void *)0) && error != ((void *)0), file .\dtoa.c, line 465

mysqld.exe!my_sigabrt_handler()[my_thr_init.c:519]
mysqld.exe!raise()[winsig.c:590]
mysqld.exe!abort()[abort.c:71]
mysqld.exe!_wassert()[assert.c:212]
mysqld.exe!my_strtod()[dtoa.c:465]
mysqld.exe!my_strntod_8bit()[ctype-simple.c:830]
mysqld.exe!Item_func_numhybrid::val_real()[item_func.cc:804]
mysqld.exe!Arg_comparator::compare_real()[item_cmpfunc.cc:1353]
mysqld.exe!Arg_comparator::compare()[item_cmpfunc.h:84]
mysqld.exe!Item_func_eq::val_int()[item_cmpfunc.cc:1859]
mysqld.exe!evaluate_join_record()[sql_select.cc:11522]
mysqld.exe!sub_select()[sql_select.cc:11473]
mysqld.exe!do_select()[sql_select.cc:11225]
mysqld.exe!JOIN::exec()[sql_select.cc:2311]
mysqld.exe!mysql_select()[sql_select.cc:2508]
mysqld.exe!handle_select()[sql_select.cc:271]
mysqld.exe!execute_sqlcom_select()[sql_parse.cc:4703]
mysqld.exe!mysql_execute_command()[sql_parse.cc:2191]
mysqld.exe!mysql_parse()[sql_parse.cc:5735]
mysqld.exe!dispatch_command()[sql_parse.cc:1024]
mysqld.exe!do_command()[sql_parse.cc:710]
mysqld.exe!do_handle_one_connection()[sql_connect.cc:1174]
mysqld.exe!handle_one_connection()[sql_connect.cc:1113]
mysqld.exe!pfs_spawn_thread()[pfs.cc:1011]
mysqld.exe!pthread_start()[my_winthread.c:61]
mysqld.exe!_callthreadstartex()[threadex.c:348]
mysqld.exe!_threadstartex()[threadex.c:331]

How to repeat:
#on debug build run:

set sql_mode='';
drop table if exists `t1`;
create table `t1`(`a` set('a') not null,`b` int)engine=myisam;
insert into `t1` values (),();
select coalesce(`t1`.`a`)=coalesce(`t1`.`b`) from `t1`;
[18 Mar 2010 8:27] Valeriy Kravchuk
Verified just as described with recent mysql-next-mr on Ubuntu:

...
Version: '5.6.99-m4-debug'  socket: '/tmp/mysql.sock'  port: 3306  Source distribution
mysqld: dtoa.c:465: my_strtod: Assertion `str != ((void *)0) && end != ((void *)0) && *end != ((void *)0) && error != ((void *)0)' failed.
100318 10:26:02 - 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.
We will try our best to scrape up some info that will hopefully help diagnose
the problem, but since we have already crashed, something is definitely wrong
and this may fail.

key_buffer_size=8388608
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 = 337841 K
bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

thd: 0x93ec1a0
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 = 0xa88603b0 thread_stack 0x30000
/home2/openxs/dbs/next-mr/libexec/mysqld(my_print_stacktrace+0x26)[0x877fd41]
/home2/openxs/dbs/next-mr/libexec/mysqld(handle_segfault+0x2ee)[0x82c7452]
[0xb77a5420]
/lib/tls/i686/cmov/libc.so.6(abort+0x101)[0xb75e8a01]
/lib/tls/i686/cmov/libc.so.6(__assert_fail+0xee)[0xb75e010e]
/home2/openxs/dbs/next-mr/libexec/mysqld(my_strtod+0x7a)[0x87bdade]
/home2/openxs/dbs/next-mr/libexec/mysqld(my_strntod_8bit+0x3c)[0x879e221]
/home2/openxs/dbs/next-mr/libexec/mysqld(_ZN19Item_func_numhybrid8val_realEv+0x202)[0x822364c]
/home2/openxs/dbs/next-mr/libexec/mysqld(_ZN14Arg_comparator12compare_realEv+0x20)[0x8232778]
/home2/openxs/dbs/next-mr/libexec/mysqld(_ZN14Arg_comparator7compareEv+0x49)[0x8216a0f]
/home2/openxs/dbs/next-mr/libexec/mysqld(_ZN12Item_func_eq7val_intEv+0x43)[0x8236e71]
/home2/openxs/dbs/next-mr/libexec/mysqld(_ZN4Item4sendEP8ProtocolP6String+0x1b2)[0x81f03cc]
/home2/openxs/dbs/next-mr/libexec/mysqld(_ZN8Protocol19send_result_set_rowEP4ListI4ItemE+0xd9)[0x82b7e65]
/home2/openxs/dbs/next-mr/libexec/mysqld(_ZN11select_send9send_dataER4ListI4ItemE+0xc5)[0x82ae007]
/home2/openxs/dbs/next-mr/libexec/mysqld[0x834ce07]
/home2/openxs/dbs/next-mr/libexec/mysqld[0x8353da1]
/home2/openxs/dbs/next-mr/libexec/mysqld(_Z10sub_selectP4JOINP13st_join_tableb+0x13c)[0x8353fc6]
/home2/openxs/dbs/next-mr/libexec/mysqld[0x836487b]
/home2/openxs/dbs/next-mr/libexec/mysqld(_ZN4JOIN4execEv+0x22b4)[0x83750c6]
/home2/openxs/dbs/next-mr/libexec/mysqld(_Z12mysql_selectP3THDPPP4ItemP10TABLE_LISTjR4ListIS1_ES2_jP8st_orderSB_S2_SB_yP13select_resultP18st_select_lex_unitP13st_select_lex+0x30d)[0x836fce9]
/home2/openxs/dbs/next-mr/libexec/mysqld(_Z13handle_selectP3THDP3LEXP13select_resultm+0x1ec)[0x83753d6]
/home2/openxs/dbs/next-mr/libexec/mysqld[0x82d8d4b]
/home2/openxs/dbs/next-mr/libexec/mysqld(_Z21mysql_execute_commandP3THD+0x9c1)[0x82daa81]
/home2/openxs/dbs/next-mr/libexec/mysqld(_Z11mysql_parseP3THDPKcjPS2_+0x229)[0x82e2cd1]
/home2/openxs/dbs/next-mr/libexec/mysqld(_Z16dispatch_command19enum_server_commandP3THDPcj+0x9e0)[0x82e3846]
/home2/openxs/dbs/next-mr/libexec/mysqld(_Z10do_commandP3THD+0x241)[0x82e4da5]
/home2/openxs/dbs/next-mr/libexec/mysqld(_Z24do_handle_one_connectionP3THD+0x15b)[0x82d2001]
/home2/openxs/dbs/next-mr/libexec/mysqld(handle_one_connection+0x25)[0x82d20bf]
/lib/tls/i686/cmov/libpthread.so.0[0xb77844fb]
/lib/tls/i686/cmov/libc.so.6(clone+0x5e)[0xb7692e5e]
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort...
thd->query at 0x945f820 = select coalesce(`t1`.`a`)=coalesce(`t1`.`b`) from `t1`
thd->thread_id=1
[28 Mar 2010 12:12] Guilhem Bichot
Regression source:
Alexey Kopytov	2009-12-22
      revision-id:alexey.kopytov@sun.com-20091222162313-pzr8quwkw4y7aud6
      Backport of WL #2934: Make/find library for doing float/double 
                            to string conversions and vice versa" 
      Initial import of the dtoa.c code and custom wrappers around it 
      to allow its usage from the server code. 

Found by bzrfind.
[2 Apr 2010 9:14] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/104960

3008 Alexey Kopytov	2010-04-02
      Bug #52165: Assertion failed: file .\dtoa.c, line 465
      
      The failing assertion was written with the assumption that a NULL
      string can never be passed to my_strtod(). However, an empty string
      may be passed under some circumstances by passing str == NULL and
      *end == NULL to my_strtod().
      
      Fixed the assertion to take the above case into account.
     @ mysql-test/r/func_misc.result
        Added a test case for bug #52165.
     @ mysql-test/t/func_misc.test
        Added a test case for bug #52165.
     @ strings/dtoa.c
        Fixed the assertion in my_strtod() to take the case of 'str == NULL
        && *end == NULL' into account.
[7 Apr 2010 10:00] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/105136

3008 Alexey Kopytov	2010-04-07
      Bug #52165: Assertion failed: file .\dtoa.c, line 465
      
      The failing assertion was written with the assumption that a NULL
      string can never be passed to my_strtod(). However, an empty string
      may be passed under some circumstances by passing str == NULL and
      *end == NULL.
      
      Fixed the assertion to take the above case into account.
     @ mysql-test/r/func_misc.result
        Added a test case for bug #52165.
     @ mysql-test/t/func_misc.test
        Added a test case for bug #52165.
     @ strings/dtoa.c
        Fixed the assertion in my_strtod() to take the case of 'str == NULL
        && *end == NULL' into account.
[27 Apr 2010 9:45] Bugs System
Pushed into 6.0.14-alpha (revid:alik@sun.com-20100427094135-5s49ecp3ckson6e2) (version source revid:alik@sun.com-20100427093843-uekr85qkd7orx12t) (merge vers: 6.0.14-alpha) (pib:16)
[27 Apr 2010 9:47] Bugs System
Pushed into 5.5.5-m3 (revid:alik@sun.com-20100427093804-a2k3rrjpwu5jegu8) (version source revid:alik@sun.com-20100427093804-a2k3rrjpwu5jegu8) (merge vers: 5.5.5-m3) (pib:16)
[27 Apr 2010 9:50] Bugs System
Pushed into mysql-next-mr (revid:alik@sun.com-20100427094036-38frbg3famdlvjup) (version source revid:alik@sun.com-20100427093825-92wc8b22d4yg34ju) (pib:16)
[12 May 2010 1:22] Paul Dubois
Noted in 5.5.5, 6.0.14 changelogs.

An assertion was raised as a result of a NULL string being passed to
the dtoa code.