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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 0.9.1
    • 0.9.2
    • C glib - Compiler
    • Fedora 20 64-bit on x86_64

    • 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

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

              Dates

                Created:
                Updated:
                Resolved: