You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@thrift.apache.org by Niclas Lockner <ni...@gmail.com> on 2013/08/18 17:55:42 UTC

Segfault with c_glib client

Hi,

I have some problems getting my c_glib client to work and I'm hoping
someone here can help.
I have attached both my client and my interface file. I'm using the master
branch of thrift, but I got the same error when I tried the 0.9.0 version
also.

So, the problem I'm having is that I get a segmentation fault when I try to
send my thrift struct to the server.
>From GDB:
user_storage_client_send_store (iface=0x6102c0, user=0x7fffffffe020,
    error=0x7fffffffe060) at user_storage.c:119
119    xfer += ret;
(gdb) n
120    if ((ret = thrift_struct_write (THRIFT_STRUCT (user), protocol,
error)) < 0)
(gdb) s
thrift_struct_get_type () at src/thrift/c_glib/thrift_struct.c:23
23 G_DEFINE_ABSTRACT_TYPE(ThriftStruct, thrift_struct, G_TYPE_OBJECT)
(gdb) n

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7992dec in g_type_check_instance_cast ()
   from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0


And the stack trace:

#0  0x00007f72baae0dec in g_type_check_instance_cast () from
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#1  0x0000000000402709 in user_storage_client_send_store (iface=0x14702c0,
user=0x7fff23617580, error=0x7fff236175c0)
    at user_storage.c:120
#2  0x0000000000402cb4 in user_storage_client_store (iface=0x14702c0,
user=0x7fff23617580, error=0x7fff236175c0)
    at user_storage.c:259
#3  0x0000000000401b7d in main (argc=1, argv=0x7fff236176e8) at client.c:52



Should the variable be initialized in some way before I can use it? Or am I
doing something else wrong?

Thanks in advance.
Niclas Lockner