This is the mail archive of the
mailing list for the Cygwin project.
Re: problems with dlopen
- From: Cliff Hones <cliff at aonix dot co dot uk>
- To: DrScott at gmx dot de
- Cc: cygwin at cygwin dot com
- Date: Fri, 7 Dec 2001 16:26:33 GMT
- Subject: Re: problems with dlopen
- References: <firstname.lastname@example.org>
> 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.:
state = 1;
handle = dlopen("cygwin1.dll", RTLD_NOW);
orig_malloc = (void *(*)(size_t)) dlsym (handle, "malloc");
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html