Blame bugs/open/000027.txt

Carlos Lopez c53238
Subject: Crash when close old file
Carlos Lopez c53238
Carlos Lopez c53238
Open /home/carlos/Animaciรณn/donempinado-/synfig/Montaje.sifz
Carlos Lopez c53238
It complains about some png and jpg missing and that's not the problem
Carlos Lopez c53238
The file looks fine
Carlos Lopez c53238
Close the file and ss-debug crash.
Carlos Lopez c53238
Carlos Lopez c53238
------------------------------------------------------------------------
Carlos Lopez c53238
backtrace:
Carlos Lopez c53238
Carlos Lopez c53238
Program received signal SIGSEGV, Segmentation fault.
Carlos Lopez c53238
[Switching to Thread 0x7ff0db2da780 (LWP 27987)]
Carlos Lopez c53238
0x000000000454a470 in ?? ()
Carlos Lopez c53238
(gdb) where
Carlos Lopez c53238
#0  0x000000000454a470 in ?? ()
Carlos Lopez c53238
#1  0x0000000000705572 in handle (this=0x7fffe330f570, x=0x4549b10)
Carlos Lopez c53238
    at /home/carlos/Software/Synfig-git/install/include/ETL/_handle.h:175
Carlos Lopez c53238
#2  0x0000000000705593 in etl::loose_handle<synfig::canvas>::operator etl::handle<synfig::canvas> (this=0x81ae100)</synfig::canvas></synfig::canvas>
Carlos Lopez c53238
    at /home/carlos/Software/Synfig-git/install/include/ETL/_handle.h:748
Carlos Lopez c53238
#3  0x00007ff0da7db025 in synfig::ValueBase::clear (this=0x81f9888)
Carlos Lopez c53238
    at value.cpp:255
Carlos Lopez c53238
#4  0x00007ff0da7db228 in ~ValueBase (this=0x81f9888) at value.cpp:98
Carlos Lopez c53238
#5  0x00007ff0da8703d6 in ~ValueNode_Const (this=0x81f9700)
Carlos Lopez c53238
    at valuenode_const.cpp:112
Carlos Lopez c53238
#6  0x00000000006e4699 in etl::shared_object::unref (this=0x81f9700)
Carlos Lopez c53238
    at /home/carlos/Software/Synfig-git/install/include/ETL/_handle.h:115
Carlos Lopez c53238
#7  0x00000000006fd6f3 in etl::handle<synfig::valuenode>::detach (</synfig::valuenode>
Carlos Lopez c53238
    this=0x83ae908)
Carlos Lopez c53238
    at /home/carlos/Software/Synfig-git/install/include/ETL/_handle.h:240
Carlos Lopez c53238
#8  0x0000000000751178 in etl::rhandle<synfig::valuenode>::detach (</synfig::valuenode>
Carlos Lopez c53238
    this=0x83ae908)
Carlos Lopez c53238
    at /home/carlos/Software/Synfig-git/install/include/ETL/_handle.h:553
Carlos Lopez c53238
#9  0x000000000075119e in ~rhandle (this=0x83ae908)
Carlos Lopez c53238
    at /home/carlos/Software/Synfig-git/install/include/ETL/_handle.h:466
Carlos Lopez c53238
#10 0x0000000000751456 in ~Waypoint (this=0x83ae8f0)
Carlos Lopez c53238
    at /home/carlos/Software/Synfig-git/install/include/synfig-0.0/synfig/waypoi---Type <return> to continue, or q <return> to quit---</return></return>
Carlos Lopez c53238
nt.h:57
Carlos Lopez c53238
#11 0x00007ff0dae1b8a8 in std::_Destroy<synfig::waypoint> (__pointer=0x83ae8f0)</synfig::waypoint>
Carlos Lopez c53238
    at /usr/include/c++/4.3/bits/stl_construct.h:88
Carlos Lopez c53238
#12 0x00007ff0dae1b8c5 in std::_Destroy<synfig::waypoint*> (__first=0x83ae8f0,</synfig::waypoint*>
Carlos Lopez c53238
    __last=0x83aeab8) at /usr/include/c++/4.3/bits/stl_construct.h:103
Carlos Lopez c53238
#13 0x00007ff0dae1b8fa in std::_Destroy<synfig::waypoint*, synfig::waypoint=""> (</synfig::waypoint*,>
Carlos Lopez c53238
    __first=0x83ae8f0, __last=0x83aeab8)
Carlos Lopez c53238
    at /usr/include/c++/4.3/bits/stl_construct.h:128
Carlos Lopez c53238
#14 0x00007ff0dae1d397 in ~vector (this=0x8398838)
Carlos Lopez c53238
    at /usr/include/c++/4.3/bits/stl_vector.h:300
Carlos Lopez c53238
#15 0x00007ff0da829e35 in ~ValueNode_Animated (this=0x83986b0)
Carlos Lopez c53238
    at valuenode_animated.cpp:1097
Carlos Lopez c53238
#16 0x00007ff0da833a4d in ~_Constant (this=0x83986b0)
Carlos Lopez c53238
    at valuenode_animated.cpp:536
Carlos Lopez c53238
#17 0x00000000006e4699 in etl::shared_object::unref (this=0x83986b0)
Carlos Lopez c53238
    at /home/carlos/Software/Synfig-git/install/include/ETL/_handle.h:115
Carlos Lopez c53238
#18 0x00000000006fd6f3 in etl::handle<synfig::valuenode>::detach (</synfig::valuenode>
Carlos Lopez c53238
    this=0x81f9bd8)
Carlos Lopez c53238
    at /home/carlos/Software/Synfig-git/install/include/ETL/_handle.h:240
Carlos Lopez c53238
#19 0x0000000000751178 in etl::rhandle<synfig::valuenode>::detach (</synfig::valuenode>
Carlos Lopez c53238
    this=0x81f9bd8)
Carlos Lopez c53238
    at /home/carlos/Software/Synfig-git/install/include/ETL/_handle.h:553
Carlos Lopez c53238
#20 0x000000000075119e in ~rhandle (this=0x81f9bd8)
Carlos Lopez c53238
---Type <return> to continue, or q <return> to quit---</return></return>
Chris Moore 34fd78
Chris Moore 34fd78
------------------------------------------------------------------------
Chris Moore 34fd78
dooglus, Sun Jan  4 18:21:26 CET 2009
Chris Moore 34fd78
Chris Moore 34fd78
Here's valgrind output:
Chris Moore 34fd78
Chris Moore 34fd78
 Invalid read of size 8
Chris Moore 34fd78
    at 0x70556C: etl::handle<synfig::canvas>::handle(synfig::Canvas*) (_handle.h:175)</synfig::canvas>
Chris Moore 34fd78
    by 0x7055A2: etl::loose_handle<synfig::canvas>::operator etl::handle<synfig::canvas>() const (_handle.h:748)</synfig::canvas></synfig::canvas>
Chris Moore 34fd78
    by 0x53F5244: synfig::ValueBase::clear() (value.cpp:255)
Chris Moore 34fd78
    by 0x53F5447: synfig::ValueBase::~ValueBase() (value.cpp:98)
Chris Moore 34fd78
    by 0x548ABE1: synfig::ValueNode_Const::~ValueNode_Const() (valuenode_const.cpp:112)
Chris Moore 34fd78
    by 0x6E46A8: etl::shared_object::unref() const (_handle.h:115)
Chris Moore 34fd78
    by 0x6FD702: etl::handle<synfig::valuenode>::detach() (_handle.h:240)</synfig::valuenode>
Chris Moore 34fd78
    by 0x751187: etl::rhandle<synfig::valuenode>::detach() (_handle.h:553)</synfig::valuenode>
Chris Moore 34fd78
    by 0x7511AD: etl::rhandle<synfig::valuenode>::~rhandle() (_handle.h:466)</synfig::valuenode>
Chris Moore 34fd78
    by 0x751465: synfig::Waypoint::~Waypoint() (waypoint.h:57)
Chris Moore 34fd78
    by 0x4FB7A6B: void std::_Destroy<synfig::waypoint>(synfig::Waypoint*) (stl_construct.h:88)</synfig::waypoint>
Chris Moore 34fd78
    by 0x4FB7A88: void std::_Destroy<synfig::waypoint*>(synfig::Waypoint*, synfig::Waypoint*) (stl_construct.h:103)</synfig::waypoint*>
Chris Moore 34fd78
    by 0x4FB7ABD: void std::_Destroy<synfig::waypoint*, synfig::waypoint="">(synfig::Waypoint*, synfig::Waypoint*, ...) (stl_construct.h:128)</synfig::waypoint*,>
Chris Moore 34fd78
    by 0x4FB95D0: std::vector<synfig::waypoint, std::allocator<synfig::waypoint=""> >::~vector() (stl_vector.h:300)</synfig::waypoint,>
Chris Moore 34fd78
    by 0x5444054: synfig::ValueNode_Animated::~ValueNode_Animated() (valuenode_animated.cpp:1118)
Chris Moore 34fd78
    by 0x544DFD6: _Constant<etl::loose_handle<synfig::canvas> >::~_Constant() (valuenode_animated.cpp:536)</etl::loose_handle<synfig::canvas>
Chris Moore 34fd78
    by 0x6E46A8: etl::shared_object::unref() const (_handle.h:115)
Chris Moore 34fd78
    by 0x6FD702: etl::handle<synfig::valuenode>::detach() (_handle.h:240)</synfig::valuenode>
Chris Moore 34fd78
    by 0x751187: etl::rhandle<synfig::valuenode>::detach() (_handle.h:553)</synfig::valuenode>
Chris Moore 34fd78
    by 0x7511AD: etl::rhandle<synfig::valuenode>::~rhandle() (_handle.h:466)</synfig::valuenode>
Chris Moore 34fd78
    by 0x553B261: std::pair<std::string const,="" etl::rhandle<synfig::valuenode=""> >::~pair() (stl_pair.h:73)</std::string>
Chris Moore 34fd78
    by 0x5564068: std::map<std::string, etl::rhandle<synfig::valuenode="">, ...>::erase(...) (stl_map.h:523)</std::string,>
Chris Moore 34fd78
    by 0x555F392: synfig::Layer::~Layer() (layer.cpp:166)
Chris Moore 34fd78
    by 0x5401F68: synfig::Layer_Composite::~Layer_Composite() (layer_composite.h:49)
Chris Moore 34fd78
    by 0x5412421: synfig::Layer_PasteCanvas::~Layer_PasteCanvas() (layer_pastecanvas.cpp:110)
Chris Moore 34fd78
    by 0x6E46A8: etl::shared_object::unref() const (_handle.h:115)
Chris Moore 34fd78
    by 0x6FD7C0: etl::handle<synfig::layer>::detach() (_handle.h:240)</synfig::layer>
Chris Moore 34fd78
    by 0x6FD7D8: etl::handle<synfig::layer>::~handle() (_handle.h:186)</synfig::layer>
Chris Moore 34fd78
    by 0x55283D0: synfig::Canvas::clear() (canvas.cpp:158)
Chris Moore 34fd78
    by 0x552BF7D: synfig::Canvas::~Canvas() (canvas.cpp:121)
Chris Moore 34fd78
Chris Moore 34fd78
    by 0x6E46A8: etl::shared_object::unref() const (_handle.h:115)
Chris Moore 34fd78
    by 0x6FD818: etl::handle<synfig::canvas>::detach() (_handle.h:240)</synfig::canvas>
Chris Moore 34fd78
    by 0x6FD830: etl::handle<synfig::canvas>::~handle() (_handle.h:186)</synfig::canvas>
Chris Moore 34fd78
    by 0x5001164: __gnu_cxx::new_allocator<etl::handle<synfig::canvas> >::destroy(etl::handle<synfig::canvas>*) (new_allocator.h:118)</synfig::canvas></etl::handle<synfig::canvas>
Chris Moore 34fd78
    by 0x5001FDB: std::_List_base<etl::handle<synfig::canvas>, std::allocator<etl::handle<synfig::canvas> > >::_M_clear() (list.tcc:78)</etl::handle<synfig::canvas></etl::handle<synfig::canvas>
Chris Moore 34fd78
    by 0x5002045: std::_List_base<etl::handle<synfig::canvas>, std::allocator<etl::handle<synfig::canvas> > >::~_List_base() (stl_list.h:358)</etl::handle<synfig::canvas></etl::handle<synfig::canvas>
Chris Moore 34fd78
    by 0x50020A0: std::list<etl::handle<synfig::canvas>, std::allocator<etl::handle<synfig::canvas> > >::~list() (stl_list.h:417)</etl::handle<synfig::canvas></etl::handle<synfig::canvas>
Chris Moore 34fd78
    by 0x552C636: synfig::Canvas::~Canvas() (canvas.cpp:123)
Chris Moore 34fd78
    by 0x6E46A8: etl::shared_object::unref() const (_handle.h:115)
Chris Moore 34fd78
    by 0x6FD818: etl::handle<synfig::canvas>::detach() (_handle.h:240)</synfig::canvas>
Chris Moore 34fd78
    by 0x6FD830: etl::handle<synfig::canvas>::~handle() (_handle.h:186)</synfig::canvas>
Chris Moore 34fd78
    by 0x8BFEFA: studio::WorkArea::~WorkArea() (workarea.cpp:833)
Chris Moore 34fd78
    by 0x7F49B7: std::auto_ptr<studio::workarea>::~auto_ptr() (auto_ptr.h:173)</studio::workarea>
Chris Moore 34fd78
    by 0x7E9934: studio::CanvasView::~CanvasView() (in /home/chris/programs/synfig/git/install/bin/synfigstudio)
Chris Moore 34fd78
    by 0x6E46A8: etl::shared_object::unref() const (_handle.h:115)
Chris Moore 34fd78
    by 0x6E7269: etl::handle<studio::canvasview>::detach() (_handle.h:240)</studio::canvasview>
Chris Moore 34fd78
    by 0x6E7280: etl::handle<studio::canvasview>::~handle() (_handle.h:186)</studio::canvasview>
Chris Moore 34fd78
Chris Moore 34fd78
  Address 0x17484b50 is 0 bytes inside a block of size 1,080 free'd
Chris Moore 34fd78
    at 0x4C24DAD: operator delete(void*) (vg_replace_malloc.c:342)
Chris Moore 34fd78
    by 0x552CB46: synfig::Canvas::~Canvas() (canvas.cpp:123)
Chris Moore 34fd78
    by 0x6E46A8: etl::shared_object::unref() const (_handle.h:115)
Chris Moore 34fd78
    by 0x6FD818: etl::handle<synfig::canvas>::detach() (_handle.h:240)</synfig::canvas>
Chris Moore 34fd78
    by 0x6FD830: etl::handle<synfig::canvas>::~handle() (_handle.h:186)</synfig::canvas>
Chris Moore 34fd78
    by 0x5001164: __gnu_cxx::new_allocator<etl::handle<synfig::canvas> >::destroy(etl::handle<synfig::canvas>*) (new_allocator.h:118)</synfig::canvas></etl::handle<synfig::canvas>
Chris Moore 34fd78
    by 0x5001FDB: std::_List_base<etl::handle<synfig::canvas>, std::allocator<etl::handle<synfig::canvas> > >::_M_clear() (list.tcc:78)</etl::handle<synfig::canvas></etl::handle<synfig::canvas>
Chris Moore 34fd78
    by 0x5002045: std::_List_base<etl::handle<synfig::canvas>, std::allocator<etl::handle<synfig::canvas> > >::~_List_base() (stl_list.h:358)</etl::handle<synfig::canvas></etl::handle<synfig::canvas>
Chris Moore 34fd78
    by 0x50020A0: std::list<etl::handle<synfig::canvas>, std::allocator<etl::handle<synfig::canvas> > >::~list() (stl_list.h:417)</etl::handle<synfig::canvas></etl::handle<synfig::canvas>
Chris Moore 34fd78
    by 0x552C636: synfig::Canvas::~Canvas() (canvas.cpp:123)
Chris Moore 34fd78
Chris Moore 34fd78
    by 0x6E46A8: etl::shared_object::unref() const (_handle.h:115)
Chris Moore 34fd78
    by 0x6FD818: etl::handle<synfig::canvas>::detach() (_handle.h:240)</synfig::canvas>
Chris Moore 34fd78
    by 0x6FD830: etl::handle<synfig::canvas>::~handle() (_handle.h:186)</synfig::canvas>
Chris Moore 34fd78
    by 0x5001164: __gnu_cxx::new_allocator<etl::handle<synfig::canvas> >::destroy(etl::handle<synfig::canvas>*) (new_allocator.h:118)</synfig::canvas></etl::handle<synfig::canvas>
Chris Moore 34fd78
    by 0x5001FDB: std::_List_base<etl::handle<synfig::canvas>, std::allocator<etl::handle<synfig::canvas> > >::_M_clear() (list.tcc:78)</etl::handle<synfig::canvas></etl::handle<synfig::canvas>
Chris Moore 34fd78
    by 0x5002045: std::_List_base<etl::handle<synfig::canvas>, std::allocator<etl::handle<synfig::canvas> > >::~_List_base() (stl_list.h:358)</etl::handle<synfig::canvas></etl::handle<synfig::canvas>
Chris Moore 34fd78
    by 0x50020A0: std::list<etl::handle<synfig::canvas>, std::allocator<etl::handle<synfig::canvas> > >::~list() (stl_list.h:417)</etl::handle<synfig::canvas></etl::handle<synfig::canvas>
Chris Moore 34fd78
    by 0x552C636: synfig::Canvas::~Canvas() (canvas.cpp:123)
Chris Moore 34fd78
    by 0x6E46A8: etl::shared_object::unref() const (_handle.h:115)
Chris Moore 34fd78
    by 0x6FD818: etl::handle<synfig::canvas>::detach() (_handle.h:240)</synfig::canvas>
Chris Moore 34fd78
    by 0x6FD830: etl::handle<synfig::canvas>::~handle() (_handle.h:186)</synfig::canvas>
Chris Moore 34fd78
    by 0x8BFEFA: studio::WorkArea::~WorkArea() (workarea.cpp:833)
Chris Moore 34fd78
    by 0x7F49B7: std::auto_ptr<studio::workarea>::~auto_ptr() (auto_ptr.h:173)</studio::workarea>
Chris Moore 34fd78
    by 0x7E9934: studio::CanvasView::~CanvasView() (in /home/chris/programs/synfig/git/install/bin/synfigstudio)
Chris Moore 34fd78
    by 0x6E46A8: etl::shared_object::unref() const (_handle.h:115)
Chris Moore 34fd78
    by 0x6E7269: etl::handle<studio::canvasview>::detach() (_handle.h:240)</studio::canvasview>
Chris Moore 34fd78
    by 0x6E7280: etl::handle<studio::canvasview>::~handle() (_handle.h:186)</studio::canvasview>
Chris Moore 34fd78
    by 0x86A1DF: studio::Instance::safe_close() (instance.cpp:709)
Chris Moore 34fd78
    by 0x77C2D5: studio::App::quit() (app.cpp:1776)
Chris Moore 34fd78
Chris Moore 34fd78
------------------------------------------------------------------------
Chris Moore 34fd78
dooglus, Sun Jan  4 20:42:52 CET 2009
Chris Moore 34fd78
Chris Moore 34fd78
Here's a simple .sifz file that causes the same crash:
Chris Moore 34fd78
Chris Moore 34fd78
  
Chris Moore 34fd78
  <canvas></canvas>
Chris Moore 34fd78
    <defs></defs>
Chris Moore 34fd78
      <canvas id="xxx"></canvas>
Chris Moore 34fd78
        <defs></defs>
Chris Moore 34fd78
          <canvas id="yyy"></canvas>
Chris Moore 34fd78
        
Chris Moore 34fd78
      
Chris Moore 34fd78
      <canvas id="zzz"></canvas>
Chris Moore 34fd78
        <layer active="true" type="PasteCanvas" version="0.1"></layer>
Chris Moore 34fd78
          <param name="canvas">
Chris Moore 34fd78
            <animated type="canvas"></animated>
Chris Moore 34fd78
              <waypoint time="0s" use=":xxx:yyy"></waypoint>
Chris Moore 34fd78
            
Chris Moore 34fd78
          
Chris Moore 34fd78
        
Chris Moore 34fd78
      
Chris Moore 34fd78
    
Chris Moore 34fd78
  
Chris Moore 34fd78
Chris Moore 34fd78
The bug always happened, it just didn't crash before.  valgrind shows
Chris Moore 34fd78
the same error in the svn version.  It started showing up after the
Chris Moore 34fd78
revision with commit message:
Chris Moore 34fd78
  "Define ref() and unref() as virtual so they can be overridden in
Chris Moore 34fd78
   derived classes."
Chris Moore 34fd78
with this diff:
Chris Moore 34fd78
Chris Moore 34fd78
------------------------------------------------------------------------
Chris Moore 34fd78
--- a/ETL/trunk/ETL/_handle.h
Chris Moore 34fd78
+++ b/ETL/trunk/ETL/_handle.h
Chris Moore 34fd78
@@ -81,7 +81,7 @@ protected:
Chris Moore 34fd78
 #endif
Carlos Lopez c62971
Chris Moore 34fd78
 public:
Chris Moore 34fd78
-	void ref()const
Chris Moore 34fd78
+	virtual void ref()const
Chris Moore 34fd78
 	{
Chris Moore 34fd78
 #ifdef ETL_LOCK_REFCOUNTS
Chris Moore 34fd78
 		etl::mutex::lock lock(mtx);
Chris Moore 34fd78
@@ -91,7 +91,7 @@ public:
Chris Moore 34fd78
 	}
Carlos Lopez c62971
Chris Moore 34fd78
 	//! Returns \c false if object needs to be deleted
Chris Moore 34fd78
-	bool unref()const
Chris Moore 34fd78
+	virtual bool unref()const
Chris Moore 34fd78
 	{
Chris Moore 34fd78
 		bool ret = true;
Chris Moore 34fd78
 		{
Chris Moore 34fd78
------------------------------------------------------------------------
Carlos Lopez c62971
I've updated to the patch you proposed at the following git commit:
Carlos Lopez c62971
606daa09d274196be856a6f7a0fa35f934d00a7f
Carlos Lopez c62971
and the crash has dissapeared.
Carlos Lopez c62971
I don't see any "error: 1 canvas(es) not yet deleted!" message.
Carlos Lopez c62971
------------------------------------------------------------------------