From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 125020 invoked by alias); 30 Mar 2015 19:15:56 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 124957 invoked by uid 89); 30 Mar 2015 19:15:55 -0000 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 Received: from out.ipsmtp2nec.opaltelecom.net (HELO out.ipsmtp2nec.opaltelecom.net) (62.24.202.74) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Mon, 30 Mar 2015 19:15:54 +0000 X-SMTPAUTH: drstacey@tiscali.co.uk X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2CXAQD5nxlV//he0lUNT4NYXIMTwiWFdgMCAoIFAQEBAQEBhRIBAQQjFUARCxgCAgUWCwICCQMCAQIBRRMIAQG6M3CZAgEBAQcBAQEBHoEhigiCZYIaFoJSgUUFjk6Ff4cfOoJ4glqJRYNIhBFugkMBAQE X-IPAS-Result: A2CXAQD5nxlV//he0lUNT4NYXIMTwiWFdgMCAoIFAQEBAQEBhRIBAQQjFUARCxgCAgUWCwICCQMCAQIBRRMIAQG6M3CZAgEBAQcBAQEBHoEhigiCZYIaFoJSgUUFjk6Ff4cfOoJ4glqJRYNIhBFugkMBAQE Received: from 85-210-94-248.dynamic.dsl.as9105.com (HELO [192.168.1.2]) ([85.210.94.248]) by out.ipsmtp2nec.opaltelecom.net with ESMTP; 30 Mar 2015 20:15:49 +0100 Message-ID: <5519A0E1.6020707@tiscali.co.uk> Date: Mon, 30 Mar 2015 19:17:00 -0000 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@cygwin.com Subject: Re: static vs. shared linking References: <5510A9AB.7020607@tiscali.co.uk> <5511AF73.9070607@tiscali.co.uk> <20150325090453.GB3017@calimero.vinschen.de> <551339E4.60705@tiscali.co.uk> <20150330105529.GJ29875@calimero.vinschen.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 X-SW-Source: 2015-03/txt/msg00533.txt.bz2 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