Figured out how to reproduce vfork/rsync bug! (proposed fix)

Christopher Faylor cgf@redhat.com
Thu Sep 6 13:13:00 GMT 2001


On Thu, Sep 06, 2001 at 02:53:26PM -0400, Jonathan Kamens wrote:
>I think I'll try the patch that cgf just sent out and see if it makes
>this problem go away.
>
>It will be very amusing if we discover that the bug I'm encountering
>is the same as Egor's.

Try this.

cgf

Index: spawn.cc
===================================================================
RCS file: /cvs/uberbaum/winsup/cygwin/spawn.cc,v
retrieving revision 1.86
diff -p -r1.86 spawn.cc
*** spawn.cc	2001/08/22 17:50:22	1.86
--- spawn.cc	2001/09/06 20:11:48
*************** spawn_guts (HANDLE hToken, const char * 
*** 534,545 ****
    ciresrv.moreinfo->argv = newargv;
  
    ciresrv.moreinfo->envc = envsize (envp, 1);
!   ciresrv.moreinfo->envp = (char **) cmalloc (HEAP_1_ARGV, ciresrv.moreinfo->envc);
    ciresrv.hexec_proc = hexec_proc;
    char **c;
    const char * const *e;
    for (c = ciresrv.moreinfo->envp, e = envp; *e;)
!     *c++ = cstrdup1 (*e++);
    *c = NULL;
    if (mode != _P_OVERLAY ||
        !DuplicateHandle (hMainProc, myself.shared_handle (), hMainProc,
--- 534,545 ----
    ciresrv.moreinfo->argv = newargv;
  
    ciresrv.moreinfo->envc = envsize (envp, 1);
!   ciresrv.moreinfo->envp = (char **) cmalloc (HEAP_ARGV, ciresrv.moreinfo->envc);
    ciresrv.hexec_proc = hexec_proc;
    char **c;
    const char * const *e;
    for (c = ciresrv.moreinfo->envp, e = envp; *e;)
!     *c++ = cstrdup (*e++);
    *c = NULL;
    if (mode != _P_OVERLAY ||
        !DuplicateHandle (hMainProc, myself.shared_handle (), hMainProc,



More information about the Cygwin-developers mailing list