paceholder/nodeeditor

Segmentation fault when connection is set loose on clang release

alexge50 opened this issue · 1 comments

Hi,
There might be an issue in the library. Particularly, there application crashes when a connection is dragged but not connected to another port, but let go in the view. This bug only occurs on clang cmake release profile, (clang version: 8.0.0).
However, this does not happen on gcc release or debug profile, or clang debug profile.

The bug happens on the examples provided as well (tried with the calculator example). The operating system used is Linux.

Here is a stack trace when the calculator example crashes due to this bug:

QtNodes::Node::nodeGraphicsObject() 0x00007ff9be650870
QtNodes::NodeConnectionInteraction::canConnect(int&, std::function<std::shared_ptr<QtNodes::NodeData> (std::shared_ptr<QtNodes::NodeData>)>&) const 0x00007ff9be650c39
QtNodes::NodeConnectionInteraction::tryConnect() const 0x00007ff9be6511d9
QtNodes::ConnectionGraphicsObject::mouseReleaseEvent(QGraphicsSceneMouseEvent*) 0x00007ff9be64193f
QGraphicsItem::sceneEvent(QEvent*) 0x00007ff9be353727
<unknown> 0x00007ff9be376fad
QGraphicsScene::mouseReleaseEvent(QGraphicsSceneMouseEvent*) 0x00007ff9be37bf3a
QGraphicsScene::event(QEvent*) 0x00007ff9be386e90
QApplicationPrivate::notify_helper(QObject*, QEvent*) 0x00007ff9be063da4
QApplication::notify(QObject*, QEvent*) 0x00007ff9be06b3c1
QCoreApplication::notifyInternal2(QObject*, QEvent*) 0x00007ff9bd698849
QGraphicsView::mouseReleaseEvent(QMouseEvent*) 0x00007ff9be3a4cf9
QWidget::event(QEvent*) 0x00007ff9be0a4af8
QFrame::event(QEvent*) 0x00007ff9be14c71f
QGraphicsView::viewportEvent(QEvent*) 0x00007ff9be3a5cac
QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*, QEvent*) 0x00007ff9bd69855b
QApplicationPrivate::notify_helper(QObject*, QEvent*) 0x00007ff9be063d94
QApplication::notify(QObject*, QEvent*) 0x00007ff9be06b609
QCoreApplication::notifyInternal2(QObject*, QEvent*) 0x00007ff9bd698849
QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool, bool) 0x00007ff9be06a937
<unknown> 0x00007ff9be0bfc13
<unknown> 0x00007ff9be0c2cd7
QApplicationPrivate::notify_helper(QObject*, QEvent*) 0x00007ff9be063da4
QApplication::notify(QObject*, QEvent*) 0x00007ff9be06b3c1
QCoreApplication::notifyInternal2(QObject*, QEvent*) 0x00007ff9bd698849
QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) 0x00007ff9bda6f52d
QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) 0x00007ff9bda70956
QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) 0x00007ff9bda49d9c
<unknown> 0x00007ff9b9e08b8c
g_main_context_dispatch 0x00007ff9bc49d90f
<unknown> 0x00007ff9bc49f869
g_main_context_iteration 0x00007ff9bc49f8ae
QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) 0x00007ff9bd6ed969
QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) 0x00007ff9bd6974dc
QCoreApplication::exec() 0x00007ff9bd69f596
main 0x000055939040a449
__libc_start_main 0x00007ff9bcf8bce3
_start 0x000055939040661e

The function/line that produces the bug is this:

NodeGraphicsObject const &
Node::
nodeGraphicsObject() const
{
  return *_nodeGraphicsObject.get();
}

It appears that the _nodeGraphicsObject is null

I hope the bug is gone now with the version 3.