bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

anonymous pipe read deadlock


From: Lars G Johnson
Subject: anonymous pipe read deadlock
Date: Thu, 26 Dec 2002 15:34:05 -0800

i am using make 3.78.1 on Windows 2000..  i encounter a deadlock due to
line 1465 of function.c:

     cc = read (pipedes[0], &buffer[i], maxlen - i);

This is executed by make on an anonymous pipe to communicate with a child
process used to spawn a shell command.

i am trying to use make in order to compile the sun java sdk.  i am using
mks as my default shell.  i am not able to create a simple make file that
seems to reproduce my bug.  it seems to be a race condition with Windows
2000 and anonymous pipe reads.

when make gets into the <java13nativevmsources>
\j2sdk1.3.1\make\sun\javac\recompile directory of my build, it seems to
deadlock when calculating the following variable definition:

ifndef BUILD_NUMBER
#   use ':=' to keep this value from changing as time marches on...
   BUILD_NUMBER := $(shell $(ECHO) $(USER)-`$(DATE) '+%y%m%d-%H:%M'`)
endif

Internally the command line that it is executing is:

     C:/PROGRA~1/MKSTOO~1/mksnt/sh.exe -c
"C:/PROGRA~1/MKSTOO~1/mksnt/echo.exe
user-`C:/PROGRA~1/MKSTOO~1/mksnt/date.exe '+ym89-H:M'`"

If I have this variable definition in other make directories,, the variable
definition for BUILD_NUMBER seems to work.

So, it seems to be a race condition with Windows2000.   If I go into the
source of make and insert a Sleep(2000) immediately before the anonymous
pipe read call ( line 1465 of function.c):

            errno = 0;
Sleep(2000);
       cc = read (pipedes[0], &buffer[i], maxlen - i);

then, the read call does not deadlock.

How should I help debug this anonymous pipe read deadlock?

Lars




reply via email to

[Prev in Thread] Current Thread [Next in Thread]