Mailing-List: contact cygwin-developers-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-developers-owner AT cygwin DOT com Delivered-To: mailing list cygwin-developers AT cygwin DOT com Date: Mon, 5 Aug 2002 11:05:53 -0400 From: Christopher Faylor To: cygwin-developers AT cygwin DOT com Subject: Re: 1.3.13? Message-ID: <20020805150553.GA4844@redhat.com> Reply-To: cygwin-developers AT cygwin DOT com Mail-Followup-To: cygwin-developers AT cygwin DOT com References: <20020804195150 DOT GA3381 AT redhat DOT com> <124668090713 DOT 20020805140659 AT logos-m DOT ru> <20020805150600 DOT D3921 AT cygbert DOT vinschen DOT de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020805150600.D3921@cygbert.vinschen.de> User-Agent: Mutt/1.3.23.1i On Mon, Aug 05, 2002 at 03:06:00PM +0200, Corinna Vinschen wrote: >On Mon, Aug 05, 2002 at 02:06:59PM +0400, Egor Duda wrote: >> The line >> 78 10339441 [main] ssh 298 cygthread::cygthread: resume thread select_pipe: 0 >> keeps repeating ad infinitum until interrupted. >> This line comes from cygthread constructor. I've added debug_printf >> which prints thread name an outcome from ResumeThread. Looks like pipe >> thread is not cleaning up properly. I'll try to take a deeper look but >> meanwhile want to give a heads-up. > >I've observed that situation as well today. Logging in using sshd results >in full cpu usage of sshd for about 5 seconds. After logging out it jumps >to 100% again and remains this way until killing sshd. > >Looking into the code there's something I don't understand: > >cygthread::exit_thread() calls ExitThread(0). The thread which calls >exit_thread() - fhandler_tty.cc, process_output() - is a cygthread >function, too. Shouldn't exit_thread() actually call SuspendThread(0) >instead? Not if it truly wanted the thread to exit, no. Suspending the thread when it is going away anyway didn't seem like a good idea to me. >OTOH, process_output() tries to exit itself: > >fhandler_tty_master::init () > output_thread = new cygthread (process_output, NULL, "ttyout"); > >process_output () > cygthread *t = tty_master->output_thread; > ... > t->exit_thread (); > >so shouldn't it match the situation better just to call `return 0;' >instead of exit_thread() here? That would allow to eliminate >cygthread::exit_thread() completely. That basically puts it back to the way it has been for years. And, it means that the detach method won't work properly. >Unfortunately this doesn't solve the problem. I'm still debugging. I'd be surprised if it did solve the problem since that would put the code back into the situation that Conrad Scott reported on Friday. cgf