[Bug 21289] New: System call "dup2" returns 0 for negative inputs, thus behaving different from real Windows
http://bugs.winehq.org/show_bug.cgi?id=21289 Summary: System call "dup2" returns 0 for negative inputs, thus behaving different from real Windows Product: Wine Version: 1.0.1 Platform: x86 OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown AssignedTo: wine-bugs(a)winehq.org ReportedBy: simon(a)josefsson.org The program below when run under Wine will print: rc 0 When I run the same binary on Windows XP, I get: rc -1 The problem appears to be that the "dup2" system function doesn't do proper input checking. This is causing self-tests errors for projects (including several GNU projects) that use some gnulib modules. /Simon jas(a)mocca:~$ cat foo.c #include <unistd.h> #include <stdio.h> #include <errno.h> #include <fcntl.h> /* Get declarations of the Win32 API functions. */ # define WIN32_LEAN_AND_MEAN # include <windows.h> int main (void) { const char *file = "test-dup2.tmp"; char buffer[1]; int fd = open (file, O_CREAT | O_TRUNC | O_RDWR, 0600); int rc; rc = dup2 (fd, -2); printf ("rc %d\n", rc); return 0; } jas(a)mocca:~$ i586-mingw32msvc-gcc -o foo.exe foo.c jas(a)mocca:~$ wine ./foo.exe rc 0 jas(a)mocca:~$ wine --version wine-1.0.1 jas(a)mocca:~$ -- 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.
http://bugs.winehq.org/show_bug.cgi?id=21289 Austin English <austinenglish(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download, testcase --- Comment #1 from Austin English <austinenglish(a)gmail.com> 2010-01-08 16:31:00 --- Please retest in 1.1.36. -- 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.
http://bugs.winehq.org/show_bug.cgi?id=21289 --- Comment #2 from Nikolay Sivov <bunglehead(a)gmail.com> 2010-01-08 16:34:48 --- (In reply to comment #1)
Please retest in 1.1.36.
Also try 'winetricks vcrun6'. -- 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.
http://bugs.winehq.org/show_bug.cgi?id=21289 Andrew Nguyen <arethusa26(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 --- Comment #3 from Andrew Nguyen <arethusa26(a)gmail.com> 2010-01-08 16:58:42 --- I'm confirming in wine-1.1.36. With builtin msvcrt, I get: rc 0 and native msvcrt yields: rc -1 -- 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.
http://bugs.winehq.org/show_bug.cgi?id=21289 Nikolay Sivov <bunglehead(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|-unknown |msvcrt -- 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.
http://bugs.winehq.org/show_bug.cgi?id=21289 --- Comment #4 from Simon Josefsson <simon(a)josefsson.org> 2010-01-09 05:24:21 --- (In reply to comment #3)
I'm confirming in wine-1.1.36.
Thanks. Are you also able to test the winetricks suggestion? My 1.0.1 installation (debian testing) doesn't seem to have that tool, or I'm missing something. /Simon -- 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.
http://bugs.winehq.org/show_bug.cgi?id=21289 --- Comment #5 from Jeff Zaroyko <jeffz(a)jeffz.name> 2010-01-09 05:30:44 --- Please use a more recent version of Wine to report bugs against, 1.0.1 was released 14 months ago. See http://www.winehq.org/download for packages or use git. For winetricks see here http://wiki.winehq.org/winetricks -- 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.
http://bugs.winehq.org/show_bug.cgi?id=21289 --- Comment #6 from Simon Josefsson <simon(a)josefsson.org> 2010-01-11 16:42:10 --- (In reply to comment #5)
Please use a more recent version of Wine to report bugs against, 1.0.1 was released 14 months ago. See http://www.winehq.org/download for packages or use git.
Wine 1.0.1 is marked as the latest stable version as far as I can tell, and the bug was confirmed to be in the latest development version too. There doesn't seem to be updated debian/ubuntu packages available for the development versions, which makes it difficult for me to test anything other than the latest stable version. Don't you want to track bugs for the latest stable release?
For winetricks see here http://wiki.winehq.org/winetricks
That seems to use non-free software, and says that it limits my ability to get help, so I'd prefer if other people can help with this aspect. /Simon -- 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.
http://bugs.winehq.org/show_bug.cgi?id=21289 --- Comment #7 from Jeff Zaroyko <jeffz(a)jeffz.name> 2010-01-11 21:28:47 --- I've sent a patch. -- 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.
http://bugs.winehq.org/show_bug.cgi?id=21289 Dan Kegel <dank(a)kegel.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dank(a)kegel.com --- Comment #8 from Dan Kegel <dank(a)kegel.com> 2010-01-11 21:59:53 --- Which apps are failing their tests because of this? I might want to add them to http://wiki.winehq.org/UnitTestSuites ('winetricks msvcrt' is just a handy way to download and install native msvcrt safely on wine. We often use it when triaging bugs; we then do rm -rf ~/.wine to avoid leaving the native dlls installed by accident.) -- 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.
http://bugs.winehq.org/show_bug.cgi?id=21289 Alexander Scott-Johns <alexander.scott.johns+winebug(a)googlemail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |alexander.scott.johns+wineb | |ug(a)googlemail.com --- Comment #9 from Alexander Scott-Johns <alexander.scott.johns+winebug(a)googlemail.com> 2010-01-12 18:58:21 --- (In reply to comment #6)
(In reply to comment #5)
Please use a more recent version of Wine to report bugs against, 1.0.1 was released 14 months ago. See http://www.winehq.org/download for packages or use git.
Wine 1.0.1 is marked as the latest stable version as far as I can tell, and the bug was confirmed to be in the latest development version too. There doesn't seem to be updated debian/ubuntu packages available for the development versions, which makes it difficult for me to test anything other than the latest stable version.
The http://www.winehq.org/download page provides instructions for installing development packages. You can also compile from source - see the http://wiki.winehq.org/GitWine page.
Don't you want to track bugs for the latest stable release?
The 1.0.* branch is no longer being developed, so any bugs in it won't be fixed.
For winetricks see here http://wiki.winehq.org/winetricks
That seems to use non-free software, and says that it limits my ability to get help, so I'd prefer if other people can help with this aspect.
The "may limit your ability to get support though WineHQ" warning is there because we don't want bugs reported for problems caused by winetricks (packages like ie6 and directx9 often break Wine in weird and wonderful ways). -- 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.
http://bugs.winehq.org/show_bug.cgi?id=21289 Jeff Zaroyko <jeffz(a)jeffz.name> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED --- Comment #10 from Jeff Zaroyko <jeffz(a)jeffz.name> 2010-01-14 12:33:04 --- Fixed by commit c2459deefffaef80ea78faadeb9ab7fa66a67ff6. -- 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.
http://bugs.winehq.org/show_bug.cgi?id=21289 Alexandre Julliard <julliard(a)winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED --- Comment #11 from Alexandre Julliard <julliard(a)winehq.org> 2010-01-22 11:02:29 --- Closing bugs fixed in 1.1.37. -- 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.
participants (1)
-
wine-bugs@winehq.org