delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2014/02/19/08:39:27

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:mime-version:in-reply-to:references:date
:message-id:subject:from:to:content-type; q=dns; s=default; b=vq
O5JxstGZBs7NP8+a98ufYHTFTJ/KIsrfT/4iRh4HADpW58M+ubvXjOjvO9Iojgii
qcpUO33457yIiJlNf89UQ4+Gsu2v8Nwr620y3tlaTv/ZnvBKBCxGAukQfI84emo0
/lGd7qIvCSjCeooOMmxdLaRtb443aK64DUPpjeo6E=
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:mime-version:in-reply-to:references:date
:message-id:subject:from:to:content-type; s=default; bh=4UK/m7V9
XXDXf90rL/feLo/4VKs=; b=Z9Nk6Vhg/A+zeNLQoKg3JsOEMDba+P1iekPonErz
D7TbP8EyACFe2KAEyPTzcXfEBI9giAlVfastaR05W0QhuIyizkRxOqkVOI4JUCXk
4uuMl4zNQI4jd7H7vfo7Nqtqel6aPZyRM0oOOdVj1Zxv3FRCNXUcPDuLf/TTO1pk
k1w=
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: No, score=-0.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2
X-HELO: mail-lb0-f181.google.com
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=w/O+u+PNlKsGY2s1H62qwCkXFgrxByM0FEpfNmzfOlk=; b=i4VLF3EnBI2ExJmHRPXl/DpF264wxL2pYK3PaELsTCI2JbNE3Rpju9Owz5SmtcaD+4 HOjpCwTt3YO4y0aXhj/NR4ZT5GGDHUEjzhbXPiSsvI1cmdyYfbzTaVPzxaqWCl7MEmcw g8NPv34v98/WD7X4aN9X36BdCijlksjWcUkuTpHTZ3Co5mDGEovr0k7ICm9AACLN0O7q RpsxSHd+P0KNfIMAh1pMjib4utpJkYnrSc4w7GbvZOPE6pvJr8jmaK8UuXpPLRLfijgC 2DmPv9G1z4mcqHM8X9B81m/GpGEn3OV2hpoik2Rji1M8CcYo1YSgTYgydIbIDE32O16I S65g==
X-Gm-Message-State: ALoCoQlwaNveImGJjMRgRSg7hM3mTsJOw52ZaIbfYr14SAiNCEtek31ETucJw/vMe0A4FSgogW5t
MIME-Version: 1.0
X-Received: by 10.112.205.5 with SMTP id lc5mr10341035lbc.40.1392817132850; Wed, 19 Feb 2014 05:38:52 -0800 (PST)
In-Reply-To: <CAMzR4E63GYJPeNx27vpX5kBAFbrXDtS0k81pi5=SfKAV8fQteA@mail.gmail.com>
References: <CAMzR4E63GYJPeNx27vpX5kBAFbrXDtS0k81pi5=SfKAV8fQteA AT mail DOT gmail DOT com>
Date: Wed, 19 Feb 2014 14:38:52 +0100
Message-ID: <CAMzR4E4jeO45W5wn4ehdwTaZ_gSKPrrEV49OjnfWwjAj3k0ZDg@mail.gmail.com>
Subject: Fwd: Bug with dlopen() and fork()
From: Jaime Fabregas Fernandez <jaime DOT fabregas AT tarlogic DOT com>
To: cygwin AT cygwin DOT com

Library references loaded by a process using dlopen() and dlsym() are
no more valid in child processes after running a fork(). Calls from
child process will never return.

I've searched for a similar problem in the mailing lists and found
this unanswered thread from 2001:

http://cygwin.com/ml/cygwin/2001-02/msg01225.html


I'm running cygwin64. This behaviour can be checked with the following
test program:

========================================================
#include <stdio.h>
#include <dlfcn.h>

int (*myopen)(const char *);

main(){
        void *handle;
        int ret;
        handle = dlopen("my_lib.dll", RTLD_LAZY);
        myopen = dlsym(handle, "mylib_open");

        if( ! fork() ){
                ret = myopen("");
                printf("This printf never shows, call to myopen will
block for ever\n");
        }
        else{
                ret = myopen("");
                printf("%i\n", ret);
                sleep(1);
        }
}
========================================================

Same program runs correctly (showing the two printf's) in a Linux environment.

Thanks

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