Uploaded image for project: 'Avro'
  1. Avro
  2. AVRO-984

Avro C - Resolved reader fails to read nested arrays and reads uninitialized memory

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.6.1, 1.6.2, 1.7.0
    • Fix Version/s: 1.6.2, 1.7.0
    • Component/s: c
    • Labels:
      None
    • Environment:

      GNU/Linux Ubuntu 11.10 64-bit

      Description

      Summary:

      I created a test program that creates an avro value corresponding to
      the following schema:

      {"type":"array", "items": {"type": "array", "items": "long"}}

      and tries to read it back using a matched and resolved reader. The
      matched reader is able to reconstruct the avro value, but the resolved
      reader fails to read the value.

      Additionally valgrind indicates that conditional jumps are being
      performed based on uninitialized memory, when trying to reconstruct
      the value using the resolved reader.

      More Details:

      I created a test program that creates an avro value corresponding to
      the following writer schema:

      {"type":"array", "items": {"type": "array", "items": "long"}}

      The avro value is serialized to memory.

      Then this memory is read back into two readers. In both cases the
      reader schema is set to be identical to the writer schema.

      The first reader is a matched reader – i.e. the reader knows that the
      writer and reader schema are identical.

      The second reader is a resolved reader – i.e. the reader tries to
      resolve differences between the writer and reader schema. The schemas
      should resolve perfectly, since the writer and reader schema are
      identical.

      When we try to deserialize the binary buffer with the matched reader,
      the value is reconstructed perfectly.

      When we try to deserialize the binary buffer with the resolved reader,
      the code fails to populate the avro value. This failure indicates that
      the resolved reading of the nested array not working
      properly. Additionally valgrind indicates that conditional jumps are
      being performed based on uninitialized values, in this second case.

      I will attach a test program that shows the issues.

        Attachments

        1. avro-984-test.c
          13 kB
          Vivek Nadkarni
        2. avro-984-output.txt
          1 kB
          Vivek Nadkarni
        3. avro-984-valgrind-output.txt
          18 kB
          Vivek Nadkarni
        4. resolved-writer.patch
          0.6 kB
          Douglas Creager
        5. avro-984-test-v2.c
          14 kB
          Vivek Nadkarni

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              vnadkarni Vivek Nadkarni
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 168h
                168h
                Remaining:
                Remaining Estimate - 168h
                168h
                Logged:
                Time Spent - Not Specified
                Not Specified