Call to g_print() causes Seg Fault



I would have checked the archive first, except that Red Hat's page says
they're in a "Quiet Period" and they can't give access to them :-(  This
is the URL for those interested:
http://www.redhat.com/community/list_subscribe.html

I've never done any GTK programming before so I tried the "Hello World"
tutorial from developer.gnome.org.  When I compile this _basic_ program,

it produces a "Segmentation Fault":

/* example-start base base.c */

#include <gtk/gtk.h>

int main( int argc, char *argv[] )
{
  GtkWidget *window;

  gtk_init (&argc, &argv);

  window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_widget_show (window);

  g_print ("Hello World\n");

  gtk_main ();

  return (0);
}

/* example ends here */

When I run the program all I get is a seg fault.  I'm using the
following versions (under Debian GNU/Linux 2.1 "Slink"):

libglib1.2  (1.2.3-0)
libglib1.2-dev (1.2.3-0)
libgtk1.2 (1.2.3-0)
libgtk1.2-dev (1.2.3-0)

Following are the last few lines of an strace of the program running:

munmap(0x40015000, 4096)                = 0
lstat("/etc/gtk/gtkrc", 0xbffffba0)     = -1 ENOENT (No such file or
directory)
lstat("/home/homer/.gtkrc", {st_mode=S_IFREG|0664, st_size=169, ...}) =
0
open("/home/homer/.gtkrc", O_RDONLY)    = 4
read(4, "# -- THEME AUTO-WRITTEN DO NOT E"..., 4000) = 169
lstat("/usr/share/themes/Default/gtk/gtkrc", {st_mode=S_IFREG|0644,
st_size=32, ...}) = 0
open("/usr/share/themes/Default/gtk/gtkrc", O_RDONLY) = 5
brk(0x806c000)                          = 0x806c000
read(5, "# Empty gtkrc for default theme\n"..., 4000) = 32
read(5, "", 4000)                       = 0
close(5)                                = 0
connect(134652672, {sa_family=13874, sa_data="# Empty gtkrc "},
1077283584) = 31
lstat("/home/homer/GTKtutorial/source/~/.gtkrc.mine", 0xbffffad4) = -1
ENOENT (No such file or directory)
read(4, "", 4000)                       = 0
close(4)                                = 0
write(3, "-\0\20\0\2\0\300\0033\0nd-adobe-"..., 72) = 72
read(3, "\1\356!\0\341\2\0\0\0\0\1\0\2\0\377"..., 32) = 32
read(3, "\3\0\0\0t\2547\10 \0\377\0 \0\35"..., 28) = 28
brk(0x806d000)                          = 0x806d000
read(3, "F\0\0\0\227\0\0\0@\0\0\0\230\0\0"..., 232) = 232
read(3, "\0\0\1\0\4\0\1\0\0\0\0\0\1\0\2\0"..., 2688) = 2688
write(3, "\1\20\f\0\3\0\300\3$\0\0\0\0\0\0"..., 276) = 276
read(3, "\1\0\'\0\0\0\0\0\255\0\0\0\0\0\0"..., 32) = 32
brk(0x8070000)                          = 0x8070000
uname({sys="Linux", node="voyager", ...}) = 0
--- SIGSEGV (Segmentation fault) ---
+++ killed by SIGSEGV +++



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]