Uploaded image for project: 'Core ReactOS'
  1. Core ReactOS
  2. CORE-10937

ws2_32 fails to clear write_fd flag for sending when msafd buffer is full

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • Networking
    • None

    Description

      In recent version of ws2_32 wine tests there is a test that checks if write flag is cleared (caller should stop calling send) when msafd/tcpip data queue is full.
      the test is doing infinite send of 1KB data until flag is cleared:

      while(1) {
              FD_ZERO(&writefds);
              FD_SET(fdWrite, &writefds);
              ret = select(fdWrite+1, NULL, &writefds, NULL, &select_timeout);
              if(!ret) break;
              ok(send(fdWrite, tmp_buf, sizeof(tmp_buf), 0) > 0, "failed to send data\n");
      }

      and msafd/tcpip use a lot of non-paged memory to copy the data until it is sent, but they never clear properly the bit that they are full.
      Let me explain a little bit more what happens, because all 3 parts should work together to resolve this issue properly.
      ws2_32 sends data to msafd, msafd checks its buffer and sends it to tcpip, tcpip puts it into lwip queue for sending (this is how lwip operates) and gets sent, at this point tcpip tells msafd it has sent the data, so msafd marks it as sent and that buffer is empty, but... there is another queue (in lwip) with sent, but unACKed (yet) packets, that wait. I tried several ways to mark this situation from tcpip to msafd (msafd should clear the flag for sending), but I wasn't successful in this endeavor.
      I hope this additional information will help someone.

      Attachments

        Issue Links

          Activity

            People

              bug zilla Bug Zilla
              hater hater
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated: