bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bug in close() ?


From: Or Goshen
Subject: Bug in close() ?
Date: Mon, 30 Sep 2013 10:17:25 +0300

Hi

When I add the modules socket and close and use a simple program that only creates a socket and closes it I get the following error in gdb:

gdb: unknown target exception 0xc0000008 at 0x774d12f7

Program received signal ?, Unknown signal.
0x776815de in ntdll!LdrQueryProcessModuleInformation () from C:\Windows\system32\ntdll.dll
(gdb)
Single stepping until exit from function ntdll!LdrQueryProcessModuleInformation,
which has no line number information.
[New Thread 12024.0x27d0]

Apparently this happens during close() where in the file sockets.c it closes the socket handle using closesocket() and then the file descriptor using _close(). The call to _close() fails with this signal.
According to MSDN after the call to closesocket() all the resources are freed (so why call _close() ?). In MSDN you can see that if you pass a bad fd to _close() it will invoke "the invalid parameter handler" (which is this signal ?) unless a handler is register (I dont see it happening in the gnulib code).

What I do is simply comment out the call to _close().

Maybe apply this simple fix to the code ?

Thanks,

Or

reply via email to

[Prev in Thread] Current Thread [Next in Thread]