[vtkusers] segfault Delete()ing vtkInterpolateDataSetAttributes

Mathieu Malaterre mathieu.malaterre at kitware.com
Fri Aug 20 15:31:12 EDT 2004


Tom,

	Do you have a simple script to reproduce the bug ? If so then yes open 
a bug and add your example.
	BTW, bug #189 is closed.

Thanks
Mathieu

tom fogal wrote:
> I believe I am closer to tracking this down. Below is a gdb backtrace
> where gdb gives an interesting message:
> 
> warning: can't find linker symbol for virtual table for `vtkDataObject'
> value
> 
> Also I believe this may be (very vaguely) related to bug 189,
> 
> http://www.itk.org/Bug/bug.php?op=vote&bugid=189
> 
> due to the fact that they both crash in the same part of libc.
> 
>>From what I gather through extensive googling, main_arena is apparently
> some type of flag telling glibc where a particular section of memory
> was malloc()d -- certain applications implement their own malloc() and
> that is not considered part of the 'main_arena', for example.
> 
> Perhaps a linking error is causing
> vtkDataObject::GetNetReferenceCount() to not be found in this context?
> This is a little beyond my current C/C++ debugging knowledge.
> 
> Any ideas would be GREATLY appreciated.
> Also, should I perhaps submit this as a bug or should we continue to
> blame glibc until more information is known?
> 
> -tom
> 
> ---- gdb trace ----
> tfogal at thetis ggcm_anim $ gdb ggcm_animator 
> GNU gdb 6.1
> Copyright 2004 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General Public License, and
> you are
> welcome to change it and/or distribute copies of it under certain
> conditions.
> Type "show copying" to see the conditions.
> There is absolutely no warranty for GDB.  Type "show warranty" for
> details.
> This GDB was configured as "x86_64-suse-linux"...Using host
> libthread_db library "/lib64/tls/libthread_db.so.1".
> 
> (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 31484)]
> rendering [4] streamlines
> rendering... 0% complete
> Program received signal SIGSEGV, Segmentation fault.
> [Switching to Thread 182953122592 (LWP 31484)]
> 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  0x000000000040ed59 in main (argc=3, argv=0x7fbffff368) at
> main.cc:58
> (gdb) up
> #1  0x0000002a958285b2 in vtkSource::UnRegister (this=0x52c980, o=0x0)
> at /home/tfogal/tarballs/VTK/Common/vtkSource.cxx:740
> 740             if (this->Outputs[idx]->GetNetReferenceCount() != 1)
> (gdb) list
> 735             {
> 736             if (this->Outputs[idx] == o)
> 737               {
> 738               done = 0;
> 739               }
> 740             if (this->Outputs[idx]->GetNetReferenceCount() != 1)
> 741               {
> 742               done = 0;
> 743               }
> 744             }
> (gdb) print this
> $1 = (vtkSource * const) 0x52c980
> (gdb) print idx
> $2 = 0
> (gdb) print this->Outputs[0]
> $3 = (class vtkDataObject *) 0x5b380d0
> (gdb) print this->Outputs[0]->GetNetReferenceCount()
> warning: can't find linker symbol for virtual table for `vtkDataObject'
> value
> 
> Program received signal SIGSEGV, Segmentation fault.
> 0x0000002a9686ac18 in main_arena () from /lib64/tls/libc.so.6
> The program being debugged was signaled while in a function called from
> GDB.
> GDB remains in the frame where the signal was received.
> To change this behavior use "set unwindonsignal on"
> Evaluation of the expression containing the function (main_arena) will
> be abandoned.
> 
> ------- Forwarded Message
> Subject: [vtkusers] segfault Delete()ing vtkInterpolateDataSetAttributes
> 
> 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
> _______________________________________________
> This is the private VTK discussion list. 
> Please keep messages on-topic. Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
> 
> ------- End of Forwarded Message
> 
> _______________________________________________
> This is the private VTK discussion list. 
> Please keep messages on-topic. Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
> 






More information about the vtkusers mailing list