Open sergeiNikolaev opened 2 years ago
First of all, you should try to get rid of the [WARNING] [ObjectFactory] Class already registered
It usually means you already loaded a library with the same components inside.
In your case, you have a mixup between your build version and an installed version.
Indeed, you are running runSofa from the build (/home/sergei/Source_code/Sofa_development/sofa/build_release/bin/runSofa
) and SOFA_ROOT is set to SOFA_ROOT: /home/sergei/Source_code/Sofa_development/sofa/build_release/install
Either run from your install (and keep SOFA_ROOT); or set SOFA_ROOT to your build directory.
Well, here is the updated log. (I also did small corrections in scene to remove warnings I know how to remove. Anyway, the issue is still there). The scene with corrections is attached. test_scene.zip
Full output
[sergei@sergei-20hd0000fr test_scene]$ /home/sergei/Source_code/Sofa_development/sofa/build_release/install/bin/runSofa -l /home/sergei/Source_code/Sofa_development/SofaPython3/build_release/install/lib/libSofaPython3.so /home/sergei/Source_code/test_scene/test_scene.py
[WARNING] [SofaEigen2Solver] SofaEigen2Solver is deprecated; Eigen classes are now located in Sofa.LinearAlgebra and SVDLinearSolver in SofaDenseSolver.You can remove SofaEigen2Solver from your scene, and if using SVDLinearSolver, please load SofaDenseSolver instead.
[INFO] [runSofa] PluginRepository paths = /home/sergei/Source_code/Sofa_development/Optimus/build_release:/home/sergei/Source_code/Sofa_development/SofaAuxiliaryComponents/build_release:/home/sergei/Source_code/Sofa_development/sofa/build_release/install/plugins:/home/sergei/Source_code/Sofa_development/sofa/build_release/install/lib
[INFO] [runSofa] DataRepository paths = /home/sergei/Source_code/Sofa_development/sofa/build_release/install/share/sofa:/home/sergei/Source_code/Sofa_development/sofa/build_release/install/share/sofa/examples:/home/sergei/Source_code/Sofa_development/sofa/build_release/install/share/sofa:/home/sergei/Source_code/Sofa_development/sofa/build_release/install/share/sofa/examples
[INFO] [runSofa] GuiDataRepository paths = /home/sergei/Source_code/Sofa_development/sofa/build_release/install/share/sofa/gui/runSofa:/home/sergei/Source_code/Sofa_development/sofa/build_release/install/share/sofa/gui/qt:/home/sergei/Source_code/Sofa_development/sofa/build_release/install/share/sofa/gui/qt
[INFO] [SofaPython3] Initializing with python version 3.10.4 (main, Mar 23 2022, 23:05:40) [GCC 11.2.0]
[INFO] [SofaPython3] Registering a scene loader for [.py, .py3, .pyscn, .py3scn] files.
[INFO] [SofaPython3] Shared library name is 'libpython3.1m.so'
[INFO] [SofaPython3] Intializing python
[INFO] [SofaPython3] Added '/home/sergei/Source_code/Sofa_development/SofaPython3/build_release/install/lib/python3/site-packages' to sys.path
---------------------------------------
Checking SOFA_ROOT and SOFAPYTHON3_ROOT
Using environment variable SOFA_ROOT: /home/sergei/Source_code/Sofa_development/sofa/build_release/install
---------------------------------------
[INFO] [PluginManager] Loaded plugin: /home/sergei/Source_code/Sofa_development/SofaPython3/build_release/install/lib/libSofaPython3.so
[INFO] [runSofa] Loading automatically plugin list in /home/sergei/Source_code/Sofa_development/sofa/build_release/install/lib/plugin_list.conf.default
[INFO] [PluginManager] Loaded plugin: /home/sergei/Source_code/Sofa_development/sofa/build_release/install/plugins/SofaSimpleFem/lib/libSofaSimpleFem.so
[INFO] [PluginManager] Loaded plugin: /home/sergei/Source_code/Sofa_development/sofa/build_release/install/plugins/SofaRigid/lib/libSofaRigid.so
[INFO] [PluginManager] Loaded plugin: /home/sergei/Source_code/Sofa_development/sofa/build_release/install/plugins/SofaDeformable/lib/libSofaDeformable.so
[INFO] [PluginManager] Loaded plugin: /home/sergei/Source_code/Sofa_development/sofa/build_release/install/plugins/SofaObjectInteraction/lib/libSofaObjectInteraction.so
[INFO] [PluginManager] Loaded plugin: /home/sergei/Source_code/Sofa_development/sofa/build_release/install/plugins/SofaMeshCollision/lib/libSofaMeshCollision.so
[INFO] [PluginManager] Loaded plugin: /home/sergei/Source_code/Sofa_development/sofa/build_release/install/plugins/SofaEngine/lib/libSofaEngine.so
[INFO] [PluginManager] Loaded plugin: /home/sergei/Source_code/Sofa_development/sofa/build_release/install/plugins/SofaExplicitOdeSolver/lib/libSofaExplicitOdeSolver.so
[INFO] [PluginManager] Loaded plugin: /home/sergei/Source_code/Sofa_development/sofa/build_release/install/plugins/SofaImplicitOdeSolver/lib/libSofaImplicitOdeSolver.so
[INFO] [PluginManager] Loaded plugin: /home/sergei/Source_code/Sofa_development/sofa/build_release/install/plugins/SofaLoader/lib/libSofaLoader.so
[INFO] [PluginManager] Loaded plugin: /home/sergei/Source_code/Sofa_development/sofa/build_release/install/plugins/SofaGeneralVisual/lib/libSofaGeneralVisual.so
[INFO] [PluginManager] Loaded plugin: /home/sergei/Source_code/Sofa_development/sofa/build_release/install/plugins/SofaGraphComponent/lib/libSofaGraphComponent.so
[INFO] [PluginManager] Loaded plugin: /home/sergei/Source_code/Sofa_development/sofa/build_release/install/plugins/SofaGeneralMeshCollision/lib/libSofaGeneralMeshCollision.so
[INFO] [PluginManager] Loaded plugin: /home/sergei/Source_code/Sofa_development/sofa/build_release/install/plugins/SofaBoundaryCondition/lib/libSofaBoundaryCondition.so
[INFO] [PluginManager] Loaded plugin: /home/sergei/Source_code/Sofa_development/sofa/build_release/install/plugins/SofaGeneralAnimationLoop/lib/libSofaGeneralAnimationLoop.so
[INFO] [PluginManager] Loaded plugin: /home/sergei/Source_code/Sofa_development/sofa/build_release/install/plugins/SofaGeneralDeformable/lib/libSofaGeneralDeformable.so
[INFO] [PluginManager] Loaded plugin: /home/sergei/Source_code/Sofa_development/sofa/build_release/install/plugins/SofaGeneralEngine/lib/libSofaGeneralEngine.so
[INFO] [PluginManager] Loaded plugin: /home/sergei/Source_code/Sofa_development/sofa/build_release/install/plugins/SofaGeneralExplicitOdeSolver/lib/libSofaGeneralExplicitOdeSolver.so
[INFO] [PluginManager] Loaded plugin: /home/sergei/Source_code/Sofa_development/sofa/build_release/install/plugins/SofaGeneralImplicitOdeSolver/lib/libSofaGeneralImplicitOdeSolver.so
[INFO] [PluginManager] Loaded plugin: /home/sergei/Source_code/Sofa_development/sofa/build_release/install/plugins/SofaGeneralLinearSolver/lib/libSofaGeneralLinearSolver.so
[INFO] [PluginManager] Loaded plugin: /home/sergei/Source_code/Sofa_development/sofa/build_release/install/plugins/SofaGeneralRigid/lib/libSofaGeneralRigid.so
[INFO] [PluginManager] Loaded plugin: /home/sergei/Source_code/Sofa_development/sofa/build_release/install/plugins/SofaGeneralObjectInteraction/lib/libSofaGeneralObjectInteraction.so
[INFO] [PluginManager] Loaded plugin: /home/sergei/Source_code/Sofa_development/sofa/build_release/install/plugins/SofaGeneralSimpleFem/lib/libSofaGeneralSimpleFem.so
[INFO] [PluginManager] Loaded plugin: /home/sergei/Source_code/Sofa_development/sofa/build_release/install/plugins/SofaGeneralTopology/lib/libSofaGeneralTopology.so
[INFO] [PluginManager] Loaded plugin: /home/sergei/Source_code/Sofa_development/sofa/build_release/install/plugins/SofaTopologyMapping/lib/libSofaTopologyMapping.so
[INFO] [PluginManager] Loaded plugin: /home/sergei/Source_code/Sofa_development/sofa/build_release/install/plugins/SofaUserInteraction/lib/libSofaUserInteraction.so
[INFO] [PluginManager] Loaded plugin: /home/sergei/Source_code/Sofa_development/sofa/build_release/install/plugins/SofaConstraint/lib/libSofaConstraint.so
[INFO] [PluginManager] Loaded plugin: /home/sergei/Source_code/Sofa_development/sofa/build_release/install/plugins/SofaGeneralLoader/lib/libSofaGeneralLoader.so
[INFO] [PluginManager] Loaded plugin: /home/sergei/Source_code/Sofa_development/sofa/build_release/install/plugins/SofaExporter/lib/libSofaExporter.so
[INFO] [PluginManager] Loaded plugin: /home/sergei/Source_code/Sofa_development/sofa/build_release/install/plugins/SofaSparseSolver/lib/libSofaSparseSolver.so
[INFO] [PluginManager] Loaded plugin: /home/sergei/Source_code/Sofa_development/sofa/build_release/install/plugins/SofaPreconditioner/lib/libSofaPreconditioner.so
[INFO] [PluginManager] Loaded plugin: /home/sergei/Source_code/Sofa_development/sofa/build_release/install/plugins/SofaHaptics/lib/libSofaHaptics.so
[INFO] [PluginManager] Loaded plugin: /home/sergei/Source_code/Sofa_development/sofa/build_release/install/plugins/SofaValidation/lib/libSofaValidation.so
[INFO] [PluginManager] Loaded plugin: /home/sergei/Source_code/Sofa_development/sofa/build_release/install/plugins/SofaDenseSolver/lib/libSofaDenseSolver.so
[INFO] [PluginManager] Loaded plugin: /home/sergei/Source_code/Sofa_development/sofa/build_release/install/plugins/SofaNonUniformFem/lib/libSofaNonUniformFem.so
[INFO] [PluginManager] Loaded plugin: /home/sergei/Source_code/Sofa_development/sofa/build_release/install/plugins/SofaOpenglVisual/lib/libSofaOpenglVisual.so
[INFO] [PluginManager] Loaded plugin: /home/sergei/Source_code/Sofa_development/sofa/build_release/install/plugins/SofaMiscTopology/lib/libSofaMiscTopology.so
[INFO] [PluginManager] Loaded plugin: /home/sergei/Source_code/Sofa_development/sofa/build_release/install/plugins/SofaMiscExtra/lib/libSofaMiscExtra.so
[INFO] [PluginManager] Loaded plugin: /home/sergei/Source_code/Sofa_development/sofa/build_release/install/plugins/SofaMiscForceField/lib/libSofaMiscForceField.so
[INFO] [PluginManager] Loaded plugin: /home/sergei/Source_code/Sofa_development/sofa/build_release/install/plugins/SofaMiscEngine/lib/libSofaMiscEngine.so
[INFO] [PluginManager] Loaded plugin: /home/sergei/Source_code/Sofa_development/sofa/build_release/install/plugins/SofaMiscSolver/lib/libSofaMiscSolver.so
[INFO] [PluginManager] Loaded plugin: /home/sergei/Source_code/Sofa_development/sofa/build_release/install/plugins/SofaMiscFem/lib/libSofaMiscFem.so
[INFO] [PluginManager] Loaded plugin: /home/sergei/Source_code/Sofa_development/sofa/build_release/install/plugins/SofaMiscMapping/lib/libSofaMiscMapping.so
[INFO] [PluginManager] Loaded plugin: /home/sergei/Source_code/Sofa_development/sofa/build_release/install/plugins/SofaMiscCollision/lib/libSofaMiscCollision.so
[INFO] [PluginManager] Loaded plugin: /home/sergei/Source_code/Sofa_development/sofa/build_release/install/plugins/CImgPlugin/lib/libCImgPlugin.so
Warning: Setting a new default format with a different version or profile after the global shared context is created may cause issues with context sharing.
The constructor with a QGLFormat is deprecated, use the regular contructor instead.
[INFO] [SceneCheckerVisitor] Validating node "root" with checks: [SceneCheckDuplicatedName, SceneCheckMissingRequiredPlugin, SceneCheckUsingAlias, SceneCheckDeprecatedComponents, SceneCheckCollisionResponse]
[INFO] [SceneCheckerVisitor] Finished validating node "root".
########## SIG 11 - SIGSEGV: segfault ##########
sofa::helper::BackTrace::sig(int)
sofa::component::forcefield::TetrahedronFEMForceField<sofa::defaulttype::StdVectorTypes<sofa::type::Vec<3u, double>, sofa::type::Vec<3u, double>, double> >::init()
sofa::simulation::InitVisitor::processNodeTopDown(sofa::simulation::Node*)
sofa::simulation::graph::DAGNode::executeVisitorTopDown(sofa::simulation::Visitor*, std::__cxx11::list<sofa::simulation::graph::DAGNode*, std::allocator<sofa::simulation::graph::DAGNode*> >&, std::map<sofa::simulation::graph::DAGNode*, sofa::simulation::graph::DAGNode::StatusStruct, std::less<sofa::simulation::graph::DAGNode*>, std::allocator<std::pair<sofa::simulation::graph::DAGNode* const, sofa::simulation::graph::DAGNode::StatusStruct> > >&, sofa::simulation::graph::DAGNode*)
sofa::simulation::graph::DAGNode::executeVisitorTopDown(sofa::simulation::Visitor*, std::__cxx11::list<sofa::simulation::graph::DAGNode*, std::allocator<sofa::simulation::graph::DAGNode*> >&, std::map<sofa::simulation::graph::DAGNode*, sofa::simulation::graph::DAGNode::StatusStruct, std::less<sofa::simulation::graph::DAGNode*>, std::allocator<std::pair<sofa::simulation::graph::DAGNode* const, sofa::simulation::graph::DAGNode::StatusStruct> > >&, sofa::simulation::graph::DAGNode*)
sofa::simulation::graph::DAGNode::doExecuteVisitor(sofa::simulation::Visitor*, bool)
sofa::simulation::Simulation::initNode(sofa::simulation::Node*)
sofa::simulation::Simulation::init(sofa::simulation::Node*)
__libc_start_main
Segmentation fault (core dumped)
[sergei@sergei-20hd0000fr test_scene]$
test_scene.zip
Problem
Description The problem is related to a dataset field in MeshVTKLoader, which declares object heterogeneous parts. Some time ago when it was defined using Data<> filed the data was loaded directly during init step. Now it is defined using createSofaData() method and initialized slightly later. On the other hand, in the scenes where the issue appears this dataset is used in Indices2ValuesMapper component (using @ link system), the output of which, in its turn, is used in TetrahedronFEMForceField (the same @links). So, without initialization, during init step, the ForceField just crashes.
Steps to reproduce runSofa -l libSofaPython3.so test_scene.py
########## SIG 11 - SIGSEGV: segfault ########## sofa::helper::BackTrace::sig(int) sofa::component::forcefield::TetrahedronFEMForceField<sofa::defaulttype::StdVectorTypes<sofa::type::Vec<3u, double>, sofa::type::Vec<3u, double>, double> >::init() sofa::simulation::InitVisitor::processNodeTopDown(sofa::simulation::Node) sofa::simulation::graph::DAGNode::executeVisitorTopDown(sofa::simulation::Visitor, std::cxx11::list<sofa::simulation::graph::DAGNode, std::allocator<sofa::simulation::graph::DAGNode> >&, std::map<sofa::simulation::graph::DAGNode, sofa::simulation::graph::DAGNode::StatusStruct, std::less<sofa::simulation::graph::DAGNode>, std::allocator<std::pair<sofa::simulation::graph::DAGNode const, sofa::simulation::graph::DAGNode::StatusStruct> > >&, sofa::simulation::graph::DAGNode) sofa::simulation::graph::DAGNode::executeVisitorTopDown(sofa::simulation::Visitor*, std::cxx11::list<sofa::simulation::graph::DAGNode, std::allocator<sofa::simulation::graph::DAGNode> >&, std::map<sofa::simulation::graph::DAGNode, sofa::simulation::graph::DAGNode::StatusStruct, std::less<sofa::simulation::graph::DAGNode>, std::allocator<std::pair<sofa::simulation::graph::DAGNode const, sofa::simulation::graph::DAGNode::StatusStruct> > >&, sofa::simulation::graph::DAGNode) sofa::simulation::graph::DAGNode::doExecuteVisitor(sofa::simulation::Visitor, bool) sofa::simulation::Simulation::initNode(sofa::simulation::Node) sofa::simulation::Simulation::init(sofa::simulation::Node*) __libc_start_main Segmentation fault (core dumped)
Expected behavior the scene has to run (When I replace dataset with dataset1 which I declared as:
diff --git a/SofaKernel/modules/SofaCore/src/sofa/core/loader/MeshLoader.cpp b/SofaKernel/modules/SofaCore/src/sofa/core/loader/MeshLoader.cpp index 2f00fe62dc..782ce854ce 100644 --- a/SofaKernel/modules/SofaCore/src/sofa/core/loader/MeshLoader.cpp +++ b/SofaKernel/modules/SofaCore/src/sofa/core/loader/MeshLoader.cpp @@ -72,6 +72,7 @@ MeshLoader::MeshLoader() : BaseLoader() , d_rotation(initData(&d_rotation, Vec3(), "rotation", "Rotation of the DOFs")) , d_scale(initData(&d_scale, Vec3(1.0, 1.0, 1.0), "scale3d", "Scale of the DOFs in 3 dimensions")) , d_transformation(initData(&d_transformation, type::Matrix4::s_identity, "transformation", "4x4 Homogeneous matrix to transform the DOFs (when present replace any)"))
, d_dataset1(initData(&d_dataset1, "dataset1", "Data from dataset")) , d_previousTransformation(type::Matrix4::s_identity ) { addAlias(&d_tetrahedra, "tetras"); @@ -184,6 +185,8 @@ void MeshLoader::clearBuffers() getWriteOnlyAccessor(d_pyramidsGroups).clear(); getWriteOnlyAccessor(d_polygonsGroups).clear();
getWriteOnlyAccessor(d_dataset1).clear();
doClearBuffers(); }
diff --git a/SofaKernel/modules/SofaCore/src/sofa/core/loader/MeshLoader.h b/SofaKernel/modules/SofaCore/src/sofa/core/loader/MeshLoader.h index d972c27d75..5fc1d75345 100644 --- a/SofaKernel/modules/SofaCore/src/sofa/core/loader/MeshLoader.h +++ b/SofaKernel/modules/SofaCore/src/sofa/core/loader/MeshLoader.h @@ -183,6 +183,7 @@ public: Data< Vec3 > d_scale; ///< Scale of the DOFs in 3 dimensions Data< type::Matrix4 > d_transformation; ///< 4x4 Homogeneous matrix to transform the DOFs (when present replace any)
Data< type::vector< SReal > > d_dataset1; ///< mesh dataset
virtual void updateMesh(); virtual void updateElements(); diff --git a/SofaKernel/modules/SofaLoader/src/SofaLoader/MeshVTKLoader.cpp b/SofaKernel/modules/SofaLoader/src/SofaLoader/MeshVTKLoader.cpp index fcf73fb5f2..241067ea0b 100644 --- a/SofaKernel/modules/SofaLoader/src/SofaLoader/MeshVTKLoader.cpp +++ b/SofaKernel/modules/SofaLoader/src/SofaLoader/MeshVTKLoader.cpp @@ -504,6 +504,27 @@ bool MeshVTKLoader::setInputsMesh() }
}
if (reader->inputPoints) { delete reader->inputPoints;
everything work fine
Environment
Context
System: Linux sergei-20hd0000fr 5.16.18-1-MANJARO #1 SMP PREEMPT Mon Mar 28 09:13:53 UTC 2022 x86_64 GNU/Linux
Version of SOFA: Your branch is up to date with 'origin/v21.12' for 24.04.2022
State: Build or install directory Command called
Env vars
Logs
Full output
Content of build_dir/CMakeCache.txt CMakeCache.txt test_scene.zip
< DRAG AND DROP YOUR CMAKECACHE.TXT HERE >
Thank you for your report.