segfault in delete_handle(handle_list *)
Christopher Faylor
cgf@redhat.com
Wed Mar 26 22:33:00 GMT 2003
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
More information about the Cygwin-developers
mailing list