[ 
https://issues.apache.org/jira/browse/THRIFT-3267?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14641357#comment-14641357
 ] 

Simon South edited comment on THRIFT-3267 at 7/25/15 2:50 AM:
--------------------------------------------------------------

The attached patch fixes this issue.

The cause is the test routine in {{testthrifttestclient.cpp}} trying to unref 
an exception object after a service method has thrown an application exception. 
In C (GLib) application exceptions are returned as error codes, not exception 
objects, so the code actually attempts to unref a null pointer.

The relevant lines in the generated code are 
{{gen-c_glib/t_test_thrift_test.c}}:3827-8:

{code}
g_set_error (error, THRIFT_APPLICATION_EXCEPTION_ERROR, xception->type, 
"application error: %s", xception->message);
g_object_unref (xception);
{code}



was (Author: simonsouth):
The attached patch fixes this issue.

The cause is the test routine in {{testthrifttestclient.cpp}} trying to unref 
an exception object after a service method has thrown an application exception. 
In C (GLib) application exceptions are returned as error codes, not exception 
objects, so the code actually attempts to unref a null pointer.

The relevant lines in the generated code are 
{{gen-c_glib/t_test_thrift_test.c}}:3827-8.

> c_glib: "Critical" failure during unit tests
> --------------------------------------------
>
>                 Key: THRIFT-3267
>                 URL: https://issues.apache.org/jira/browse/THRIFT-3267
>             Project: Thrift
>          Issue Type: Bug
>          Components: C glib - Library
>    Affects Versions: 1.0
>         Environment: Fedora 20 (gcc 4.8.3) on x86_64
>            Reporter: Simon South
>            Assignee: Simon South
>            Priority: Trivial
>              Labels: c_glib
>         Attachments: 0001-thrift-3267-critical-failure-during-unit-tests.patch
>
>
> When running the unit tests for C (GLib) (in {{lib/c_glib/test}}), the 
> execution of {{testthrifttestclient}} fails at one point with
> {code}
> (process:3828): GLib-GObject-CRITICAL **: g_object_unref: assertion 
> 'G_IS_OBJECT (object)' failed
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to