[Bug 19809] all cygwin apps crash on exit if run outside wineconsole

wine-bugs at winehq.org wine-bugs at winehq.org
Sat Sep 5 07:52:36 CDT 2009


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


Peter Dons Tychsen <donpedro at tdcadsl.dk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |donpedro at tdcadsl.dk




--- Comment #2 from Peter Dons Tychsen <donpedro at tdcadsl.dk>  2009-09-05 07:52:35 ---
Hello Dan,

I was also annoyed by this, so i took a look.
I seemed to be crashing while doing a write via NtWriteFile().

Cygwin uses a very strange way of checking handle types.
It does this by calling various APIs with the handle and checks the response.
(uses this to detect serial ports, regular files, consoles....).

These APIs in turn use I/O-controls to do operations on the device. 
In wine, the NtDeviceIoControl() forgets to check if a handle is valid or if it
is appropriate. Wine does not e.g. check that serial port I/O-controls can only
be applied to handles which are in fact serial ports. Windows does this.

In short, cygwin thinks that your stdin is a serial port (and other odd
things)!

I wrote some tests for NtDeviceIoControl, and wrote a patch to fix the problem.
Now cygwin programs all work fine in the regular terminal.

Please test with this patch.
I have sent it to wine-patches as:

ntdll: Do not accept device control requests with invalid and/or incompatible
handles

-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
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