Stack Overflow exception (0xC00000FD) at winsock select RRS feed

  • Question

  • Hello,

    I have an application which makes use of winsock. I/O part is handled on an other thread. And I am using blocking select method for sockets. But the point is that after 5-6 hours,my application gives 0xC00000FD exception, at the line of select function.

    As far as I know, this exception occurs when there is recursion, or very large local variables. But neither of them is the case for me.

    So do you have any idea why am I getting this exception? Or any ideas to discover what actually causes exception?

    It is a server socket with a one client connected. So there is 2 socket in rset and 1 in wset. After selecting, I am checking all ready sockets and making required, read,write,accept. Timeout is 250 ms. Do you think can this be the problem? I don't want this function to be blocking so it is not null. But what will be the exact difference if I use {0,0}

    An important hint is: 
    Same code was working without any problem, when client socket wasn't sending any data. But when I started sending some data from client to server this problem occured.
     I am sure that there is no problem with FD_SETs and FD_CLRs, I mean when client was not sending only 1(server) socket was in rset and 1(client) was in wset. So why it is working without problem when client doesn't send any data, but giving stack overflow exception when client sends data?

    Anyway I had a look a lot of samples, but it seems that there is not a difference.

    Please see local variables screenshot below(I have deleted name of executable, since it is a commercial product) http://img192.imageshack.us/img192/1948/stackoverflow.jpg

    And here is the call stack: ntdll.dll!7c90df3a()
    [Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll] mswsock.dll!71a53c9c()

    xyz.exe!vm_socket_select(vm_socket * hds=0x04c1fb84, int nhd=1, int masks=7) Line 230 + 0x1b bytes C
    xyz.exe!ND::nd_socket::SocketThreadProc() Line 173 + 0x12 bytes C++
    xyz.exe!ND::nd_socket::ThreadRoutineStarter(void * u=0x07d63f90) Line 332 C++
    xyz.exe!_callthreadstartex() Line 348 + 0x6 bytes C
    xyz.exe!_threadstartex(void * ptd=0x011a3ce8) Line 326 + 0x5 bytes C

    I am waiting for any advice. 

    Many thanks

    Wednesday, February 10, 2010 8:38 AM