[IGSTK-Users] Segmentation Fault when Adding and Removing objects
Matt Turek
matt.turek at kitware.com
Wed Jan 16 12:47:39 EST 2008
Vincent,
The current crash happens when an object tries to remove observers from
an object that has already been deleted. This problem is related to our
solution to your previous bug report.
Luis, Andinet, and I discussed a solution yesterday that I'm trying now.
We'll let you know when we have a fix.
Matt
Vincent Gratsac wrote:
> Hi all,
>
> Thank you for taking care of my bug report, and for submitting a quick
> reply.
>
> I updated the IGSTK Sandbox source and rebuild it. So now, I have no
> problem when adding and removing ObjectRepresentation.
> Thank you very much for your fix.
>
> Unfortunately, I think that a small bug is still remaining. I tried to
> use the example that I submitted in my last mail, and I found that if
> I close the application when an ObjectRepresentation is displayed, it
> will generated a segmentation fault.
> Can you reproduce this bug ? And do you have any idea on the origin of
> it ?
>
> Have a nice day,
>
> Vincent
>
> Matt Turek wrote:
>>
>>
>> Vincent,
>>
>> Luis, Andinet, and I looked into the bug you submitted and we think
>> we have a fix.
>>
>> There was an issue when an igstk::ObjectRepresentation was deleted.
>> An event transduction macro in igstk::ObjectRepresentation had
>> created an observer that was still attached to the
>> igstk::SpatialObject, even after the igstk::ObjectRepresentation was
>> deleted. This caused a crash when the igstk::SpatialObject tried to
>> invoke the callback in the deleted igstk::ObjectRepresentation.
>>
>> Luis has checked in changes in igstkMacros.h, igstkObject.h, and
>> igstkObject.cxx that should fix the problem. Now, an igstk::Object
>> maintains a list of observed objects and observer tags and cleans up
>> its observer callbacks when igstk::Object is destroyed.
>> RemoveFromObservedObjects() in igstk::Object::~Object() carries out
>> the cleanup.
>>
>> We have also checked in a test, igstkObjectRepresentationRemovalTest,
>> in Sandbox/Testing that reproduced the problem.
>>
>> Would you update your source, rebuild, and verify that we've fixed
>> the crash?
>>
>> Thanks again for another great bug report. The example you provided
>> was a huge help.
>>
>> Thanks,
>> Matt
>>
>>
>>
>>
>>
>>
>> Andinet Enquobahrie wrote:
>>> Hi Vincent,
>>>
>>> This is to acknowledge that I was able to build your small example and
>>> reproduce your problem. I will look into and get back to you.
>>>
>>> Thanks for providing the small example.
>>>
>>> -Andinet
>>>
>>>> Hi igstk-users,
>>>>
>>>> I am faced with a serious bug in my code, and I am not able to find
>>>> where it comes from.
>>>>
>>>> When I add one (or some) representation(s) to a view, and next
>>>> remove one (or some), the program results in a segmentation fault.
>>>> An important point is that adding/removing must be made by the
>>>> user, through the user interface.
>>>>
>>>> I tried to reproduce this bug in a simple example, in order to
>>>> debug and understand it.
>>>> I attached the corresponding code inspired from the
>>>> OneViewAndTrackingUsingQtWidget example.
>>>>
>>>> Please let me know if I made any mistake, or if you don't
>>>> understand something in my code.
>>>>
>>>> Thank you and have a nice day,
>>>>
>>>> Vincent
>>>>
>>>> ------------------------------------------------------------------------
>>>>
>>>>
>>>> _______________________________________________
>>>> IGSTK-Users mailing list
>>>> IGSTK-Users at public.kitware.com
>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/igstk-users
>>>>
>>>
>>>
>>
>>
>
--
Matt Turek, Ph.D.
R&D Engineer
Kitware, Inc.
28 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-371-3971 x142
email: Matt.Turek at kitware.com
More information about the IGSTK-Users
mailing list