Segfault with panel applet in gnome_canvas_line_get_type()



For an applet I'm writing, I'm using the canvas to draw a little dial
thing. The dial is rendered using an ellipse and a line (with some text
over the top), but for some reason whenever I add the line to the canvas,
I get a segfault. If I comment out the code for the line, it works fine
with just the ellipse and text.

I'm running Debian unstable, with libgnome v1.4.1.4, and libgnomecanvas
v1.109.0. (the full libgnome* version listing is at the end of this mail)

The code I'm using is basically a copy and paste from a quick ap I wrote
to the test canvas - which works fine. At least, when I changed from
gtk_init() to gnome_init() - using gtk_init() resulted in an error about
not being able to find the line type in the ancestry. I'm using
applet_widget_init() for the applet - is there something else I should
be using instead?

The code to add the line is:

	canvasitem = gnome_canvas_item_new (GNOME_CANVAS_GROUP(group),
			gnome_canvas_line_get_type(),
			"fill_color", "yellow",
			"width_units", (double) 3.0f,
			"last_arrowhead", TRUE,
			"arrow_shape_a", (double) 5.0f,
			"arrow_shape_b", (double) 4.0f,
			"arrow_shape_c", (double) 3.0f,
			NULL);

The points are filled in later by a timer callback; I used the same
method in the test app without problems.

Here's a backtrace of the crash. Interestingly, it happens once the
applet is set running (with applet_widget_gtk_main()), not during the
above call. gnome_canvas_line_get_type() returns a value (0xE015) without
any problems...

Program received signal SIGSEGV, Segmentation fault.
0x400e8c2d in gnome_canvas_line_get_type () from /usr/lib/libgnomeui.so.32
(gdb) bt
#0  0x400e8c2d in gnome_canvas_line_get_type () from /usr/lib/libgnomeui.so.32
#1  0x400e8f1c in gnome_canvas_line_get_type () from /usr/lib/libgnomeui.so.32
#2  0x400df5ca in gnome_canvas_item_constructv ()
   from /usr/lib/libgnomeui.so.32
#3  0x400e1768 in gnome_canvas_group_get_type () from /usr/lib/libgnomeui.so.32
#4  0x400df5ca in gnome_canvas_item_constructv ()
   from /usr/lib/libgnomeui.so.32
#5  0x400e1768 in gnome_canvas_group_get_type () from /usr/lib/libgnomeui.so.32
#6  0x400df5ca in gnome_canvas_item_constructv ()
   from /usr/lib/libgnomeui.so.32
#7  0x400e46f2 in gnome_canvas_new_aa () from /usr/lib/libgnomeui.so.32
#8  0x400e47e9 in gnome_canvas_new_aa () from /usr/lib/libgnomeui.so.32
#9  0x405414fa in g_timeout_add () from /usr/lib/libglib-1.2.so.0
#10 0x405404d8 in g_get_current_time () from /usr/lib/libglib-1.2.so.0
#11 0x40540ae3 in g_get_current_time () from /usr/lib/libglib-1.2.so.0
#12 0x40540c7c in g_main_run () from /usr/lib/libglib-1.2.so.0
#13 0x4025f7f7 in gtk_main () from /usr/lib/libgtk-1.2.so.0
#14 0x4004d1e0 in applet_widget_gtk_main () from /usr/lib/libpanel_applet.so.0
#15 0x08052478 in main (argc=1, argv=0xbffffa24) at hwmon.c:112
#16 0x405706cf in __libc_start_main () from /lib/libc.so.6


Any suggestions are greatly appreciated :-)

All my installed libgnome* packages are:

gnome-panel          1.4.0.6-2  Launch and/or dock Gnome applications
gnome-panel-data     1.4.0.6-2  Data files for GNOME panel
libpanel-applet-dev  1.4.0.6-2  Library for Gnome Panel applets - Developmen
libpanel-applet0     1.4.0.6-2  Library for Gnome Panel applets
libgnome-dev         1.4.1.4-2  The Gnome libraries -- development package
libgnome-vfs-c       1.0.4-4    The GNOME virtual file-system libraries comm
libgnome-vfs-d       1.0.4-4    Libraries and include files for developing G
libgnome-vfs0        1.0.4-4    The GNOME virtual file-system libraries
libgnome2-0          1.112.1-1  The Gnome 2 library - runtime files.
libgnome2-dev        1.112.1-1  The Gnome 2 library - development files.
libgnome32           1.4.1.4-2  The Gnome libraries
libgnomecanvas2-0    1.112.1-1  A powerful object-oriented display - runtime
libgnomecanvas2-dev  1.112.1-1  A powerful object-oriented display - develop
libgnomeprint-bin    0.35-3     The GNOME Print architecture - binary files
libgnomeprint-data   0.35-3     The GNOME Print architecture - data files
libgnomeprint15      0.35-3     The GNOME Print architecture - runtime libra
libgnomesupport0     1.4.1.4-2  The Gnome libraries (Support libraries)
libgnomeui32         1.4.1.4-2  The Gnome libraries (User Interface)
libgnomevfs2-0       1.9.8-1    The GNOME virtual file-system libraries (for
libgnomevfs2-common  1.9.8-1    The GNOME virtual file-system library common
libgnomevfs2-dev     1.9.8-1    The GNOME virtual file-system development fi

-- 
Mike.

Attachment: pgpDTckQExcHy.pgp
Description: PGP signature



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