X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:date:from:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; q=dns; s=default; b=yd2QFAL6Rg+RTP0f1Z7HiVtaMYyyz7gx6949c13pWf2 4WK5AQqhIDEQt3uZuPJSq/JsKbP64vjhZsEaHC+nP1wHhsJmbhlJPnuSkIhuab0d evUcN4ORYT76u618zhf6x/ofeedSn7yKuBQ+i4wv+YLt1ymtoqbXb5CASXjBXx9g = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:date:from:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; s=default; bh=pZ7Sz3GMsqN+P5vVJV3sS4eVhps=; b=gVl/0D8dCwhgrdaLH fUrJ+oAicPo4YFUfxGt64KbUmmfL528lmlD2y5pEcWmnrI+LBufGybQu58d6LAUt 8AQ5+VHGZ3+URkprR6D++/qrCdfIYk82dWsKRJ9ZM2mxy6yv2vFw6U4t012oIKOw lTSuPXOB+Zu59dSzrJCXMGDu3w= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.7 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: limerock03.mail.cornell.edu X-CornellRouted: This message has been Routed already. Message-ID: <54456964.4090007@cornell.edu> Date: Mon, 20 Oct 2014 15:58:28 -0400 From: Ken Brown User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: Threads References: <54450835 DOT 3050602 AT cornell DOT edu> <20141020164324 DOT GA32374 AT calimero DOT vinschen DOT de> <20141020190350 DOT GB32374 AT calimero DOT vinschen DOT de> In-Reply-To: <20141020190350.GB32374@calimero.vinschen.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes On 10/20/2014 3:03 PM, Corinna Vinschen wrote: > On Oct 20 18:43, Corinna Vinschen wrote: >> On Oct 20 09:03, Ken Brown wrote: >>> When trying to debug emacs in gdb, I see several threads, but it's not >>> always clear who created those threads and what they're doing. As an >>> example, I attached gdb to an emacs-X11 process (running under X) shortly >>> after starting it, and I obtained the backtrace appended at the end of this >>> message. >>> >>> I assume Thread 12 was created by gdb. >> [...] >>> I don't >>> have any idea where the other threads came from. Presumably at least one of >>> them was created by Glib. >>> >>> The situation is similar with emacs-w32 and emacs-nox, but with fewer threads. >>> >>> In general, is there a way I can understand where all the threads come from? >> >> There's no simple generic way to do that, afaik. >> >> One big problem is to have all the symbols. You should definitely >> install the debuginfo packages of all potentially affected packages, not >> only cygwin-debuginfo. If you want to find out where threads are called >> from the application, you might get a clue by running emacs under GDB and >> set a breakpoint to pthread_create. > > Btw., I don't know if that helps, but the function names of native > Windows functions given in the GDB backtrace may be off because GDB > doesn't have access to the Windows DLL symbol tables. If you want to > analyze the stacks from that side, you should install WinDbg(*) and the > symbol files for your OS(**). If you start the process from WinDbg, you > can better see the Windows functions called from these threads, while > not getting any info about the functions from inside the application > or the Cygwin DLLs. Thanks, I'll give that a try. > One of the headaches when porting is sometimes the ABI. While on Linux > the first 6 arguments to a function are given in registers, on Windows > only 4 args are in registers. This can result in bugs when calling > functions with more than 4 parameters, which are invisible on Linux, due > to the way 32 bit parameter are stored in registers on x86_64. This > happened to us already for at least one package. Am I right in thinking this can only be an issue if the source includes assembler code? Ken -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple