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 155430 - Crash in startup after modifying a shape to add a textbox
Crash in startup after modifying a shape to add a textbox
Status: RESOLVED FIXED
Product: dia
Classification: Other
Component: win32
0.94
Other All
: Normal normal
: 0.95
Assigned To: Steffen Macke
Dia maintainers
: 157756 316798 325719 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2004-10-14 22:25 UTC by Rick Hale
Modified: 2006-01-06 10:36 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Rick Hale 2004-10-14 22:25:40 UTC
I modified the pc_minitower.shape file to add a textbox (after the aspect ratio line). After saving the shape file, launching dia results in a crash.

Here's the line that I added:

<textbox x1="0" y1="2.3" x2="5" y2="5.3" align="center" resize="no"/> 

The dos prompt window says:
** (dia.exe:5120): WARNING **: No attribute text (00000000) or no data(00000000) in this attribute

(dia.exe:5120): GLib-GObject-CRITICAL **: file gobject.c: line 1561 (g_object_ref): assertion `G_IS_OBJECT (object)' failed

I tried modifying the x and y coordinates of the textbox several different ways, but each time, I get the same results.
Comment 1 Hans Breuer 2004-11-09 23:00:37 UTC
*** Bug 157756 has been marked as a duplicate of this bug. ***
Comment 2 Magnus Henoch 2004-11-14 12:25:32 UTC
I'm getting the same error, having created a custom shape with a textbox.  It
works when I comment out the textbox.

This is dia 0.94.  I get the problem on Redhat (Red Hat Enterprise Linux WS
release 3 (Taroon Update 3)), but not on Mac OS X 10.3 (compiled with a lot of
Fink packages).

Here is a backtrace.  Is there more information I can provide to get this fixed?

(gdb) run
Starting program: /usr/ed-pkg/wild.phc/b/binh/dia
[Thread debugging using libthread_db enabled]
[New Thread -1218579040 (LWP 20491)]

** (dia:20491): WARNING **: No attribute text ((nil)) or no data((nil)) in this
attribute

(dia:20491): GLib-GObject-CRITICAL **: file gobject.c: line 1319 (g_object_ref):
assertion `G_IS_OBJECT (object)' failed

Program received signal SIGSEGV, Segmentation fault.

Thread NaN (LWP 20491)

  • #0 dia_font_set_height
    at font.c line 141
  • #1 dia_font_build_layout
    at font.c line 625
  • #2 dia_font_scaled_build_layout
    at font.c line 833
  • #3 dia_font_vertical_extents
    at font.c line 730
  • #4 dia_font_scaled_ascent
    at font.c line 764
  • #5 dia_font_ascent
    at font.c line 501
  • #6 text_calc_boundingbox
    at text.c line 86
  • #7 custom_update_data
    at custom_object.c line 852
  • #8 object_load_props
    at propobject.c line 223
  • #9 custom_load_using_properties
    at custom_object.c line 1355
  • #10 dia_object_defaults_load
    at stdlib.h line 382
  • #11 app_init
    at app_procs.c line 543
  • #12 main
    at main.c line 36

Comment 3 Magnus Henoch 2004-11-17 16:22:41 UTC
I debugged this a bit more.  Forget about Redhat vs Mac OS X; it's simpler than
that.

When you use a certain shape, it ends up in ~/.dia/defaults.dia.  If you add a
textbox to it when it's cached there, you get this error, since Dia can't find
the default property value in defaults.dia.  That is the source of the first
warning. (lib/proplist.c, line 158; BTW, I think the attribute name should be
enclosed in quotes.  I lost some time grepping for "No attribute text")

As a result of this, Dia tries to use a NULL font, which gives the segfault and
backtrace above.

Workaround: Whenever you add a textbox to a shape, remove ~/.dia/defaults.dia.

Solution: Better default value for text properties, I guess.  Not sure if I can
do this myself; I don't know the code very well.  I'll see what I can do. 
Comment 4 Hans Breuer 2004-11-26 21:06:12 UTC
Thanks for debugging. There are some changes in cvs which should avoid 
crashing and also give more meaningful error messages.

2004-11-26  Hans Breuer  <hans@breuer.org>

	* lib/diaerror.[ch] : (new file) start of better error handling
	* lib/Makefile.am lib/makefile.msc lib/libdia.def: 
	added new files/funcs
	* lib/proplist.c lib/propinternals.h (prop_list_load) : 
	allow to propagate error to caller. Also set PXP_NOTSET
	to avoid applying unset properties, fixes bug #155255
	* lib/propobject.c lib/prop_sdarray.c : still spewing
	g_warnings but now with context information
	
Comment 5 Hans Breuer 2005-10-08 19:43:48 UTC
Adjusting target to help finding 0.94 dups already fixed
(this is the one I was looking for)
Comment 6 Hans Breuer 2005-10-08 19:57:28 UTC
*** Bug 316798 has been marked as a duplicate of this bug. ***
Comment 7 Hans Breuer 2006-01-06 10:36:59 UTC
*** Bug 325719 has been marked as a duplicate of this bug. ***