[vtkusers] segfault Delete()ing vtkInterpolateDataSetAttributes

tom fogal tfogal at apollo.sr.unh.edu
Thu Aug 19 11:19:09 EDT 2004


I'm getting a weird segfault in libc when I try to delete an object of
this type:

(gdb) run --config jxr.cfg 
Starting program: /home/tfogal/ggcm/ggcm_anim/ggcm_animator --config
jxr.cfg
[Thread debugging using libthread_db enabled]
[New Thread 182953122592 (LWP 17616)]
rendering [4] streamlines
rendering... 0% complete
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 182953122592 (LWP 17616)]
0x0000002a9686ac18 in main_arena () from /lib64/tls/libc.so.6
(gdb) bt
#0  0x0000002a9686ac18 in main_arena () from /lib64/tls/libc.so.6
#1  0x0000002a958285b2 in vtkSource::UnRegister (this=0x52c980, o=0x0)
    at /home/tfogal/tarballs/VTK/Common/vtkSource.cxx:740
#2  0x0000002a957d704f in vtkObjectBase::Delete (this=0x52c980)
    at /home/tfogal/tarballs/VTK/Common/vtkObjectBase.cxx:86
#3  0x000000000040bebc in ~GGCMInterpolateDataSet (this=0x52c960)
    at GGCMInterpolateDataSet.cc:39
#4  0x000000000040aa8d in GGCMAnimator::Interpolate (this=0x7fbfffef70, 
    time=0.02) at GGCMAnimator.cc:207
#5  0x000000000040a404 in GGCMAnimator::Run (this=0x7fbfffef70)
    at GGCMAnimator.cc:132
#6  0x000000000040ed15 in main (argc=3, argv=0x7fbffff368) at
main.cc:58

The line in vtkSource::UnRegister is 740, or

if (this->Outputs[idx]->GetNetReferenceCount() != 1)

The 'o' is a NULL pointer, but I should think this is expected. In
vtkObjectBase::Delete there is the single line:

this->UnRegister((vtkObjectBase *)NULL);

Should the NULL be a 'this' pointer? I don't understand how the above
code would work for any object, but I have been using this version of
vtk (4.2) for a while now.

The stranger thing is that this is a rewrite of a poorly written
program which performs the same task, and that app works (well...)
fine.

Any ideas? I'm lost...

-tom



More information about the vtkusers mailing list