Bug #44133 | mysql binary crashes with an exception reading command input | ||
---|---|---|---|
Submitted: | 7 Apr 2009 12:02 | Modified: | 12 May 2009 1:48 |
Reporter: | Georgi Kodinov | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Command-line Clients | Severity: | S3 (Non-critical) |
Version: | 6.0-pe-stage | OS: | Windows (vm-win2003-32-a) |
Assigned to: | Georgi Kodinov | CPU Architecture: | Any |
Tags: | regression |
[7 Apr 2009 12:02]
Georgi Kodinov
[7 Apr 2009 12:23]
Georgi Kodinov
Crash is reproducible by the following mysqltest test file : --exec echo "select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; select 1 AS x from DUAL; " |$MYSQL test
[7 Apr 2009 14:04]
Georgi Kodinov
For commands of the type echo "<something>" | mysql .... the error returned after reading all the incoming data is not ERROR_HANDLE_EOF, but ERROR_BROKEN_PIPE(109). This causes functions like e.g. my_win_read() to detect an error instead of returning EOF (0).
[7 Apr 2009 14:18]
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/71552 3187 Georgi Kodinov 2009-04-07 Bug #44133: mysql binary crashes with an exception reading command input Added an extra code for EOF condition in my_win_read(). According to the MSDN: "If an anonymous pipe is being used and the write handle has been closed, when ReadFile attempts to read using the pipe's corresponding read handle, the function returns FALSE and GetLastError returns ERROR_BROKEN_PIPE." And anonymous pipes are (evidently) being used by command pipelining "command1 | command2 | ..." in windows.
[8 Apr 2009 8:58]
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/71614 3190 Georgi Kodinov 2009-04-08 Addendum to bug #44133: added explanation in a code comment
[6 May 2009 14:08]
Bugs System
Pushed into 6.0.12-alpha (revid:svoj@sun.com-20090506125450-yokcmvqf2g7jhujq) (version source revid:joro@sun.com-20090408085709-okwvxnazwmodhwog) (merge vers: 6.0.11-alpha) (pib:6)
[12 May 2009 1:48]
Paul DuBois
Noted in 6.0.12 changelog. On Windows, if the mysql client was reading input from a pipe, it could crash attempting to read after EOF.