[gnet-devel] tcp socket reading segfault
- From: "Hugo Calleja" <hugo calleja gmail com>
- To: gnet-devel-list gnome org
- Subject: [gnet-devel] tcp socket reading segfault
- Date: Wed, 24 Dec 2008 17:32:52 +0100
Hi
I am using gnet for a tcp socket server. The problem is that on freeing the data from a read event of one of the connections I get random segfaults.
The segfault comes from freeing the event -> buffer, because when I comment the line it doesnt segfault at all. I am pretty sure I am not fucking up since I am sending the data as a "const gchar *" to another function to be processed. Apart from reading it the only thing I am doing it is copying parts of it to a GString, but since that copies the data into anohter part of the memory, it can not be the problem. To make the socket listen I am using gnet_conn_read ( conn );.
I tried gnet like a year ago and it did had the same problem. A guy in a chat (dont remember who) was helpful and told me that was a bug in gnet and I had to g_idle_add ( g_free, event -> buffer ). That worked then. I have tried it now, and it got better but at some point it segfaulted again.
I am using the package from Ubuntu 8.10
Is anyone experiencing this as well? Any posible solutions?
Thanks,
Hugo
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]