Thrift
  1. Thrift
  2. THRIFT-671

Ruby compact protocol implementation gets mixed up when there are fields that don't fit in the delta space

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.2
    • Fix Version/s: 0.3
    • Component/s: Ruby - Library
    • Labels:
      None

      Description

      I ran into an interesting bug today. I had a struct with a field whose id was greater than could be represented by in the delta space. The protocol specifies that when this occurs, we follow the type byte with a varint that contains the actual field value.

      The problem comes in that when we go to the varint, we don't pop the previous field id value off of the stack, leaving it in place for the next operation. Sometimes, this probably doesn't even cause a problem, as if it's the last field in the entire serialized data, it won't get in the way.

      Both the ruby and c versions of the protocol seem to be affected by this issue.

      1. thrift-671.patch
        3 kB
        Bryan Duxbury

        Activity

        Hide
        Bryan Duxbury added a comment -

        This patch adds a test to isolate the problem and fixes it. I'll commit this shortly.

        I also took this opportunity to bump the gem version up to 0.2.0.

        Show
        Bryan Duxbury added a comment - This patch adds a test to isolate the problem and fixes it. I'll commit this shortly. I also took this opportunity to bump the gem version up to 0.2.0.
        Hide
        David Reiss added a comment -

        Please commit separate changes as separate revisions.

        Show
        David Reiss added a comment - Please commit separate changes as separate revisions.
        Hide
        Bryan Duxbury added a comment -

        Noted.

        I just committed this.

        Show
        Bryan Duxbury added a comment - Noted. I just committed this.

          People

          • Assignee:
            Bryan Duxbury
            Reporter:
            Bryan Duxbury
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development