Bug #17926 mysql.exe crashes when ctrl-c is pressed in windows
Submitted: 5 Mar 2006 8:26 Modified: 18 Aug 2006 17:53
Reporter: Shane Bester (Platinum Quality Contributor) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S3 (Non-critical)
Version:5.0, 5.1 OS:Microsoft Windows (Windows)
Assigned to: Tatiana Azundris Nuernberg CPU Architecture:Any

[5 Mar 2006 8:26] Shane Bester
Description:
Occasionally when attempting to stop a long-running query, ctrl-c causes the mysql.exe client to crash.  Stack trace is attached from 5.1.7 beta which can pinpoint the crash location in the source.

How to repeat:
mysql -uroot -p test
<issue some long running query>
drop table if exists t1;
create table t1(id int);
insert into t1 values (1),(2),(3),(4),(5);
insert into t1 select * from t1; //repeat this a few times to get millions of rows.

select * from t1 group by id order by id desc;

Interrupt the above query by hitting control-c.

A popup dialog box had error, and I received this message:

Error: Safemalloc link list destroyed, discovered at '\builds\mysql-5.1.7-beta\vio\vio.c:233'
root=009FF558,count=-1,irem=009F4878

Suggested fix:
fix the cleanup code that shuts down the connection.
[5 Mar 2006 8:27] Shane Bester
stack from debug version of mysql.exe in VS.NET

Attachment: stack.txt (text/plain), 810 bytes.

[5 Mar 2006 8:30] Shane Bester
The line:

my_free((gptr) vio->read_buffer, MYF(MY_ALLOW_ZERO_PTR));

in the vio_delete function in vio.c caused the assertion.
[1 Jun 2006 5:17] 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/7131
[10 Aug 2006 1:47] 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/10236

ChangeSet@1.2250, 2006-08-10 03:46:46+02:00, tnurnberg@salvation.intern.azundris.com +1 -0
  Bug#17926: mysql.exe crashes when ctrl-c is pressed in windows
  
  SIGINT is handled in funny ways on windows, which could lead to problems when
  Control-C was pressed in the client during a long-running query.  Now Control-C
  during a query aborts that query (by sending KILL to the server on a second
  connexion), while Control-C outside of a running query terminates the client.
[10 Aug 2006 6:06] Timothy Smith
Follow-up patch approved.  OK to push, Tatjana.  Thanks.
[10 Aug 2006 10:25] Tatiana Azundris Nuernberg
pushed to 5.0.25 in 5.0-maint
[18 Aug 2006 17:53] Paul Dubois
Noted in 5.0.25, 5.1.12 changelogs.