You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Simon South (JIRA)" <ji...@apache.org> on 2014/08/31 05:27:52 UTC

[jira] [Created] (THRIFT-2683) c_glib: Seg fault when deserializing a map with typedef'd keys

Simon South created THRIFT-2683:
-----------------------------------

             Summary: c_glib: Seg fault when deserializing a map with typedef'd keys
                 Key: THRIFT-2683
                 URL: https://issues.apache.org/jira/browse/THRIFT-2683
             Project: Thrift
          Issue Type: Bug
          Components: C glib - Compiler
    Affects Versions: 0.9.1
         Environment: Fedora 20 64-bit on x86_64
            Reporter: Simon South
            Priority: Minor


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.)



--
This message was sent by Atlassian JIRA
(v6.2#6252)