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

c_glib: Seg fault when deserializing a map with typedef'd keys

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 0.9.1
    • Fix Version/s: 0.9.2
    • Component/s: C glib - Compiler
    • Labels:
    • Environment:

      Fedora 20 64-bit on x86_64

    • Patch Info:
      Patch Available

      Description

      In the c_glib implementation, attempting to deserialize a map that uses a typedef'd type for its keys will usually result in a segmentation fault.

      This is because the code in the compiler that generates a variable declaration for a pointer to key values fails to first resolve the typedef to its underlying type. In most cases it will therefore generate incorrect code, effectively allocating a variable on the stack but later using it as though it were a pointer.

      The attached patch fixes this. (No test case is provided, but the integration test implementation I'm about to submit relies on this patch.)

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                simonsouth Simon South
                Reporter:
                simonsouth Simon South
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: