SocNetV crashes with EXC_BAD_ACCESS when the user generates a random network (e.g. Erdős–Rényi) while another network is already loaded and the "save before closing?" dialog is shown.
Steps to reproduce
- Load any network file
- Go to Network → Generate Random → Erdős–Rényi
- When asked "Network has not been saved. Do you want to save before closing?", click No
- Crash
Expected behavior
The existing network is cleared, the new random network is generated and displayed normally.
Crash location
GraphicsNode::addOutEdge(this=0x0)
← GraphicsEdge::GraphicsEdge (from=0x0, to=0x0)
← GraphicsWidget::drawEdge
← GraphicsWidget::setEdgeVisibility
← slotNetworkRandomErdosRenyiDialog (mainwindow.cpp:8463)
Root cause: During scene teardown of the old network, one or more GraphicsNode pointers become null/dangling before the new network's edges are drawn. GraphicsWidget::drawEdge then constructs a GraphicsEdge with a null from/to node, causing GraphicsNode::addOutEdge to dereference a null this pointer.
Environment
SocNetV crashes with
EXC_BAD_ACCESSwhen the user generates a random network (e.g. Erdős–Rényi) while another network is already loaded and the "save before closing?" dialog is shown.Steps to reproduce
Expected behavior
The existing network is cleared, the new random network is generated and displayed normally.
Crash location
Root cause: During scene teardown of the old network, one or more
GraphicsNodepointers become null/dangling before the new network's edges are drawn.GraphicsWidget::drawEdgethen constructs aGraphicsEdgewith a nullfrom/tonode, causingGraphicsNode::addOutEdgeto dereference a nullthispointer.Environment