Re: make returning spurious 4522468 errors

Eli Zaretskii <[email protected]>
Newsgroups gmane.comp.gnu.make.windows
Message-ID <[email protected]>
> Date: Thu, 07 Jan 2010 15:08:12 -0800
> From: tom honermann <[email protected]>
> 
> Based on a brief glance at the code, I'm guessing that the value 
> returned by one of the calls to 'GetExitCodeProcess' in 
> 'w32/subproc/sub_proc.c' is somehow getting lost or corrupted.  There 
> are two calls to 'GetExitCodeProcess', both of which look very similar 
> to this:
> 
>         DWORD ierr;
>         GetExitCodeResult = GetExitCodeProcess(childhand, &ierr);
>         if (ierr == CONTROL_C_EXIT) {
>                 pproc->signal = SIGINT;
>         } else {
>                 pproc->exit_code = ierr;
>         }
>         if (GetExitCodeResult == FALSE) {
>                 pproc->last_err = GetLastError();
>                 pproc->lerrno = E_SCALL;
>         }
> 
> Two things stand out to me here:
> 
> 1: 'pproc->exit_code' is assigned the value of 'ierr' regardless of 
> whether the call to 'GetExitCodeProcess' is successful or not.  If 
> 'GetExitCodeProcess' fails, it may not assign to 'ierr' at all - which 
> could result in 'pproc->exit_code' getting assigned an uninitialized 
> value (since 'ierr' is not assigned a value)

If you plumb these holes and rebuild Make, does the problem go away?

If it does, I will be more than happy to include your suggested
changes in the development sources.

> 2: There is no check for 'ierr' being assigned 'STILL_ACTIVE'.  It may 
> be that other parts of the code ensure that 'GetExitCodeProcess' is 
> never called for an uncompleted process, I haven't looked for that.  

Make waits for finished subprocess with WaitForMultipleObjects, and
only calls GetExitCodeProcess if a process exited.  So this shouldn't
be a problem.

Thanks.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.