[Bug 35983] mz800 emulator hangs on start

wine-bugs at winehq.org wine-bugs at winehq.org
Sun Apr 13 23:35:55 CDT 2014


http://bugs.winehq.org/show_bug.cgi?id=35983

Dmitry Timoshkov <dmitry at baikal.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|regression                  |
             Status|UNCONFIRMED                 |NEW
          Component|kernel32                    |-unknown
            Summary|Regression - mz800 emulator |mz800 emulator hangs on
                   |does not show the boot      |start
                   |loader                      |
     Ever confirmed|0                           |1
    Regression SHA1|b4ab43b3de134d2816393ba7f23 |
                   |f67bfc36bd33f               |

--- Comment #1 from Dmitry Timoshkov <dmitry at baikal.ru> ---
This looks like an application bug. The app does something like this:

hinput = GetStdHandle(STD_INPUT_HANDLE);
in_size = GetFileSize(hinput);
if (insize > 127) in_size -= 127;
ReadFile(hinput, some_buf, in_size, &bytes_read, NULL); // <- hangs under Wine

First problem is that GetFileSize(hinput) returns 0 under Wine, but
INVALID_FILE_SIZE under Windows with last error set to ERROR_INVALID_HANDLE.
ReadFile(hinput, some_buf, 0, &bytes_read, NULL) waits forever for console
input under both Windows and Wine, but number_of_bytes_to_read passed to
ReadFile is 0 under Wine because of GetFileSize() bug => hang (wait for input).
Once GetFileSize() in Wine is fixed to return INVALID_FILE_SIZE for a console
handle, ReadConsoleA() attempts to allocate huge amount of memory (-128 =>
0xffffff80 bytes) which fails, but ReadConsoleA() doesn't check this and
forwards NULL to ReadConsoleW(), which in turn (correctly) waits for input.
Once I add a check to ReadConsoleA() for memory allocation error and return
FALSE with appropriate last error set the app starts to work.

-- 
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.



More information about the wine-bugs mailing list