http://bugs.winehq.org/show_bug.cgi?id=22338
Summary: spawnl(P_WAIT, "...") and system() do not wait if a host program is invoked Product: Wine Version: unspecified Platform: x86 OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: msvcrt AssignedTo: wine-bugs@winehq.org ReportedBy: bonzini@gnu.org
Sample program:
#include <stdio.h> #include <stdlib.h>
int main(int argc, char **argv) { int i; if (argc == 2) system (argv[1]); for (i = 0; i < 10000; i++) puts (argc == 2 ? "a" : "b"); }
Compile it for both Windows and Linux:
gcc test.c i686-pc-mingw32-gcc test.c
Now, running a Windows child process will correctly wait for the child process to finish:
$ ./a.exe ./a.exe |uniq b a
Instead, Wine will not wait for a Linux child process to finish:
$ ./a.exe ./a.out |uniq a b a
I _think_ i can work around the bug by wrapping the Unix program with a wrapper that links to libwine, but I am not yet sure.
http://bugs.winehq.org/show_bug.cgi?id=22338
--- Comment #1 from Paolo Bonzini bonzini@gnu.org 2010-04-11 08:43:33 --- It doesn't work:
$ winegcc f.c -m32 -mconsole -o a.exe.so $ ./a.exe ./a.exe.so b a b a
http://bugs.winehq.org/show_bug.cgi?id=22338
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download, source, testcase
http://bugs.winehq.org/show_bug.cgi?id=22338
--- Comment #2 from Vitaliy Margolen vitaliy@kievinfo.com 2010-04-11 12:13:26 --- Have you verified this on real Windows? Things work differently there
http://bugs.winehq.org/show_bug.cgi?id=22338
Paolo Bonzini bonzini@gnu.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Summary|spawnl(P_WAIT, "...") and |spawnl(P_WAIT, "...") and |system() do not wait if a |system() do not wait if a |host program is invoked |Unix program is invoked
--- Comment #3 from Paolo Bonzini bonzini@gnu.org 2010-04-11 13:42:32 --- How can I verify this bug on real Windows if it requires me to launch a Unix executable? :-)
The point is that system() and spawnl(P_WAIT, "...") should work independent of what executable I give, for example this waits:
system ("c:\msys\1.0\bin\cat.exe z:\etc\passwd");
and this doesn't:
system ("z:\bin\cat.exe z:\etc\passwd");
BTW I think the affected component is actually wineserver but I'm not sure.
http://bugs.winehq.org/show_bug.cgi?id=22338
--- Comment #4 from Paolo Bonzini bonzini@gnu.org 2010-04-11 13:45:08 --- Sorry, should have been
system ("z:\bin\cat /etc/passwd");
http://bugs.winehq.org/show_bug.cgi?id=22338
Vitaliy Margolen vitaliy@kievinfo.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |FIXED
--- Comment #5 from Vitaliy Margolen vitaliy@kievinfo.com 2010-04-11 16:39:57 --- Then it's invalid.
http://bugs.winehq.org/show_bug.cgi?id=22338
Vitaliy Margolen vitaliy@kievinfo.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #6 from Vitaliy Margolen vitaliy@kievinfo.com 2010-04-11 16:40:17 --- Closing.
http://bugs.winehq.org/show_bug.cgi?id=22338
--- Comment #7 from Paolo Bonzini bonzini@gnu.org 2010-04-11 16:44:05 --- Exactly why? If it is not supported to call Unix programs from Windows, the bug is that you can spawn a Unix program in the first place.
Otherwise it is supported, and spawnl(P_WAIT, "...") not waiting is a bug.
In either case, there is a bug. Also, closing as "FIXED" is wrong. It could be "INVALID" or "WONTFIX", but it is not fixed.
http://bugs.winehq.org/show_bug.cgi?id=22338
Vitaliy Margolen vitaliy@kievinfo.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|FIXED |WONTFIX
--- Comment #8 from Vitaliy Margolen vitaliy@kievinfo.com 2010-04-11 17:02:56 --- Yeah it's not fixes, it's a WONTFIX. See bug 18335 for details.
http://bugs.winehq.org/show_bug.cgi?id=22338
Paolo Bonzini bonzini@gnu.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|CLOSED |RESOLVED Resolution|WONTFIX |DUPLICATE
--- Comment #9 from Paolo Bonzini bonzini@gnu.org 2010-04-11 17:13:20 --- Thanks, this makes more sense.
*** This bug has been marked as a duplicate of bug 18335 ***
http://bugs.winehq.org/show_bug.cgi?id=22338
Jeff Zaroyko jeffz@jeffz.name changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #10 from Jeff Zaroyko jeffz@jeffz.name 2010-04-11 18:53:32 --- Closing duplicate.