On Tue, Sep 19, 2006 at 07:03:01AM -0400, Justin Piszcz wrote:
> >Task.cc:111: virtual SMTask::~SMTask(): Assertion `!running' failed.
> #3  0x0807d1d1 in ~SMTask (this=0x82d9378) at SMTask.cc:111
> #4  0x080a0355 in ~Speedometer (this=0x82d9378) at Speedometer.h:29
> #5  0x08095250 in ~Buffer (this=0x82d9300) at buffer.cc:209

Ok, now it makes sense.

Please try this patch.

--
   Alexander.                      | http://www.yars.free.net/~lav/  
Index: SMTask.cc
===================================================================
RCS file: /home/lav/cvsroot/lftp/src/SMTask.cc,v
retrieving revision 1.47
diff -u -p -r1.47 SMTask.cc
--- SMTask.cc   13 Jun 2006 14:35:41 -0000      1.47
+++ SMTask.cc   26 Sep 2006 11:41:17 -0000
@@ -108,7 +108,15 @@ SMTask::~SMTask()
    printf("delete SMTask %p (count=%d)\n",this,task_count);
 #endif
    task_count--;
-   assert(!running);
+   if(__builtin_expect(running,0))
+   {
+      fprintf(stderr,"SMTask(%p).running=%d\n",this,running);
+      fprintf(stderr,"SMTask stack:");
+      for(int i=0; i<stack_ptr; i++)
+        fprintf(stderr," %p",stack[i]);
+      fprintf(stderr,"; current=%p\n",current);
+      abort();
+   }
    assert(!ref_count);
    // remove from the chain
    SMTask **scan=&chain;
@@ -121,7 +129,6 @@ SMTask::~SMTask()
       }
       scan=&((*scan)->next);
    }
-   assert(!"SMTask dtor called with unregistered task");
 }
 
 void SMTask::Delete(SMTask *task)
Index: buffer.cc
===================================================================
RCS file: /home/lav/cvsroot/lftp/src/buffer.cc,v
retrieving revision 1.51
diff -u -p -r1.51 buffer.cc
--- buffer.cc   6 Feb 2006 10:57:28 -0000       1.51
+++ buffer.cc   26 Sep 2006 11:34:54 -0000
@@ -206,7 +206,7 @@ Buffer::~Buffer()
 {
    xfree(error_text);
    xfree(buffer);
-   delete rate;
+   SMTask::Delete(rate);
 }
 
 const char *Buffer::GetRateStrS()

Reply via email to