Crash after Reset Session
ParaView crashes after reset session if last selected item in Pipeline browser was output port.
Affected versions: 5.9.1, 5.10.1
The reason of crash is that Current
class member of vtkSMProxySelectionModel
is not reset to null on reset session (as a result of proxy unregistration). vtkSMProxySelectionModel
is the one that registered as "ActiveSources".
Line of crash is the one highlighted with breakpoint on video.
For 5.9.1 sources it is vtkSMProxySelectionModel:414.
Current
class member declared as vtkSmartPointer<vtkSMProxy> Current;
, but it seems like there should be a weak pointer.
UPD. Making Current
class member as vtkWeakPointer
in my local sources did the job.
UPD2. Another weak spot is here:
bool vtkSMParaViewPipelineController::UnRegisterPipelineProxy(vtkSMProxy* proxy)
{
PREPARE_FOR_UNREGISTERING(proxy);
vtkSMSessionProxyManager* pxm = proxy->GetSessionProxyManager();
const char* _proxyname = pxm->GetProxyName("sources", proxy);
if (_proxyname == NULL)
{
return false;
}
SM_SCOPED_TRACE(Delete).arg("proxy", proxy);
const std::string proxyname(_proxyname);
// ensure proxy is no longer active.
vtkSMProxySelectionModel* selmodel = pxm->GetSelectionModel("ActiveSources");
assert(selmodel != NULL);
if (selmodel->GetCurrentProxy() == proxy)
{
selmodel->SetCurrentProxy(NULL, vtkSMProxySelectionModel::CLEAR_AND_SELECT);
}
// remove proxy from TimeKeeper.
vtkSMProxy* timeKeeper = this->FindTimeKeeper(proxy->GetSession());
vtkSMTimeKeeperProxy::RemoveTimeSource(timeKeeper, proxy,
/*unsuppress_input*/ (proxy->GetProperty("TimestepValues") != NULL ||
proxy->GetProperty("TimeRange") != NULL));
// unregister dependencies.
this->UnRegisterDependencies(proxy);
// this will remove both proxy-list-domain helpers and animation helpers.
this->FinalizeProxy(proxy);
// unregister the proxy.
pxm->UnRegisterProxy("sources", proxyname.c_str(), proxy);
return true;
}
You will never get to selmodel->SetCurrentProxy(NULL, vtkSMProxySelectionModel::CLEAR_AND_SELECT);
because vtkSMOutputPort
proxies are not registered under "sources" AFAIR (or does not have a name).