This repository has been archived by the owner on Mar 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 24
Crash while loading a tlp file from python #98
Comments
I managed to reproduce the issue from my side. The scenario to reproduce it is the following:
See stacktrace in debug mode below:
@p-mary , the following diff seems to fix the issue and the tests are still green afterwards. diff --git a/library/tulip-core/src/GraphAbstract.cpp b/library/tulip-core/src/GraphAbstract.cpp
index e56af985a..1b39cf957 100644
--- a/library/tulip-core/src/GraphAbstract.cpp
+++ b/library/tulip-core/src/GraphAbstract.cpp
@@ -142,12 +142,14 @@ void GraphAbstract::delSubGraph(Graph *toRemove) {
// avoid deletion of toRemove subgraphs
toRemove->clearSubGraphs();
delete toRemove;
- } else
+ } else {
// toRemove is not deleted,
// and its subgraphs list is not erased;
// beacause it is registered into a GraphUpdatesRecorder
// in order it can be restored on undo or redo
toRemove->notifyDestroy();
+ static_cast<GraphImpl *>(getRoot())->freeSubGraphId(toRemove->getId());
+ }
}
} |
Thanks for your respective input. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
This one is reproducible:
From an existing tlpx project, loading a tlp file with loadgraph as follows:
In most but not all cases, it crashes.
It often does not crash with a new fresh project.
Stack below:
#00 0x0000000105311e37 in tlp::IdManager::getFreeId(unsigned int) (+0x1b7) from /Applications/Tulip-5.2.0-dev.app/Contents/Frameworks/libtulip-core-5.2.dylib
#1 0x00000001052cc58d in tlp::GraphImpl::getSubGraphId(unsigned int) (+0x1d) from /Applications/Tulip-5.2.0-dev.app/Contents/Frameworks/libtulip-core-5.2.dylib
#2 0x0000000105291e13 in tlp::GraphAbstract::GraphAbstract(tlp::Graph*, unsigned int) (+0xd3) from /Applications/Tulip-5.2.0-dev.app/Contents/Frameworks/libtulip-core-5.2.dylib
#3 0x000000010530a8c2 in tlp::GraphView::GraphView(tlp::Graph*, tlp::BooleanProperty*, unsigned int) (+0x22) from /Applications/Tulip-5.2.0-dev.app/Contents/Frameworks/libtulip-core-5.2.dylib
#4 0x000000010529235b in tlp::GraphAbstract::addSubGraph(unsigned int, tlp::BooleanProperty*, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&) (+0x3b) from /Applications/Tulip-5.2.0-dev.app/Contents/Frameworks/libtulip-core-5.2.dylib
#5 0x00000001053a3f26 in tlp::TLPGraphBuilder::addCluster(int, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, int) (+0x216) from /Applications/Tulip-5.2.0-dev.app/Contents/Frameworks/libtulip-core-5.2.dylib
#6 0x000000010539e8ff in tlp::TLPClusterBuilder::addInt(int) (+0x3f) from /Applications/Tulip-5.2.0-dev.app/Contents/Frameworks/libtulip-core-5.2.dylib
#7 0x00000001053a2fa0 in tlp::TLPParser::parse() (+0x100) from /Applications/Tulip-5.2.0-dev.app/Contents/Frameworks/libtulip-core-5.2.dylib
#8 0x00000001053a2199 in tlp::TLPImport::importGraph() (+0x619) from /Applications/Tulip-5.2.0-dev.app/Contents/Frameworks/libtulip-core-5.2.dylib
#9 0x0000000105297a7c in tlp::importGraph(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, tlp::DataSet&, tlp::PluginProgress*, tlp::Graph*) (+0x1bc) from /Applications/Tulip-5.2.0-dev.app/Contents/Frameworks/libtulip-core-5.2.dylib
#10 0x0000000116f88ad1 in meth_tlp_loadGraph(_object*, _object*) (+0x111) from /Applications/Tulip-5.2.0-dev.app/Contents/lib/tulip/python/tulip/native/_tulip.so
#11 0x00007fff49091f89 in PyEval_EvalFrameEx (+0xb65) from /System/Library/Frameworks/Python.framework/Versions/2.7/Python
#12 0x00007fff49091232 in PyEval_EvalCodeEx (+0x60f) from /System/Library/Frameworks/Python.framework/Versions/2.7/Python
#13 0x00007fff49038935 in PyFunction_SetClosure (+0x322) from /System/Library/Frameworks/Python.framework/Versions/2.7/Python
#14 0x00007fff4901b581 in PyObject_Call (+0x61) from /System/Library/Frameworks/Python.framework/Versions/2.7/Python
#15 0x00007fff49096bfe in PyEval_CallObjectWithKeywords (+0x9f) from /System/Library/Frameworks/Python.framework/Versions/2.7/Python
#16 0x0000000116ac10a1 in tlp::PythonInterpreter::runGraphScript(QString const&, QString const&, tlp::Graph*, QString const&) (+0x241) from /Applications/Tulip-5.2.0-dev.app/Contents/Frameworks/libtulip-python-5.2.dylib
#17 0x0000000116b46be0 in tlp::PythonIDE::executeCurrentScript() (+0x420) from /Applications/Tulip-5.2.0-dev.app/Contents/Frameworks/libtulip-python-5.2.dylib
#18 0x000000010c7fc279 in QMetaObject::activate(QObject*, int, int, void**) (+0xc29) from /Applications/Tulip-5.2.0-dev.app/Contents/Frameworks/QtCore.framework/Versions/5/QtCore
#19 0x0000000105b7ba50 in QAbstractButton::isCheckable() const (+0x330) from /Applications/Tulip-5.2.0-dev.app/Contents/Frameworks/QtWidgets.framework/Versions/5/QtWidgets
#20 0x0000000105b7b8e0 in QAbstractButton::isCheckable() const (+0x1c0) from /Applications/Tulip-5.2.0-dev.app/Contents/Frameworks/QtWidgets.framework/Versions/5/QtWidgets
#21 0x0000000105b7c94f in QAbstractButton::mouseReleaseEvent(QMouseEvent*) (+0x10f) from /Applications/Tulip-5.2.0-dev.app/Contents/Frameworks/QtWidgets.framework/Versions/5/QtWidgets
#22 0x0000000105c62f9f in QToolButton::mouseReleaseEvent(QMouseEvent*) (+0xf) from /Applications/Tulip-5.2.0-dev.app/Contents/Frameworks/QtWidgets.framework/Versions/5/QtWidgets
#23 0x0000000105ab1c06 in QWidget::event(QEvent*) (+0x246) from /Applications/Tulip-5.2.0-dev.app/Contents/Frameworks/QtWidgets.framework/Versions/5/QtWidgets
#24 0x0000000105b7c6b0 in QAbstractButton::event(QEvent*) (+0xa0) from /Applications/Tulip-5.2.0-dev.app/Contents/Frameworks/QtWidgets.framework/Versions/5/QtWidgets
#25 0x0000000105c63565 in QToolButton::event(QEvent*) (+0x145) from /Applications/Tulip-5.2.0-dev.app/Contents/Frameworks/QtWidgets.framework/Versions/5/QtWidgets
#26 0x0000000105a7863d in QApplicationPrivate::notify_helper(QObject*, QEvent*) (+0x12d) from /Applications/Tulip-5.2.0-dev.app/Contents/Frameworks/QtWidgets.framework/Versions/5/QtWidgets
#27 0x0000000105a7b61f in QApplication::notify(QObject*, QEvent*) (+0x1def) from /Applications/Tulip-5.2.0-dev.app/Contents/Frameworks/QtWidgets.framework/Versions/5/QtWidgets
#28 0x000000010c7ca3a4 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (+0xa4) from /Applications/Tulip-5.2.0-dev.app/Contents/Frameworks/QtCore.framework/Versions/5/QtCore
#29 0x0000000105a78f6a in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer&, bool) (+0x36a) from /Applications/Tulip-5.2.0-dev.app/Contents/Frameworks/QtWidgets.framework/Versions/5/QtWidgets
#30 0x0000000105ad22e6 in QDesktopWidget::qt_metacall(QMetaObject::Call, int, void**) (+0x2346) from /Applications/Tulip-5.2.0-dev.app/Contents/Frameworks/QtWidgets.framework/Versions/5/QtWidgets
#31 0x0000000105ad1169 in QDesktopWidget::qt_metacall(QMetaObject::Call, int, void**) (+0x11c9) from /Applications/Tulip-5.2.0-dev.app/Contents/Frameworks/QtWidgets.framework/Versions/5/QtWidgets
#32 0x0000000105a7863d in QApplicationPrivate::notify_helper(QObject*, QEvent*) (+0x12d) from /Applications/Tulip-5.2.0-dev.app/Contents/Frameworks/QtWidgets.framework/Versions/5/QtWidgets
#33 0x0000000105a799b7 in QApplication::notify(QObject*, QEvent*) (+0x187) from /Applications/Tulip-5.2.0-dev.app/Contents/Frameworks/QtWidgets.framework/Versions/5/QtWidgets
#34 0x000000010c7ca3a4 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (+0xa4) from /Applications/Tulip-5.2.0-dev.app/Contents/Frameworks/QtCore.framework/Versions/5/QtCore
#35 0x000000010bc3f96c in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) (+0xbfc) from /Applications/Tulip-5.2.0-dev.app/Contents/Frameworks/QtGui.framework/Versions/5/QtGui
#36 0x000000010bc255fb in QWindowSystemInterface::sendWindowSystemEvents(QFlagsQEventLoop::ProcessEventsFlag) (+0x9b) from /Applications/Tulip-5.2.0-dev.app/Contents/Frameworks/QtGui.framework/Versions/5/QtGui
#37 0x000000010f7b0a01 in qt_plugin_instance (+0x21101) from /Applications/Tulip-5.2.0-dev.app/Contents/PlugIns/platforms/libqcocoa.dylib
#38 0x00007fff3e8d6a61 in CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION (+0x11) from /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
#39 0x00007fff3e99047c in __CFRunLoopDoSource0 (+0x6c) from /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
#40 0x00007fff3e8b94c0 in __CFRunLoopDoSources0 (+0xd0) from /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
#41 0x00007fff3e8b893d in __CFRunLoopRun (+0x50d) from /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
#42 0x00007fff3e8b81a3 in CFRunLoopRunSpecific (+0x1e3) from /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
#43 0x00007fff3dba0d96 in RunCurrentEventLoopInMode (+0x11e) from /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox
#44 0x00007fff3dba0a0f in ReceiveNextEventCommon (+0x16e) from /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox
#45 0x00007fff3dba0884 in _BlockUntilNextEventMatchingListInModeWithFilter (+0x40) from /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox
#46 0x00007fff3be53a73 in _DPSNextEvent (+0x825) from /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
#47 0x00007fff3c5e9e34 in -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] (+0xbe4) from /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
#48 0x00007fff3be48885 in -[NSApplication run] (+0x2fc) from /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
#49 0x000000010f7af76d in qt_plugin_instance (+0x1fe6d) from /Applications/Tulip-5.2.0-dev.app/Contents/PlugIns/platforms/libqcocoa.dylib
The text was updated successfully, but these errors were encountered: