This is the mail archive of the cygwin@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Make hung in WaitForMultipleObjects inside Cygwin


OK, I compiled both make.exe and cygwin1.dll with debugging enabled
and managed to get make.exe to hang again.  There are four threads
running.  Here are the stack traces for all four of them:

Thread 4 (thread 1374.0x23f):
#0  0x77f762e9 in ?? ()
#1  0x77f04ede in ?? ()

Thread 3 (thread 1374.0x413):
#0  0x77f682cb in ?? ()
#1  0x77f1cd76 in ?? ()
#2  0x61045cf9 in wait_subproc () at /u/jik/tmp/cygwin-1.1.8-2/winsup/cygwin/sigproc.cc:1234
#3  0x610045a2 in thread_stub (arg=0x61088734) at /u/jik/tmp/cygwin-1.1.8-2/winsup/cygwin/debug.cc:97
#4  0x77f04ede in ?? ()

Thread 2 (thread 1374.0x30d):
#0  0x77f682cb in ?? ()
#1  0x77f1cd76 in ?? ()
#2  0x610459a9 in wait_sig () at /u/jik/tmp/cygwin-1.1.8-2/winsup/cygwin/sigproc.cc:1113
#3  0x610045a2 in thread_stub (arg=0x61088734) at /u/jik/tmp/cygwin-1.1.8-2/winsup/cygwin/debug.cc:97
#4  0x77f04ede in ?? ()

Thread 1 (thread 1374.0x54f):
#0  0x77f67f07 in ?? ()
#1  0x6100fc31 in fhandler_base::raw_read (this=0x1a0235e0, ptr=0x24af233, ulen=1) at /u/jik/tmp/cygwin-1.1.8-2/winsup/cygwin/fhandler.cc:218
#2  0x61010450 in fhandler_base::read (this=0x1a0235e0, in_ptr=0x24af233, in_len=1) at /u/jik/tmp/cygwin-1.1.8-2/winsup/cygwin/fhandler.cc:457
#3  0x6104af20 in _read (fd=5, ptr=0x24af233, len=1) at /u/jik/tmp/cygwin-1.1.8-2/winsup/cygwin/syscalls.cc:261
#4  0x6106f98e in read (fd=5, buf=0x24af233, cnt=1) at /u/jik/tmp/cygwin-1.1.8-2/newlib/libc/syscalls/sysread.c:15
#5  0x6100e9d4 in sigdelayed () at /u/jik/tmp/cygwin-1.1.8-2/winsup/cygwin/exceptions.cc:1184
#6  0x402704 in execute_file_commands (file=0xa01e2d0) at /u/jik/tmp/cygwin-1.1.8-2/make-3.79.1-2/commands.c:362
#7  0x41adc3 in remake_file (file=0xa01e2d0) at /u/jik/tmp/cygwin-1.1.8-2/make-3.79.1-2/remake.c:1008
#8  0x41a245 in update_file_1 (file=0xa01e2d0, depth=3) at /u/jik/tmp/cygwin-1.1.8-2/make-3.79.1-2/remake.c:659
#9  0x418b52 in update_file (file=0xa01e2d0, depth=2) at /u/jik/tmp/cygwin-1.1.8-2/make-3.79.1-2/remake.c:309
#10 0x41a66e in check_dep (file=0xa01e2d0, depth=2, this_mtime=1, must_make_ptr=0x24af3f0) at /u/jik/tmp/cygwin-1.1.8-2/make-3.79.1-2/remake.c:813
#11 0x41989e in update_file_1 (file=0xa011be8, depth=1) at /u/jik/tmp/cygwin-1.1.8-2/make-3.79.1-2/remake.c:450
#12 0x418b52 in update_file (file=0xa011be8, depth=0) at /u/jik/tmp/cygwin-1.1.8-2/make-3.79.1-2/remake.c:309
#13 0x4187a8 in update_goal_chain (goals=0xa01e480, makefiles=0) at /u/jik/tmp/cygwin-1.1.8-2/make-3.79.1-2/remake.c:156
#14 0x411402 in main (argc=4, argv=0x1a020a50, envp=0xa010008) at /u/jik/tmp/cygwin-1.1.8-2/make-3.79.1-2/main.c:1991
#15 0x61003ae6 in dll_crt0_1 () at /u/jik/tmp/cygwin-1.1.8-2/winsup/cygwin/dcrt0.cc:858
#16 0x61003d91 in _dll_crt0 () at /u/jik/tmp/cygwin-1.1.8-2/winsup/cygwin/dcrt0.cc:923
#17 0x61003dd0 in dll_crt0 (uptr=0x0) at /u/jik/tmp/cygwin-1.1.8-2/winsup/cygwin/dcrt0.cc:935
#18 0x425553 in cygwin_crt0 ()
#0  0x77f682cb in ?? ()

Frame 1 and frame 2 of thread 1 say that they're trying to read from
"/dev/piper".  I guess this is consistent with the fact that "ps"
shows "I" in the state column for the hung Make process.

According to the variables assessible from frame 6, file descriptor 5,
the descriptor that Make is hung trying to read, is job_rfd, the read
file descriptor for the job server.  I find this comment about "read
(job_rfd, &token, 1)" in "job.c" in the Make source code to be
particularly intriguing:

        /* Read a token.  As long as there's no token available we'll block.
           If we get a SIGCHLD we'll return with EINTR.  If one happened
           before we got here we'll return immediately with EBADF because
           the signal handler closes the dup'd file descriptor.  */

I'm guessing that this Make process missed a SIGCHLD signal at some
point, or its signal handler wasn't called properly, so it's blocked
waiting for a token that's never going to come.

If anyone has any suggestions for debugging this further, I'd love to
hear them.  In the meantime, I'm going to restart the build that's
provoking this hang, wrapped in "strace" and passing "-d" to Make, on
the off chance that both strace and Make's debugging information
together may shed more light on what's going wrong.

  jik

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]