 <p>Without looking at the docs, the call to g_socket_receive looks bogus. The buffer arg is null - what is the function meant to do with that (it could mean it will allocate its own buffer). Are you sure it isn't mean to be &amp;buffer?</p> <p>&lt; edit></p> <p>Nope, it's a char* that is supposed to be allocated with at least size bytes. Yours is null. that will do it.</p> <p>&lt; /edit ></p>