This is the mail archive of the
cygwin-developers@cygwin.com
mailing list for the Cygwin project.
Re: segfault in delete_handle(handle_list *)
- From: Christopher Faylor <cgf at redhat dot com>
- To: cygwin-developers at cygwin dot com
- Date: Wed, 26 Mar 2003 17:33:53 -0500
- Subject: Re: segfault in delete_handle(handle_list *)
- References: <3E821E23.5080900@hekimian.com>
- Reply-to: cygwin-developers at cygwin dot com
On Wed, Mar 26, 2003 at 04:39:47PM -0500, Joe Buehler wrote:
>It looks like this corresponds to "hl->next = hl->next->next;" in the code:
>
>static void __stdcall
>delete_handle (handle_list *hl)
>{
> handle_list *hnuke = hl->next;
> debug_printf ("nuking handle '%s'", hnuke->name);
> hl->next = hl->next->next;
> memset (hnuke, 0, sizeof (*hnuke));
>}
>
>The segfault indicates that hl->next is a bad pointer. But that doesn't
>make much sense because it was just dereferenced for the debug_printf().
>So that makes me suspect that there is a thread issue here.
>
>Before I dive in and try and figure this out, I have attached the
>fork() part of the strace output, in case the problem is obvious to someone
>who
>knows this part of Cygwin well. Is it possible that another thread is
>walking
>the same handle list at the same time?
Yes, when a process is exiting. You could try removing the '&& !exit_state' in
debug.cc and see if the problem goes away.
This wouldn't be an issue in a production DLL, fwiw.
cgf