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

Binary+compact protocol single byte error in Ruby library (ARM architecture): caused by different char signedness

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.9
    • 0.9.1
    • None
    • Patch Available

    Description

      These compilation tests fail when compiling for ARM:

      1) BinaryProtocolAccelerated it should behave like a binary protocol should read a byte
      Failure/Error: @prot.read_byte.should == i
      expected: -128
      got: 128 (using ==)
      Shared Example Group: "a binary protocol" called from ./spec/binary_protocol_accelerated_spec.rb:28

      1. ./spec/binary_protocol_spec_shared.rb:291:in `block (3 levels) in <top (required)>'
      2. ./spec/binary_protocol_spec_shared.rb:289:in `each'
      3. ./spec/binary_protocol_spec_shared.rb:289:in `block (2 levels) in <top (required)>'

      2) BinaryProtocolAccelerated it should behave like a binary protocol should perform a complete rpc with a struct return type
      Failure/Error: result.should == Fixtures::COMPACT_PROTOCOL_TEST_STRUCT
      expected: <CompactProtoTestStruct ... byte_list:[-127, -1, 0, 1, 127], ....
      got: <CompactProtoTestStruct ... byte_list:[129, 255, 0, 1, 127], ... (using ==)
      (***) only byte_list gets corrupted
      Shared Example Group: "a binary protocol" called from ./spec/binary_protocol_accelerated_spec.rb:28

      1. ./spec/binary_protocol_spec_shared.rb:375:in `block (3 levels) in <top (required)>'
      2. ./spec/binary_protocol_spec_shared.rb:406:in `call'
      3. ./spec/binary_protocol_spec_shared.rb:406:in `srv_test'
      4. ./spec/binary_protocol_spec_shared.rb:370:in `block (2 levels) in <top (required)>'

      3) Thrift::CompactProtocol should encode and decode naked primitives correctly
      Failure/Error: read_back.should == value
      expected: -127
      got: 129 (using ==)

      1. ./spec/compact_protocol_spec.rb:45:in `block (4 levels) in <top (required)>'
      2. ./spec/compact_protocol_spec.rb:37:in `each'
      3. ./spec/compact_protocol_spec.rb:37:in `block (3 levels) in <top (required)>'
      4. ./spec/compact_protocol_spec.rb:36:in `each_pair'
      5. ./spec/compact_protocol_spec.rb:36:in `block (2 levels) in <top (required)>'

      4) Thrift::CompactProtocol should encode and decode primitives in fields correctly
      Failure/Error: read_back.should == value
      expected: -127
      got: 129 (using ==)

      1. ./spec/compact_protocol_spec.rb:68:in `block (4 levels) in <top (required)>'
      2. ./spec/compact_protocol_spec.rb:55:in `each'
      3. ./spec/compact_protocol_spec.rb:55:in `block (3 levels) in <top (required)>'
      4. ./spec/compact_protocol_spec.rb:51:in `each_pair'
      5. ./spec/compact_protocol_spec.rb:51:in `block (2 levels) in <top (required)>'

      Finished in 5.87 seconds
      364 examples, 4 failures, 1 pending

      Attachments

        1. THRIFT1804.patch
          0.6 kB
          Elias Karakoulakis

        Activity

          People

            ekarak Elias Karakoulakis
            ekarak Elias Karakoulakis
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: