http://bugs.winehq.org/show_bug.cgi?id=19809
Summary: all cygwin apps crash on exit if run outside wineconsole Product: Wine Version: 1.1.27 Platform: PC URL: http://cygwin.com OS/Version: Linux Status: NEW Keywords: download Severity: normal Priority: P2 Component: -unknown AssignedTo: wine-bugs@winehq.org ReportedBy: dank@kegel.com
cd .wine/drive_c/cygwin/bin wine true.exe
crashes, whereas
cd .wine/drive_c/cygwin/bin wine wineconsole true.exe
does not crash.
On windows, cygwin apps do not crash on exit, even if you ssh in to the windows box (i.e. have no real console).
This makes it more difficult to run the firefox and chrome build scripts.
http://bugs.winehq.org/show_bug.cgi?id=19809
--- Comment #1 from Dan Kegel dank@kegel.com 2009-08-21 09:26:41 --- Note, this doesn't happen with the svn.exe that chromium installs, so it seems to be something with the cygwin runtime?
http://bugs.winehq.org/show_bug.cgi?id=19809
Peter Dons Tychsen donpedro@tdcadsl.dk changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |donpedro@tdcadsl.dk
--- Comment #2 from Peter Dons Tychsen donpedro@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
http://bugs.winehq.org/show_bug.cgi?id=19809
--- Comment #3 from Dan Kegel dank@kegel.com 2009-09-05 13:30:49 --- Hasn't shown up in the archives yet (the list manager must be on vacation). Maybe attach it here, too.
http://bugs.winehq.org/show_bug.cgi?id=19809
--- Comment #4 from Jeff Zaroyko jeffz@jeffz.name 2009-09-05 15:15:52 --- (In reply to comment #3)
Hasn't shown up in the archives yet (the list manager must be on vacation). Maybe attach it here, too.
or asleep...
http://www.winehq.org/pipermail/wine-patches/2009-September/078154.html
http://bugs.winehq.org/show_bug.cgi?id=19809
--- Comment #5 from Dan Kegel dank@kegel.com 2009-09-06 06:59:56 --- seems to work, thanks!
btw when the patch is inline, marc.info does a better job preserving it, that link is http://marc.info/?l=wine-patches&m=125218125505540&w=2
http://bugs.winehq.org/show_bug.cgi?id=19809
--- Comment #6 from Dan Kegel dank@kegel.com 2009-09-06 07:59:07 --- Oddly, when I run an app with output redirected to a disk file, cygwin tries to look up the posix path associated with the file descriptor, it now gets "some disk file". This happens in winsup/cygwin/dtable.cc's handle_to_fn(). Not sure if that's important, or even if it's new, but it's curious.
http://bugs.winehq.org/show_bug.cgi?id=19809
--- Comment #7 from Dan Kegel dank@kegel.com 2009-09-07 11:58:45 --- I think this patch makes the kernel32 tests fail.
http://bugs.winehq.org/show_bug.cgi?id=19809
--- Comment #8 from Peter Dons Tychsen donpedro@tdcadsl.dk 2009-09-07 12:37:44 --- OK.. what failure are you seeing. Could you specify the test-case?
I added the new test-case and made sure the same ones failed before and after my patch. Might have made a mistake though.
The problem with "some disk file" is different, and is related to the other problem you found (with TAR).
/pedro
http://bugs.winehq.org/show_bug.cgi?id=19809
--- Comment #9 from Dan Kegel dank@kegel.com 2009-09-07 13:05:32 --- file.c:974: Test failed: GetVolumeNameForVolumeMountPointA failed, for C:, last error=6 file.c:1053: Test failed: GetVolumeNameForVolumeMountPointA not functioning
http://bugs.winehq.org/show_bug.cgi?id=19809
--- Comment #10 from Peter Dons Tychsen donpedro@tdcadsl.dk 2009-09-07 13:18:01 ---
Oddly, when I run an app with output redirected to a disk file, cygwin tries to look up the posix path associated with the file descriptor, it now gets "some disk file".
Please give an example. I have tried several piping manoeuvres in cygwin with no bad outcome.
I have discovered though that there is another problem in handle_to_fn() which might be causing what you are seeing (and the TAR problem). NtQueryInformationFile() is not fully implented, and causes problems. I have written another patch for that though, and should be unrelated to this. The other patch is not finished however, and i am not sure it will fix your problem completely.
Again, please post a failing example.
Thanks,
/pedro
http://bugs.winehq.org/show_bug.cgi?id=19809
Dan Kegel dank@kegel.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED
--- Comment #11 from Dan Kegel dank@kegel.com 2009-09-13 05:09:54 --- Fixed by http://www.winehq.org/pipermail/wine-cvs/2009-September/059349.html
http://bugs.winehq.org/show_bug.cgi?id=19809
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #12 from Alexandre Julliard julliard@winehq.org 2009-09-25 12:25:55 --- Closing bugs fixed in 1.1.30.