xml-tree fails to build with GTK_DISABLE_DEPRECATED (use of GtkCList)

Bug #903676 reported by Alex Valavanis on 2011-12-13
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Medium
John Smith

Bug Description

The XML tree dialog fails to build with CPPFLAGS+="-DGTK_DISABLE_DEPRECATED".

This occurs because the GtkCList API has been deprecated since gtk 2.0 and has been removed from gtk3. We need to replace all uses of it with GtkTreeView. http://developer.gnome.org/gtk/stable/GtkTreeView.html

summary: - Replace GtkCList with GtkTreeView
+ xml-tree fails to build with GTK_DISABLE_DEPRECATED (use of GtkCList)
description: updated
tags: added: xmleditor
Alex Valavanis (valavanisalex) wrote :

@John - I've put your name on this one, based on our previous discussion. If you'd prefer not to take this, please feel free to revert.

Changed in inkscape:
assignee: nobody → John Smith (john-smithi)
John Smith (john-smithi) wrote :

r11105 : Replaced GtkCList with GtkTreeView in XML Tree attribute list.
Should be functionally the same.
Tested on Ubuntu 11.10 and Windows 7 (note XML Tree on Windows has other issues in bug #942475)

Some others deprecated symbols (such as GtkCTree) still in the XML Tree (see bug #367607)

su_v (suv-lp) wrote :

/me nit-picking again - I hope you don't mind (else please let me know):

Could the new GtkTreeView for the attribute list use the same vertical spacing between the list items as was used with the deprecated GtkCList before?

(attached screenshot has r11100 on the left and r11112 on the right, using 'ClearlooksTest' theme from
<http://git.gnome.org/browse/gnome-themes/>)

John Smith (john-smithi) wrote :

r11113 : Reduced the attribute list's default 2/3px of vertical padding to zero.
Should be much closer to the GtkCList height now.
Would need to change the font size to reduce it any more.

Are there any guidelines/standards for sizes of fonts, icon sizes, widget spacing/paddings etc ?
There is quite a few inconsistencies across the toolbars and the dialogs.

su_v (suv-lp) wrote :

Regressions with XML Editor using GtkTreeView instead of GtkCList on OS X 10.7.2:

- 64bit builds with Apple's llvm-gcc-4.2 (since r11105):
crash when selecting an attribute in the attribute list (crash report attached, done with archived build of r11106)

- 64bit builds with Apple's llvm-gcc-4.2, run from gdb (since r11105):
the value of the selected attribute is not displayed at all (and thus not editable), instead this critical warning is output to the console:

(inkscape:7382): Gtk-CRITICAL **: void gtk_text_buffer_emit_insert(GtkTextBuffer *, GtkTextIter *, const gchar *, gint): assertion `g_utf8_validate (text, len, NULL)' failed

- experimental 64bit builds with FSF GCC 4.6.3 (since r11118):
crash when updating a modified attribute value (with 'Ctrl+Enter' or clicking on the 'Set' button)

- experimental 64bit builds with FSF GCC 4.6.3, run from gdb (since r11118):
crash when updating a modified attribute value (with 'Ctrl+Enter' or clicking on the 'Set' button)

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x00000000040406d9
0x00007fff82e8e870 in strcmp ()
(gdb) bt
#0 0x00007fff82e8e870 in strcmp ()
#1 0x0000000100546b59 in Inkscape::UI::Dialog::XmlTree::on_attr_row_changed ()
(gdb)

Note I: FSF GCC 4.6 is not the system compiler on OS X, and the default gdb doesn't produce backtraces for applications built with newer versions of GCC.

Note II: 32bit builds with Apple's GCC 4.2.1 on Mac OS X 10.5.8 (Intel) seem not affected.

Note III: with latest r11118 on OS X Lion (64bit), none of my builds (irrespective of the compiler) has a functional XML Editor anymore.

Clayton Walker (clayton.walker) wrote :

I can confirm the crash on Mac OSX 10.6.8, gtk2 quartz.
Revision 11131.

Created 1 rect, opened xml editor, clicked on "height", and inkscape crashed.

John Smith (john-smithi) wrote :

Committed r11205 to fix OS X Lion (64bit) crash when updating an attribute.
Note, some other problems with Lion still exist.

John Smith (john-smithi) wrote :

Patch to replace the deprecated GtkCTree with GtkTreeView for the XML Dialog Tree (not the attributes list).
Please test if you can (esp OS X), since its a major rewrite.
Functionally should be the same, but can also search in the tree (by typing, or Ctrl+F)

Tested on Ubuntu 11.10 and Windows 7.
Related bug #367607

su_v (suv-lp) wrote :

> Committed r11205 to fix OS X Lion (64bit) crash when
> updating an attribute.

A - Testing current trunk (r11206) on OS X 10.7.2 64bit:

1) Inkscape 0.48+devel r11206
   debug and optimized build, Apple llvm-gcc-4.2

a) running without gdb:
Inkscape crashes (as before) when clicking on an attribute in the attribute list (upper right).

Attached: crash report from crash when running inkscape r11206 directly (without gdb).

b) running within gdb:
Inkscape allows to select an attribute, but fails to display the value in the edit field (lower right). New values can be typed into the edit field and updated (i.e. overwritten) without crash. It is not possible to actually edit existing values.

Console message when filling current attribute value into the edit field fails:
(inkscape:63244): Gtk-CRITICAL **: void gtk_text_buffer_emit_insert(GtkTextBuffer *, GtkTextIter *, const gchar *, gint): assertion `g_utf8_validate (text, len, NULL)' failed

2) Inkscape 0.48+devel r11206
   experimental optimized build, FSF GCC 4.6.3 [1]

Selecting and editing an attribute works as expected with current trunk (no crash, no warnings on the console).

B - Testing patch with current trunk (r11206) on OS X 10.7.2 64bit:

1) Inkscape 0.48+devel r11206+903676.tree.v1.patch
   debug 64bit build, Apple llvm-gcc-4.2

Quick tests browsing the rewritten XML node tree on the left seems ok, but current build is still affected by above issues (if run directly: crash when selecting an attribute, if run from within gdb: fails to edit actual attribute content).

2) Inkscape 0.48+devel r11206+903676.tree.v1.patch
   experimental 64bit optimized build, FSF GCC 4.6.3 [1]

Quick tests browsing the rewritten XML node tree on the left seems ok.
Selecting and editing an attribute works as expected (no crash, no warnings on the console).

System info:
------------
32bit builds on Mac OS X 10.5.8 (not affected):
- Apple GCC 4.2, Gtk+/x11 2.24.8, glib2 2.28.8, glibmm 2.28.0
- Apple GCC 4.2, Gtk+/quartz 2.24.10, glib2 2.28.8, glibmm 2.28.0

64bit builds on Mac OS X 10.6.8 (crash - UnconventionalT):
- Apple GCC 4.2, Gtk+/quartz 2.24.10, glib 2.30.2, glibmm 2.28.3

64bit builds on OS X 10.7.2 (crash - suv-lp):
- Apple llvm-gcc-4.2, Gtk+/x11 2.24.10, glib 2.30.2, glibmm 2.28.2
- Apple llvm-gcc-4.2, Gtk+/x11 2.24.10, glib 2.32.0, glibmm 2.28.2

64bit builds on OS X 10.7.2 (experimental, no more crash with r11206)
- FSF GCC 4.6.3 [1], Gtk+/x11 2.24.10, glib 2.32.0, glibmm 2.28.2

[1] *** Note: these are local experimental builds using a custom-installed compiler (Apple does not provide newer GCC versions due to license changes in GCC after 4.2). Building Inkscape with a different C++ compiler requires to rebuild all C++ binding libs with the same compiler - not supported in MacPorts - and to use them during building and at runtime.

Alex Valavanis (valavanisalex) wrote :

Seems good to me on 64bit Ubuntu 12.04 (pre-release). Compiles fine, and I can't reproduce the crash ~suv describes.

Shall we go ahead and commit this, and deal with the crash in a follow-up report?

John Smith (john-smithi) wrote :

Committed r11220 - Fix for remaining attribute list issues on OS X Lion 64bit (comments #5, #6 & #9).
Patch for XML Tree (comment #8) still remains.

John Smith (john-smithi) wrote :

Committed r11221 - Replace GtkCTree with GtkTreeView in XML Dialog tree (patch from #8)
Should now build with CPPFLAGS+="-DGTK_DISABLE_DEPRECATED".

Changed in inkscape:
status: Triaged → Fix Committed
su_v (suv-lp) wrote :

Inkscape 0.48+devel r11233 on OS X 10.7.2:

Undoing 'Path > Object to Path' produces this console message:
(inkscape:62416): Gtk-CRITICAL **: gboolean gtk_tree_model_get_iter(GtkTreeModel *, GtkTreeIter *, GtkTreePath *): assertion `path != NULL' failed

Steps to reproduce:
1) open new empty doc
2) open XML Editor
3) draw a rectangle
4) convert rectangle to path (Shift+Ctrl+C)
5) Undo (Ctrl+Z)

-> critical warning on console (backtrace with G_DEBUG=fatal_warnings attached).

John Smith (john-smithi) wrote :

@suv, committed revision 11257 to fix issue in comment #13.

su_v (suv-lp) wrote :

Inkscape 0.48+devel r11259: similar console messages when undoing/redoing filter effects:

Steps to reproduce:
1) open new document
2) open XML Editor, Fill & Stroke
3) draw rectangle
4) blur rectangle by dragging the slider
5) undo

or:
1) open new document
2) open XML Editor, Fill & Stroke
3) draw rectangle
4) blur rectangle by entering a number (e.g. '2')
5) undo
6) redo

or:
1) open new document
2) open XML Editor
3) draw rectangle
4) apply a preset filter effect
   (e.g. 'Bevels > Bloom' or 'Shadows and Glows > Drop Shadow…')
5) undo
6) redo

John Smith (john-smithi) wrote :

Committed revision 11264 to fix the issues in comment #15.

Bryce Harrington (bryce) on 2015-02-21
Changed in inkscape:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Related blueprints