Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Delivered-To: mailing list cygwin@cygwin.com Date: Fri, 7 Dec 2001 16:26:33 GMT From: Cliff Hones Message-Id: <200112071626.QAA09145@trillian.uk.aonix.com> To: DrScott@gmx.de CC: cygwin@cygwin.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.20011207010527@gmx.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/