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 107223 - Program will segfault if a GtkTextView is pressed Ctrl+a when set_cursor_visible has been set to 0
Program will segfault if a GtkTextView is pressed Ctrl+a when set_cursor_visi...
Status: RESOLVED DUPLICATE of bug 75270
Product: gtk+
Classification: Platform
Component: Widget: GtkTextView
2.2.x
Other Linux
: Normal major
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2003-02-27 21:18 UTC by gc
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description gc 2003-02-27 21:18:01 UTC
Summary says it all: the program will be killed by a segmentation fault
when the user presses Control plus 'a' on the keyboard in the focus of a
GtkTextView, if this textview has its cursor set to not visible.

The following program will segfault (at least on me):

-=-=---=-=---=-=---=-=--
#include <gtk/gtk.h>

/* gcc -Wall -Werror `pkg-config gtk+-2.0 --cflags --libs` t.c */

GtkWidget *window;
GtkWidget *textview;

int main(int argc, char **argv)
{
	gtk_init(&argc, &argv);

	window = gtk_window_new(GTK_WINDOW_TOPLEVEL);

	textview = gtk_text_view_new();
	gtk_text_buffer_set_text(GTK_TEXT_BUFFER(gtk_text_view_get_buffer(GTK_TEXT_VIEW(textview))), "meuh", -1);

	gtk_text_view_set_cursor_visible(GTK_TEXT_VIEW(textview), 0);

	gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(textview));
	gtk_widget_show_all(window);

	gtk_main();

	return 0;
}
-=-=---=-=---=-=---=-=--

The end of the strace, if helpful, gives:

-=-=---=-=---=-=---=-=--
poll([{fd=3, events=POLLIN}], 1, 0)     = 0
ioctl(3, FIONREAD, [0])                 = 0
poll([{fd=3, events=POLLIN, revents=POLLIN}], 1, -1) = 1
ioctl(3, FIONREAD, [64])                = 0
read(3, "\2%\274\0w\2T\1X\0\0\0\4\0\0\2\0\0\0\0\4\0J\1\37\374p\376"..., 64)
= 64
write(3, "\225\10\7\0\0\1\3\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 28) = 28
read(3, "\1\1\275\0\v\3\0\0\0\0\10\377\3\0\0\f\f\10\303\0\370\0"..., 32) = 32
read(3, "\0\0\0\0\0\0\0\0", 8)          = 8
read(3, "\0\0\0\0\1\0\0\0\1\1\0\0\2\1\0\0\1\1\1\1\0\0\0\0\3\3\0"..., 3108)
= 3108
write(3, "\225\21\3\0\1\0\3\0\0\20\0\0", 12) = 12
read(3, "\1\1\276\0\1\0\0\0\0\20\0\0\10\377\f\1\0\0\10\370\0\0\0"..., 32) = 32
read(3, "\230\0\0\0", 4)                = 4
poll([{fd=3, events=POLLIN}], 1, 0)     = 0
write(3, "\225\4\2\0\0\1\3\0", 8)       = 8
read(3, "\1\1\277\0\0\0\0\0\4\4\0\0\0\0\0\0\0\0\4\0\0\0\0\0\0\0"..., 32) = 32
write(3, "\21\4\2\0\230\0\0\0", 8)      = 8
read(3, "\1I\300\0\2\0\0\0\10\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 32) = 32
readv(3, [{"US/ASCII", 8}, {"", 0}], 2) = 8
ioctl(3, FIONREAD, [0])                 = 0
poll([{fd=3, events=POLLIN, revents=POLLIN}], 1, -1) = 1
ioctl(3, FIONREAD, [32])                = 0
read(3, "\2&\300\0\1\4T\1X\0\0\0\4\0\0\2\0\0\0\0\4\0J\1\37\374p"..., 32) = 32
open("/usr/lib/charset.alias", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such
file or directory)
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++
-=-=---=-=---=-=---=-=--

This is on a Mandrake Cooker distribution, with gtk+ 2.2.1 and pango 1.2.1.

Thx.
Comment 1 Matthias Clasen 2003-02-27 23:43:18 UTC
Works fine for me. A stacktrace would be more helpful than a strace to
figure out where it segfaults. (Compile with -g and run it in gdb)
Comment 2 Frederic Crozat 2003-02-28 15:51:23 UTC
This bug was only occuring with --with-input=xfree and seems to be
fixed by patch from bug #75270.

Duplicating..

*** This bug has been marked as a duplicate of 75270 ***