delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2015/03/25/18:48:56

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=v1KdOZNcHCzaVMHIe27X7LDsZ6nlGvRsDi07xNio0Q8
E3WQQKZIGrox0pEmCQJLewe5PAju+m6lyR4eHamnvQ1GgZ06xC7XtPXGXO/2MyEt
iNQ2Bc6AOSauHcqXprBbAosvNmBjngbTAUwvSZH4hK3XzRX6fczsBFIgq9QBvjlM
=
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=7OSZmu+e9neXPxRRSrkYkhHUIEo=; b=sLzkSCpsi67UxEdat
glyIzwIcUnHwmSzoPygxOsm1wLSAKBOvJtPoPGwHpmGA9f52IXs1Vuagoo5gPT63
x0LQxTVSflE9VhE4EolTBJg9jkddqHLUEjbX0Pdz4OgapLqJu4PvTX4sAxVZ0kqB
Pf1/CBK9xzYAVGcmURMihrtslI=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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: Yes, score=5.3 required=5.0 tests=AWL,BAYES_50,FREEMAIL_FROM,KAM_COUK,KAM_FROM_URIBL_PCCC,SPF_PASS autolearn=no version=3.3.2
X-HELO: out.ipsmtp2nec.opaltelecom.net
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: A2CWAQB+OhNV/wVe0lUNT4dExSeCUgKCJwEBAQEBAYUSAQEEIw8BBVELGAICBSECAg8CRhMIAQG3P3CaIwEBAQcBAQEBAQEcgSGKAIR9FoJSgUUFjkKIIYR3j0qDR4IkHIFQgzIBAQE
X-IPAS-Result: A2CWAQB+OhNV/wVe0lUNT4dExSeCUgKCJwEBAQEBAYUSAQEEIw8BBVELGAICBSECAg8CRhMIAQG3P3CaIwEBAQcBAQEBAQEcgSGKAIR9FoJSgUUFjkKIIYR3j0qDR4IkHIFQgzIBAQE
Message-ID: <55133B41.80108@tiscali.co.uk>
Date: Wed, 25 Mar 2015 22:48:33 +0000
From: David Stacey <drstacey AT tiscali DOT co DOT 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 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> <850E2E37-EA86-448E-9B9F-206C662E14E5 AT etr-usa DOT com> <55133295 DOT 1090105 AT tiscali DOT co DOT uk>
In-Reply-To: <55133295.1090105@tiscali.co.uk>
X-IsSubscribed: yes

On 25/03/2015 22:11, David Stacey wrote:
> On 25/03/2015 16:59, Warren Young wrote:
>> If that makes the symptom disappear, I wonder if there’s some problem 
>> with a Cygwin *.exe owning a std::string that gets resized by a 
>> Cygwin *.dll.  If so, that probably*is*  a memory ownership 
>> coordination problem that affects Cygwin proper.
>
> In order to test your hypothesis about memory ownership, I'll create a 
> test that malloc(3)s some memory in the .exe and free(3)s it in a 
> shared library; Corinna showed that the crash was coming from an 
> abort() in free(). However, I can't believe it's that simple - you'd 
> think there would be dozens of programmes crashing for this reason.

Indeed. I created a very simple test that alloc(3)s memory in main() and 
then free(3)s it in a shared library. That works fine. So there's more 
to it than that :-(

Dave.



// crash_library.h
#ifndef CRASH_LIBRARY_H
#define CRASH_LIBRARY_H

extern void Crash(unsigned short *ptr);

#endif // CRASH_LIBRARY_H



// crash_library.cpp
#include "crash_library.h"
#include <stdlib.h>

void Crash(unsigned short *ptr)
{
   free(ptr);
}



// main.cpp
#include "crash_library.h"
#include <stdlib.h>

int main()
{
   unsigned short*ptr = (unsigned short*)malloc(sizeof(unsigned short));
   Crash(ptr);
   return 0;
}



--
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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019