Bug #59107 mysqlslap crashes if started with no arguments on windows
Submitted: 22 Dec 2010 5:55 Modified: 10 Apr 2012 18:44
Reporter: Shane Bester (Platinum Quality Contributor) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S2 (Serious)
Version:5.5.10 OS:Windows
Assigned to: CPU Architecture:Any

[22 Dec 2010 5:55] Shane Bester
Description:
please fix bug #31173 in 5.5, 5.1

How to repeat:
mysqlslap.exe --no-defaults
[22 Dec 2010 7:05] Valeriy Kravchuk
Verified on 32-bit Windows XP. Stack trace is:

 	mysqlslap.exe!create_shared_memory(st_mysql * mysql=0x003bf4b0, st_net * net=0x003bf4b0, unsigned int connect_timeout=0)  Line 541 + 0x3b bytes	
 	mysqlslap.exe!mysql_real_connect(st_mysql * mysql=0x003bf4b0, const char * host=0x00000000, const char * user=0x003b314a, const char * passwd=0x003b2bb8, const char * db=0x004c5e24, unsigned int port=3312, const char * unix_socket=0x00000000, unsigned long client_flag=196608)  Line 3014 + 0xe bytes	
 	mysqlslap.exe!slap_connect(st_mysql * mysql=0x003bf4b0)  Line 2175 + 0x34 bytes	
 	mysqlslap.exe!run_task(void * p=0x0012fb1c)  Line 1798 + 0x6 bytes	
 	mysqlslap.exe!pthread_start(void * p=0x003bf1f8)  Line 61 + 0x3 bytes	
>	mysqlslap.exe!_callthreadstartex()  Line 348 + 0x6 bytes	
 	mysqlslap.exe!_threadstartex(void * ptd=0x003bf208)  Line 326 + 0x5 bytes	
 	kernel32.dll!7c80b729() 	

This is how I called it:

C:\Program Files\MySQL\MySQL Server 5.5\bin>mysqlslap --no-defaults -uroot -proot -P3312
[4 Apr 2011 16:30] Santo Leto
I am not able to repeat the bug on version 5.5.10 using the command provided in the "how to repeat" section:

mysqlslap.exe --no-defaults -uroot -p -P55102
Enter password:

Benchmark
        Average number of seconds to run all queries: 0.031 seconds
        Minimum number of seconds to run all queries: 0.031 seconds
        Maximum number of seconds to run all queries: 0.031 seconds
        Number of clients running queries: 1
        Average number of queries per client: 0

I was able to repeat it on version 5.5.8:

mysqlslap!create_shared_memory+0x4c [g:\pb2\build\sb_0-2629600-1291399430.36\mysql-5.5.8\sql-common\client.c @ 541]
mysqlslap!mysql_real_connect+0x205 [g:\pb2\build\sb_0-2629600-1291399430.36\mysql-5.5.8\sql-common\client.c @ 3014]
mysqlslap!slap_connect+0x59 [g:\pb2\build\sb_0-2629600-1291399430.36\mysql-5.5.8\client\mysqlslap.c @ 2175]
mysqlslap!run_task+0x11b [g:\pb2\build\sb_0-2629600-1291399430.36\mysql-5.5.8\client\mysqlslap.c @ 1798]
mysqlslap!pthread_start+0x1e [g:\pb2\build\sb_0-2629600-1291399430.36\mysql-5.5.8\mysys\my_winthread.c @ 63]
mysqlslap!_callthreadstartex+0x17 [f:\dd\vctools\crt_bld\self_64_amd64\crt\src\threadex.c @ 348]
mysqlslap!_threadstartex+0x9f [f:\dd\vctools\crt_bld\self_64_amd64\crt\src\threadex.c @ 326]
kernel32!BaseThreadInitThunk+0xd
ntdll!RtlUserThreadStart+0x1d

However, I get an identical stack trace on version 5.5.10 when using the command

mysqlslap -uroot -p -P55102 --delimiter=";" --create="CREATE TABLE a (b int);INSERT INTO a VALUES (23)" --query="SELECT * FROM a" --concurrency=1000 --iterations=1

mysqlslap!create_shared_memory+0x4c [g:\pb2\build\sb_0-3071094-1299687147.19\mysql-5.5.10\sql-common\client.c @ 540]
mysqlslap!mysql_real_connect+0x205 [g:\pb2\build\sb_0-3071094-1299687147.19\mysql-5.5.10\sql-common\client.c @ 3019]
mysqlslap!slap_connect+0x59 [g:\pb2\build\sb_0-3071094-1299687147.19\mysql-5.5.10\client\mysqlslap.c @ 2199]
mysqlslap!run_task+0x11e [g:\pb2\build\sb_0-3071094-1299687147.19\mysql-5.5.10\client\mysqlslap.c @ 1817]
mysqlslap!pthread_start+0x1e [g:\pb2\build\sb_0-3071094-1299687147.19\mysql-5.5.10\mysys\my_winthread.c @ 63]
mysqlslap!_callthreadstartex+0x17 [f:\dd\vctools\crt_bld\self_64_amd64\crt\src\threadex.c @ 348]
mysqlslap!_threadstartex+0x9f [f:\dd\vctools\crt_bld\self_64_amd64\crt\src\threadex.c @ 326]
kernel32!BaseThreadInitThunk+0xd
ntdll!RtlUserThreadStart+0x1d

(or other similar commands).
[10 Apr 2012 18:44] Paul DuBois
Noted in 5.1.63, 5.5.24, 5.6.6 changelogs.

On Windows, mysqlslap crashed for attempts to connect using shared
memory.