Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-587

TNonblockingServer connect code fails on 64-bit OS

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.1
    • 0.2
    • C++ - Library
    • None
    • Mac Os X 10.6.1 (Snow Leopard)

    • Patch Available

    Description

      The non-blocking stress test gets SIGABORT if more than 2 clients try to connect.

      The reason for this is in TNonblockingServer::handleEvent(). It sets addrLen once, before the loop that calls accept(), but accept() writes the size of the stored address into the addrLen pointer argument. Running on OS X 10.6.x, the returned value is 28, where it was originally 16. The second call to accept() overwrites the stack canary data and __stack_chk_fail gets called and we're toast.

      The fix is to reinitialize addrLen at the end of the loop before we call accept() again.

      I will attach a patch.

      Attachments

        1. Jira587Patch.txt
          0.6 kB
          Rush Manbert

        Activity

          People

            Unassigned Unassigned
            rush Rush Manbert
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: