Bugs item #1420091, was opened at 2006-01-31 09:11
Message generated for change (Comment added) made by genete
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=757416&aid=1420091&group_id=144022

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
>Status: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: Paul Wise (pabs3)
Assigned to: Nobody/Anonymous (nobody)
Summary: Crash when deleting vertex items 

Initial Comment:
A bug report from snapsilverlight:

Layer -> New Layer -> Geometry -> Region
Then in Params, expand the vertex list, right click on
any vertex, click "Insert Item (Smart)"
Then go and delete it. POOF!

#0  0x082af60d in
studio::CanvasTreeStore::get_value_vfunc
(this=0x8a60800, it...@0xbfe897f4, column=2,
val...@0xbfe89888) at canvastreestore.cpp:248
#1  0x082c071c in
studio::LayerParamTreeStore::get_value_vfunc
(this=0x8a60800, it...@0xbfe897f4, column=2,
val...@0xbfe89888)
    at layerparamtreestore.cpp:150
#2  0xb79e2f77 in
Gtk::TreeModel_Class::get_value_vfunc_callback () from
/usr/lib/libgtkmm-2.4.so.1
#3  0xb767dec5 in IA__gtk_tree_model_get_value
(tree_model=0x8a60b08, iter=0xbfe89984, column=0,
value=0xbfe89888) at gtktreemodel.c:1077
#4  0xb76aa096 in
IA__gtk_tree_view_column_cell_set_cell_data
(tree_column=0x8a39790, tree_model=0x8a60b08,
iter=0xbfe89984, is_expander=0, is_expanded=0)
    at gtktreeviewcolumn.c:2544
#5  0xb7699200 in gtk_tree_view_expose
(widget=0x8a37418, event=0xbfe89f50) at gtktreeview.c:3651
#6  0xb79f4a62 in
Gtk::Widget_Class::expose_event_callback () from
/usr/lib/libgtkmm-2.4.so.1
#7  0xb75c6960 in _gtk_marshal_BOOLEAN__BOXED
(closure=0x84d5d60, return_value=0xbfe89bc0,
n_param_values=2, param_values=0xbfe89cac,
    invocation_hint=0xbfe89bac,
marshal_data=0xb79f49e0) at gtkmarshalers.c:83
#8  0xb7133179 in g_type_class_meta_marshal
(closure=0x84d5d60, return_value=0x0, n_param_values=0,
param_values=0xbfe89cac, invocation_hint=0x0,
    marshal_data=0x0) at gclosure.c:569
#9  0xb7133839 in IA__g_closure_invoke
(closure=0x84d5d60, return_value=0x0, n_param_values=0,
param_values=0x0, invocation_hint=0x0) at gclosure.c:492
#10 0xb71437f5 in signal_emit_unlocked_R
(node=0x84d5db0, detail=0, instance=0x8a37418,
emission_return=0xbfe89e2c, instance_and_params=0xbfe89cac)
    at gsignal.c:2523
#11 0xb71446de in IA__g_signal_emit_valist
(instance=0x8a37418, signal_id=33, detail=0,
var_args=0xbfe89eb0
"\uffff\236\uffff\uffffP\237\uffff\uffff\030t\uffff\b\017\203k\uffff\030t\uffff\b\uffff4J\b")
    at gsignal.c:2254
#12 0xb7144cd9 in IA__g_signal_emit (instance=0x0,
signal_id=0, detail=0) at gsignal.c:2288
#13 0xb76b81c4 in gtk_widget_event_internal
(widget=0x8a37418, event=0xbfe89f50) at gtkwidget.c:3735
#14 0xb75c53ca in IA__gtk_main_do_event
(event=0xbfe89f50) at gtkmain.c:1370
#15 0xb73d388d in gdk_window_process_updates_internal
(window=0x8a973f0) at gdkwindow.c:2215
#16 0xb73d396f in IA__gdk_window_process_all_updates ()
at gdkwindow.c:2268
#17 0xb7533597 in gtk_container_idle_sizer (data=0x0)
at gtkcontainer.c:1117
#18 0xb70ad0f1 in g_idle_dispatch (source=0x8a94478,
callback=0x3, user_data=0x0) at gmain.c:3817
#19 0xb70aab8c in IA__g_main_context_dispatch
(context=0x849e978) at gmain.c:1934
#20 0xb70adf6b in g_main_context_iterate
(context=0x849e978, block=1, dispatch=1,
self=0x84b3488) at gmain.c:2565
#21 0xb70ae2c7 in IA__g_main_loop_run (loop=0x85aaee8)
at gmain.c:2769
#22 0xb75c43a1 in IA__gtk_main () at gtkmain.c:991
#23 0xb799a626 in Gtk::Main::run_impl () from
/usr/lib/libgtkmm-2.4.so.1
#24 0xb799a4d1 in Gtk::Main::run () from
/usr/lib/libgtkmm-2.4.so.1
#25 0x081b8d05 in main (argc=0, argv=0xbfe8a394) at
main.cpp:86

----------------------------------------------------------------------

>Comment By: Genete (genete)
Date: 2009-07-28 00:06

Message:
It seems it was long time ago fixed. Works for me.

----------------------------------------------------------------------

Comment By: dooglus (dooglus)
Date: 2008-12-10 10:47

Message:
> get_root_canvas() in this case is returning the root canvas of the
> original window

No, it's returning 0.  Exporting a canvas causes it to be cloned, and
clone() doesn't set the root canvas.

> Of course, it's possible that both windows have the same layer selected,
> and so both windows really need to have their parameter trees rebuilt.

Oh, but there's only one params panel.  So only one tree can be displayed
at a time.  Do we still need to rebuild both of them?

----------------------------------------------------------------------

Comment By: dooglus (dooglus)
Date: 2008-12-10 10:09

Message:
Here's another way to get the same crash:

1. layer > new layer > geometry > outline
2. encapsulate
3. in params panel, right click canvas parameter and export, give it a
name
4. in canvas panel, expand the entry and double-click the canvas inside it
5. with the new window focused, select the outline layer
6. in the param panel, expand the vertices parameter
7. make sure the params panel is quite large, scroll down so the vertices
paramater is towards the top
8. right-click vertex 001 and 'remove item (smart)' - it crashes

The problem is that dynamic_list is doing:
                                if(get_root_canvas())
                                        
get_root_canvas()->signal_value_node_child_removed()(this,value_node);
to tell the root canvas to tell the parameter tree to refresh itself to
get rid of the reference to the 3rd vertex (since there will soon be no 3rd
vertex)

get_root_canvas() in this case is returning the root canvas of the
original window, not the newly exported canvas, and so the parameter tree
in the other window is being rebuilt, and the parameter tree in the
subcanvas window is being left with the bad reference to 'vertex 003',
causing a crash.

Of course, it's possible that both windows have the same layer selected,
and so both windows really need to have their parameter trees rebuilt.

----------------------------------------------------------------------

Comment By: dooglus (dooglus)
Date: 2008-12-10 01:59

Message:
This still isn't fixed.  Duplicate an outline then delete a vertex from the
duplicate and it crashes.

----------------------------------------------------------------------

Comment By: dooglus (dooglus)
Date: 2007-03-14 20:59

Message:
Logged In: YES 
user_id=1546005
Originator: NO

r314 | dooglus | 2007-03-14 20:58:01 +0100 (Wed, 14 Mar 2007) | 2 lines
Changed paths:
   M /synfig-core/trunk/src/synfig/valuenode_dynamiclist.cpp

Fixes 1420091 (Crash when deleting vertex items).  I don't think this is
the right fix, but it seems to stop the crash at least.


----------------------------------------------------------------------

Comment By: dooglus (dooglus)
Date: 2007-03-05 15:54

Message:
Logged In: YES 
user_id=1546005
Originator: NO

This still crashes in the following situation:

make a region,
encapsulate it
save the file
close the file
open the file
go to the params dialog for the encapsulated region,
open the 'vertices' node
right-click 'vertex 001' and remove item (smart)

It seems that the crash doesn't happen if the region isn't encapsulated,
or if the region has been created this session, not read from a file, or if
the param dialog's 'vertices' node isn't opened.

The problem seems to be that the
canvas()->signal_value_node_child_removed() call when the vertex is deleted
isn't triggering the LayerParamTreeStore::on_value_node_child_removed()
method if the region is encapsulated.

The existing code in valuenode_dynamiclist.cpp says this:

                                remove_child(value_node.get());
                                if(get_parent_canvas())
                                        
get_parent_canvas()->signal_value_node_child_removed()(this,value_node);
                                else if(get_root_canvas() && 
get_parent_canvas())

                                        
get_root_canvas()->signal_value_node_child_removed()(this,value_node);

notice that the 'else' part can't ever be run.  I think that it's only the
root canvas which reacts to the signal we're sending.

This patch seems to fix things, but I'm left wondering what the intention
of the above code was.

--- synfig/src/synfig/valuenode_dynamiclist.cpp (revision 255)
+++ synfig/src/synfig/valuenode_dynamiclist.cpp (working copy)
@@ -525,9 +525,7 @@
                        if(value_node)
                        {
                                remove_child(value_node.get());
-                               if(get_parent_canvas())
-                                       
get_parent_canvas()->signal_value_node_child_removed()(this,value_node);
-                               else if(get_root_canvas() && 
get_parent_canvas())
+                               if(get_root_canvas())

                                        
get_root_canvas()->signal_value_node_child_removed()(this,value_node);
                        }
                        break;


----------------------------------------------------------------------

Comment By: dooglus (dooglus)
Date: 2007-03-03 17:08

Message:
Logged In: YES 
user_id=1546005
Originator: NO

This isn't as fixed as I thought.  It still happens if the vertex's layer
is inside a PasteCanvas layer.

----------------------------------------------------------------------

Comment By: dooglus (dooglus)
Date: 2007-02-25 04:09

Message:
Logged In: YES 
user_id=1546005
Originator: NO

I committed my fix as svn revision 251.

----------------------------------------------------------------------

Comment By: dooglus (dooglus)
Date: 2007-02-24 19:14

Message:
Logged In: YES 
user_id=1546005
Originator: NO

I found a fix for this:

in
http://svn.voria.com/code/synfig-studio/trunk/src/gtkmm/layerparamtreestore.cpp
, there's this code:

void
LayerParamTreeStore::on_value_node_child_removed(synfig::ValueNode::Handle
value_node,synfig::ValueNode::Handle child)
{
        queue_rebuild();
}

replacing 'queue_rebuild()' with 'rebuild()' fixes the problem, but is
this the correct fix?

----------------------------------------------------------------------

Comment By: dooglus (dooglus)
Date: 2007-02-05 18:27

Message:
Logged In: YES 
user_id=1546005
Originator: NO

Sure, that could be useful.

I've not been paying a lot of attention to synfig recently, since it
appeared that nobody was maintaining it, but now that you're back and
active hopefully things will pick up.

You can contact me using dooglus at gmail.com if you need to.

Chris.

----------------------------------------------------------------------

Comment By: Paul Wise (pabs3)
Date: 2007-02-05 08:51

Message:
Logged In: YES 
user_id=35028
Originator: YES

I still get this with recent SVN versions.

dooglus, would you like some permissions in this tracker to close bugs and
so on?

----------------------------------------------------------------------

Comment By: dooglus (dooglus)
Date: 2006-10-05 14:13

Message:
Logged In: YES 
user_id=1546005

I can't reproduce this in studio 0.61.05-124.  Does it 
still happen for you?

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=757416&aid=1420091&group_id=144022

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl

Reply via email to