After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 68592 - Memory Corruption in GtkText widget
Memory Corruption in GtkText widget
Status: RESOLVED NOTABUG
Product: gtk+
Classification: Platform
Component: Widget: Other
1.2.x
Other Linux
: Normal critical
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2002-01-12 20:28 UTC by Tomasso
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Tomasso 2002-01-12 20:28:09 UTC
Hi, when i code something like...
---------------------------------------------------------------------------
	int sockfd;  // socket file descriptor EVERITHING IN UNIX IS A FILE MEN!
:-)
	gtk_text_insert((GtkText *)Texto,NULL,NULL,NULL,"Connecting to SMTP
server:\n",50);
	//gtk_text_insert((GtkText *)Texto,NULL,NULL,NULL,(gchar
*)ServerAddress,40);
	if ((sockfd = Stablish_connection(PMail->ServerAddress)) == -1){
		gtk_text_insert((GtkText *)Texto,NULL,NULL,NULL,"Couldn't connect to
server\n",60);
		printf("PROBLEM CONNECTING\n");
		gtk_text_insert((GtkText *)Texto,NULL,NULL,NULL,(gchar
*)PMail->ServerAddress,40);
	}
	else {
	gtk_text_insert((GtkText *)Texto,NULL,NULL,NULL,"Connection Stablished
Successfully\n",60);
	if ((Login(sockfd)) == 0){
	  gtk_text_insert((GtkText *)Texto,NULL,NULL,NULL,"Logged
successfully\n",60);	
		
		
		
		
	}
	
	
	}
---------------------------------------------------------------------------
and i run the program, the GtkText box writes "Couldn't connect to
servLogged successfully" even if the connection was stablished with the
server. (i debugged it thousands of times and the program never goes to the
line containing "Couldn't connect to server".
   In some cases, GtkText, writes inside it, what printf should write! HAHA
like for example "PROBLEM CONNECTING\n" that is written by a printf...

I dunno what's happening, but i hope my bug report be useful for you.

OK

Thank you.

Pablo Tomas Borda Di Berardino
Comment 1 Havoc Pennington 2002-01-17 00:23:15 UTC
You're passing in the wrong lengths for your strings. Use -1 for GTK 
to determine the length automatically.