delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/12/07/11:28:34

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Fri, 7 Dec 2001 16:26:33 GMT
From: Cliff Hones <cliff AT aonix DOT co DOT uk>
Message-Id: <200112071626.QAA09145@trillian.uk.aonix.com>
To: DrScott AT gmx DOT de
CC: cygwin AT cygwin DOT com
In-reply-to: <14214257250.20011207010527@gmx.de> (message from Henning Moll on
Fri, 7 Dec 2001 01:05:27 +0100)
Subject: Re: problems with dlopen
References: <14214257250 DOT 20011207010527 AT gmx DOT de>

> Why does this code fail with segfault?
> I think the problem is that dlopen calls malloc itself? Is that right?
> Any suggestions how to fix it?

If your suspicion is correct, then simply moving "state = 1" to before
the call of dlopen should do the trick, i.e.:

                case 0:
                        state = 1;
                        handle = dlopen("cygwin1.dll", RTLD_NOW);
                        orig_malloc = (void *(*)(size_t)) dlsym (handle, "malloc");
                        /*fall through*/
-- Cliff

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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