Hi Sascha,

With your patch and the little fix, it fails at the line of code you told me to replace.

mitk::DataNode::ConstPointer nodeGuard(node);
to
DoubleDeletionGuard guard(node);

MitkCore.dll!DoubleDeletionGuard::DoubleDeletionGuard(const itk::Object * obj=0x000000000bdd7240) Line 33 C++ > MitkCore.dll!mitk::StandaloneDataStorage::Remove(const mitk::DataNode * node=0x000000000bdd7240) Line 136 C++ liborg_mitk_gui_qt_datamanager.dll!QmitkDataManagerView::RemoveSelectedNodes(bool __formal=true) Line 875 C++ liborg_mitk_gui_qt_datamanager.dll!QmitkNodeTableViewKeyFilter::eventFilter(QObject * obj=0x0000000004533e40, QEvent * event=0x0000000000158360) Line 64 C++ QtCored4.dll!QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject * receiver=0x0000000004533e40, QEvent * event=0x0000000000158360) Line 1063 C++ QtGuid4.dll!QApplicationPrivate::notify_helper(QObject * receiver=0x0000000004533e40, QEvent * e=0x0000000000158360) Line 4561 C++ QtGuid4.dll!QApplication::notify(QObject * receiver=0x0000000004533e40, QEvent * e=0x0000000000158360) Line 4006 C++ QtCored4.dll!QCoreApplication::notifyInternal(QObject * receiver=0x0000000004533e40, QEvent * event=0x0000000000158360) Line 953 C++ QtCored4.dll!QCoreApplication::sendSpontaneousEvent(QObject * receiver=0x0000000004533e40, QEvent * event=0x0000000000158360) Line 234 C++ QtGuid4.dll!QETWidget::sendSpontaneousEvent(QObject * r=0x0000000004533e40, QEvent * e=0x0000000000158360) Line 588 C++ QtGuid4.dll!QKeyMapper::sendKeyEvent(QWidget * widget=0x0000000004533e40, bool grab=false, QEvent::Type type=KeyPress, int code=16777223, QFlags<enum Qt::KeyboardModifier> modifiers={...}, const QString & text={...}, bool autorepeat=false, int count=0, unsigned int nativeScanCode=339, unsigned int nativeVirtualKey=46, unsigned int nativeModifiers=16777728, bool * __formal=0x0000000000000000) Line 1217 C++ QtGuid4.dll!QKeyMapperPrivate::translateKeyEvent(QWidget * widget=0x0000000004533e40, const tagMSG & msg={...}, bool grab=false) Line 1110 QtGuid4.dll!QtWndProc(HWND__ * hwnd=0x00000000000108fa, unsigned int message=256, unsigned __int64 wParam=46, __int64 lParam=22216705) Line 1821 C++
user32.dll!0000000077a09bd1()    Unknown
     ...


Le 2015-01-29 16:27, Sascha Zelzer a écrit :
Thanks a lot for the testing. I will probably still apply the patch to the MITK master and try to replicate your behavior with a unit test. There is probably just another double delete in the call chain.

If you happen to be able to provide a meaningful stack trace with your crash (with the code changes from the patch and the change in the mail), that would be great.

Thanks,
Sascha

On 01/26/2015 08:38 PM, Nil Goyette wrote:
Hi Sascha,

I still have the same problem. It does happen a little less frequently though.

Le 2015-01-23 13:02, Sascha Zelzer a écrit :
Hi Nil,

thanks a lot for your testing.

It looks like I missed changing line mitkStandaloneDataStorage.cpp:120 in the patch. Do you mind testing the patch again + changing
  mitk::DataNode::ConstPointer nodeGuard(node);
to
   DoubleDeletionGuard guard(node);
in your MITK build?

Thanks again,

Sascha


On 01/23/2015 06:22 PM, Nil Goyette wrote:
Hi Sascha,

As requested, I removed the all fixes proposed in this thread, tested and saw the error again, 50% of the time.
Then I applied your patch and tested again.
In release, it fails every time.
In debug, it failed after 5 tests on line
- mitkStandaloneDataStorage.cpp 120 : mitk::DataNode::ConstPointer nodeGuard(node);
- itkSmartPointer.h 152 : if ( m_Pointer ) { m_Pointer->Register(); }
So, it's exactly the same behavior I had before.

I'll keep the other patches for the time being ;)

Le 2015-01-22 12:04, Sascha Zelzer a écrit :
Hi Nil,

I just entered bug

http://bugs.mitk.org/show_bug.cgi?id=18672

for this. Could you please try the attached patch for me (based on 2014.10), without any other proposed fixes from this mail thread?

Thanks,

Sascha


On 01/12/2015 08:18 PM, Nil Goyette wrote:
Hi all,

I have at least two nodes (I have drawn more, but I can reproduce the bug with 2 nodes)
- Node1
--- Node2Â  (child of Node1)
--- Node3
----- Node4
----- Node5
- Some other nodes

When the user deletes Node1, I want to delete all children nodes (2, 3, 4, 5). To do so, I use NodeDeleted(), I ask the DataStorage for all derivative nodes of the deleted node and delete them all. A problem arises when the user highlights all nodes and delete them. Some nodes are deleted more then one time. Of course, there are conditions in mitk and in my own code that check if the node is null, but it still fails about half of the time. Since the NodeRemoved() event is thrown *before* the actual deletion, the null/exists checks are useless.

I'm probably not the first that want to delete all the children of a node. I feel that this should be simple. Is there a feature to do it that I'm n

        

------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to