X-Recipient: archive-cygwin@delorie.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=GuzmSW3wfedbaaiRanJy03f1Dqzqhill7/vGFkgqkP+
	qo887D9xjBQDgLC98C4aqMoHrYpPnNd7zhugjQKmiZEXVfHBv4EVxjJS7KihOpsx
	A0ZaJCiNYOJzmked9kc7Z3PrfcdwJHTHfirSgmyoG7Hv3vEwjpOF0NUJ4XHrPi7o
	=
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=mu3zR2YC7eYTYrLokD9+t4u9mns=; b=RVdNSCKVLB7zeXHXY
	FBxzMJ3L0I6rkJS5zD6NzBvaRSj4MGX4TTJvqnSbnnaD+XxBO8s9cW3e8XfkNyFT
	F6HsUcfKHns/ark/BBfZ9mT3EX8kIVRIbaYJ4WxbwjdhVA2GF57SdXfk24CYwN9/
	Hlp8bPRUZRGqkNDoPgZJeClfNs=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=4.9 required=5.0 tests=AWL,BAYES_40,FREEMAIL_FROM,KAM_COUK,KAM_FROM_URIBL_PCCC,SPF_PASS autolearn=no version=3.3.2
X-HELO: out.ipsmtp1nec.opaltelecom.net
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: A2CWAQDZOBNV/wVe0lUNT4NYWoMSwgSFLEkCgicBAQEBAQGFEgEBBCMVUQsYAgIFIQICDwJGEwgBAYg4rwJwmiIBAQEBAQUBAQEBAQEBAQEZgSGKAIR9FoJSgUUFjkKFfYcbOoJ2jBqDR4QQbwGCQgEBAQ
X-IPAS-Result: A2CWAQDZOBNV/wVe0lUNT4NYWoMSwgSFLEkCgicBAQEBAQGFEgEBBCMVUQsYAgIFIQICDwJGEwgBAYg4rwJwmiIBAQEBAQUBAQEBAQEBAQEZgSGKAIR9FoJSgUUFjkKFfYcbOoJ2jBqDR4QQbwGCQgEBAQ
Message-ID: <551339E4.60705@tiscali.co.uk>
Date: Wed, 25 Mar 2015 22:42:44 +0000
From: David Stacey <drstacey@tiscali.co.uk>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; 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>
In-Reply-To: <20150325090453.GB3017@calimero.vinschen.de>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes

On 25/03/2015 09:04, Corinna Vinschen wrote:
> On Mar 24 18:39, David Stacey wrote:
>> On 24/03/2015 00:02, David Stacey wrote:
>>> I've been having difficulty building poco-1.6.0 for Cygwin for some
>>> time. I've managed to produce a test case that shows the problem:
>>>
>>> https://dl.dropboxusercontent.com/u/119453582/Cygwin/crashtest.tar.xz
>>>
>>> This archive contains source files that produce a very simple library.
>>> When linked statically, the code works fine. However, when linked as a
>>> shared DLL, the test crashes with a core dump. The behaviour is
>>> identical on x86 and x86_64 architectures.
>>>
>>> Have I made a stupid error in the compilation of the shared case, or is
>>> something more interesting going on?
>>   
>> I don't know if anyone has managed to look at this. I haven't had a deluge
>> of e-mails telling me that I've done something silly (which is a shame,
>> because then I could fix it quickly and move on). For the sake of a straw to
>> clutch at, I tried compiling with clang++ rather than g++, and got the same
>> result:
>>   
>>        $ ./go.sh
>>        Running test (static link)...
>>        Done.
>>   
>>        Running test (shared link)...
>>        ./go.sh: line 19:  3744 Aborted                 (core dumped)
>> ./shared_test
>>        Done.
>>   
>> Any help or hints would be greatly appreciated.
> For a start, you should contemplate to build your test with -g to allow
> debugging.  Then you can run the testcase under GDB and get (more or less)
> useful output.  The crash occurs in a delete call, afaics.  If you
> install the cygwin-debuginfo package, addr2line returns something like this
> as the call stack (non-required path components removed):
>
> [...]/cygwin/exceptions.cc:1247
> [...]/cygwin/exceptions.cc:1501
> [...]/cygwin/sigproc.cc:717
> [...]/cygwin/signal.cc:252
> [...]/cygwin/signal.cc:303
> [...]/cygwin/signal.cc:313
> [...]/cygwin/signal.cc:289
> [...]/cygwin/signal.cc:375

Thank you for your comments - they were really helpful. Yes, I should 
have specified '-g' on the command line - that was an omission on my 
part - sorry.

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.

Many thanks,

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

