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=wXyt4Delk8puYST4rvSeIBGwZi38Z55puRyrbBW1DLX plcLE4XEo1cq7b4TtLHYiOHuhPECvw+NmUAuBKgSUbQknUJas6Hyj3HPTVuQzFyV lm0uU5ZJEZ8bsdxKAGQp8+nzfFyUZ9Jwxt3/Jr0HilJGe1GkXcZzDefUC717QA9c = 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=bTVaD1GArwVsd0vWHmYgmFegvRM=; b=hH55f4KP8gpA67Zut PaaHA3xHLtU2YUinxIIffAkY8r3MWyDa0lPP3bY8FiZ1nPwHE2vDnQ0m+wxVJkl7 YS3GZZFUFOB1JVmpn0hzeocHLNPomUA1l+MSZJrt9eznBVCA0iSuAUgXQmU7orVb 1lOSdAC4xrbdKMWMhwI5X8TeHI= 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=3.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,KAM_COUK,KAM_FROM_URIBL_PCCC,SPF_PASS autolearn=no version=3.3.2 X-HELO: out.ipsmtp2nec.opaltelecom.net X-SMTPAUTH: drstacey AT tiscali DOT co DOT uk X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2CXAQD5nxlV//he0lUNT4NYXIMTwiWFdgMCAoIFAQEBAQEBhRIBAQQjFUARCxgCAgUWCwICCQMCAQIBRRMIAQG6M3CZAgEBAQcBAQEBHoEhigiCZYIaFoJSgUUFjk6Ff4cfOoJ4glqJRYNIhBFugkMBAQE X-IPAS-Result: A2CXAQD5nxlV//he0lUNT4NYXIMTwiWFdgMCAoIFAQEBAQEBhRIBAQQjFUARCxgCAgUWCwICCQMCAQIBRRMIAQG6M3CZAgEBAQcBAQEBHoEhigiCZYIaFoJSgUUFjk6Ff4cfOoJ4glqJRYNIhBFugkMBAQE Message-ID: <5519A0E1.6020707@tiscali.co.uk> Date: Mon, 30 Mar 2015 20:15:45 +0100 From: David Stacey User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: static vs. shared linking References: <5510A9AB DOT 7020607 AT tiscali DOT co DOT uk> <5511AF73 DOT 9070607 AT tiscali DOT co DOT uk> <20150325090453 DOT GB3017 AT calimero DOT vinschen DOT de> <551339E4 DOT 60705 AT tiscali DOT co DOT uk> <20150330105529 DOT GJ29875 AT calimero DOT vinschen DOT de> In-Reply-To: <20150330105529.GJ29875@calimero.vinschen.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes On 30/03/15 11:55, Corinna Vinschen wrote: > On Mar 25 22:42, David Stacey wrote: >> I've never had much joy out of addr2line before, and I'm struggling to >> recreate what you've done. I've added '-g' to the command line, run 'go.sh' >> again. This generates a fresh stackdump file, and then I do: >> >> awk '/^[0-9]/{print $2}' shared_test.exe.stackdump | addr2line -f -e >> shared_test.exe >> >> but I just see question marks. Please could you show the exact lines you're >> using. > addr2line is a bit dumb and needs help. What I do is to cat the > stackdump file and look at the addresses. They usually show where > the stuff comes from: > > $ gawk '/^0/{print $2}' mkgroup.exe.stackdump > 7FFBDC82DDB6 > 001800FEC36 > 001800FE188 > 001800CF471 > 001800CF53D > 0018007EAC1 > 00100402DE6 > 00180049411 > 00180046369 > 00180046180 > 00180049488 > 00100401351 > 00100401010 > 7FFBD9FE13D2 > 7FFBDC85EB64 > > The 7f addresses are from OS DLLs you can't read with addr2line. > 0018xxx is the Cygwin DLL, 0010xxx is the application itself. Other > addresses are other DLLs. Just check the addresses against > /etc/rebase.db.x86_64. > > Then call addr2line for each object file, e.g.: > > $ addr2line -e /usr/bin/cygwin1.dll 001800FEC36 001800FE188 001800CF471 > [...]/cygwin/passwd.cc:576 > [...]/cygwin/passwd.cc:353 > [...]/cygwin/grp.cc:413 > $ addr2line -e /usr/bin/mkgroup.exe 00100401351 00100401010 > /usr/src/debug/cygwin-1.7.35-1/winsup/cygwin/lib/cygwin_crt0.c:22 > /usr/src/debug/cygwin-1.7.35-1/winsup/cygwin/crt0.c:34 Thank you for your reply and the explanation. That requires quite a bit of knowledge before addr2line is usable - no wonder I've never had anything sensible out of it before! Back to the matter in hand - I don't suppose you had thoughts on why my simple application crashes when linked as shared, but works fine when linked statically? Dave. -- 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