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

Avro C Resolved reader does not initialize children of arrays, resulting in segmentation faults

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.6.2
    • 1.6.3
    • c
    • None
    • GNU/Linux Ubuntu 11.10 64-bit

    Description

      As I did in AVRO-984, I created a test program that creates an avro
      value corresponding to the following schema:

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

      The avro_value is then resolved using a resolved_reader, and an
      attempt is made to read from the resolved_reader. This results in a
      segmentation fault on Linux.

      I believe this issue is similar to the issue in AVRO-984, in which
      nested arrays did not work because avro_resolved_array_writer_init()
      did not recursively call the init function on its children. In that
      case the initialization had to be deferred until a new item was
      appended to the array.

      I believe that avro_resolved_array_reader_init() should also
      recursively call the init function on its children, in a deferred
      manner as in AVRO-984, but I don't know how to implement this yet.

      I will attach a test program that shows the crash.

      Thanks,
      Vivek

      Attachments

        1. avro-1034-test-2.c
          13 kB
          Vivek Nadkarni
        2. avro-1034-test.c
          12 kB
          Vivek Nadkarni
        3. AVRO-1034.patch
          0.6 kB
          Vivek Nadkarni
        4. 0001-AVRO-1034.-C-Resolved-reader-initializes-child-array.patch
          14 kB
          Douglas Creager
        5. 0001-AVRO-1034.-C-Resolved-reader-initializes-child-array.patch
          16 kB
          Douglas Creager

        Activity

          People

            Unassigned Unassigned
            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