Cygwin 1.7.5 fork() bug

Huang Bambo bambo.huang@gmail.com
Mon May 17 06:32:00 GMT 2010


fork() may translate a wrong encoded path name to CreateProcessW in somecase.

My cygwin version:

$ uname -a
CYGWIN_NT-5.1 bambo-notebook 1.7.5(0.225/5/3) 2010-04-12 19:07 i686 Cygwin

This happens in windows XP with multi-byte characters support, for
example, I use a system with GBK as default.
If the path to the executable contains multi-byte characters,
CreateProcessW will fail and report file(executable) not found in
somecase.

The follow shows how this happen.

[Bambo@bambo-notebook 正虹]$ pwd
/cygdrive/d/正虹
                ^^^^^^ Here's some multi-byte characters to the executable.
[Bambo@bambo-notebook 正虹]$ cat test.c
#include <unistd.h>

int main()
{
        fork();
}
[Bambo@bambo-notebook 正虹]$ make test
cc     test.c   -o test
[Bambo@bambo-notebook 正虹]$ export LANG=en_US.GBK
[Bambo@bambo-notebook 正虹]$ ./test.exe
[Bambo@bambo-notebook 正虹]$ export LANG=en_US.UTF-8
[Bambo@bambo-notebook 正虹]$ ./test.exe
      3 [main] test 5836 fork: child -1 - CreateProcessW failed, errno 2


cygcheck.out is attached.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cygcheck.out
Type: application/octet-stream
Size: 57616 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20100517/b2d3f884/attachment.obj>
-------------- next part --------------
--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


More information about the Cygwin mailing list