Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GiDIO segfaults without Variables added #492

Closed
philbucher opened this issue Jun 13, 2017 · 39 comments
Closed

GiDIO segfaults without Variables added #492

philbucher opened this issue Jun 13, 2017 · 39 comments

Comments

@philbucher
Copy link
Member

If GiDIO is initialized with a modelpart where variables have not been added yet it exits with Segmentation Fault. This is not so nice to debug, can a check be implemented for that?

@RiccardoRossi
Copy link
Member

RiccardoRossi commented Jun 13, 2017 via email

@RiccardoRossi
Copy link
Member

@philbucher can u write a minimal python test for this?

@philbucher
Copy link
Member Author

@RiccardoRossi Unfortunately I cannot replicate the error now :/
Is it possible that sth has been fixed? I am pretty sure that I did the same as last time but now it works

If will close this issue and reopen it in case I have the same problem again.

@philbucher
Copy link
Member Author

philbucher commented Oct 10, 2017

@AndreasWinterstein and me found a very nasty bug that is very similar to this issue:
While debugging we started getting rather random segfaults after adding line 108 in the attached example, where we added another nodal variable (fluid_model_part.AddNodalSolutionStepVariable(VAUX_EQ_TRACTION)) after the initialization was already done. (After uncommenting this line it works)

Figuring this out took us several hours, so it would be really good to have a solution or at least a warning/error message for this! @KratosMultiphysics/kratos-core-team and @jcotela do you have an idea of how to do this?

We could unfortunately not pin down what is the exact problem. Therefore sorry for the rather long script, but it is relatively hard to reproduce.
Segfault.zip

@RiccardoRossi
Copy link
Member

@philbucher Tere is a test with expected failure in the kratos core.

Cold you see if it is the same error?

@philbucher
Copy link
Member Author

Which test are you referring to? I looked at the tests of model_part and GidIO but I couldn't find anything related to this

@pooyan-dadvand
Copy link
Member

I have not check the test you sent but everything is pointing to a memory error by using a nodal variable which is not added. You can check this by building the FullDebug version of Kratos as described in wiki

@RiccardoRossi
Copy link
Member

RiccardoRossi commented Oct 10, 2017 via email

@philbucher
Copy link
Member Author

@RiccardoRossi the test fails as expected
@pooyan-dadvand even in full debug it only segfaults without any proper message

@pooyan-dadvand
Copy link
Member

I have no clue but the expected fail given by @RiccardoRossi will be solved by hash variables. So if is the same reason the solution would be the same.

@philbucher
Copy link
Member Author

I think what @RiccardoRossi means is a different issue

@pooyan-dadvand
Copy link
Member

Let me check it...

@pooyan-dadvand
Copy link
Member

Do you have an updated version of the test you posted? It gives me a python error before crashing:

Boost.Python.ArgumentError: Python argument types in
    VariableUtils.SetScalarVar(VariableUtils, Array1DComponentVariable, float, NoneType)
did not match C++ signature:
...

@philbucher
Copy link
Member Author

That is unfortunate, for me it works, I am on the latest version of the master branch. Are you using an older version?

@philbucher
Copy link
Member Author

I am not 100% sure but I think this could actually be related to the problem. I remember that when I first encountered this problem I had similar errors. That was part of the reason why it took so long to debug.

@pooyan-dadvand
Copy link
Member

It was in my branch from Monday. Let me check it with master branch now. But it gives me an idea that maybe you have two incompatible binaries for core and application you have.

@pooyan-dadvand
Copy link
Member

I have still the same signature error. @philbucher would you please check it by yourself?

@philbucher
Copy link
Member Author

I get the following output:

 |  /           |             
 ' /   __| _` | __|  _ \   __|
 . \  |   (   | |   (   |\__ \ 
_|\_\_|  \__,_|\__|\___/ ____/
           Multi-Physics 5.1.0-aa6d940
Importing    KratosFluidDynamicsApplication
Initializing KratosFluidDynamicsApplication... 
Importing    KratosExternalSolversApplication
Initializing KratosExternalSolversApplication... 
Importing    KratosMeshingApplication
Initializing Kratos MeshingApplication... 
Importing    KratosFSIApplication
Initializing KratosFSIApplication... 
Importing    KratosStructuralMechanicsApplication
     KRATOS   ___|  |                   |                   |               
            \___ \  __|  __| |   |  __| __| |   |  __| _` | |               
                  | |   |    |   | (    |   |   | |   (   | |               
            _____/ \__|_|   \__,_|\___|\__|\__,_|_|  \__,_|_| MECHANICS     
Importing    KratosALEApplication
KRATOS    ___   __   ____             
         / _ | / /  / __/             
        / __ |/ /__/ _/               
       /_/ |_/____/___/  application  
Initializing KratosALEApplication...  
Construction of NavierStokesSolver_VMSMonolithic finished
::[MeshSolverBase]:: Construction finished
::[MeshSolverStructuralSimilarity]:: Construction finished
::[ALENavierStokesSolverVMSMonolithic]:: Construction finished
Base class fluid solver variables added correctly
Monolithic fluid solver variables added correctly
::[MeshSolverBase]:: Variables ADDED.
::[ALENavierStokesSolverVMSMonolithic]:: Variables ADDED.
  [Reading Nodes    : 2322 nodes read]
  [Reading Elements : 4313 elements read] [Type: Element2D3N]
  [Reading Conditions : 10 conditions read] [Type: WallCondition2D2N]
  [Reading Conditions : 62 conditions read] [Type: WallCondition2D2N]
  [Reading Conditions : 60 conditions read] [Type: WallCondition2D2N]
  [Reading Conditions : 60 conditions read] [Type: WallCondition2D2N]
  [Reading Conditions : 1 conditions read] [Type: WallCondition2D2N]
  [Reading Conditions : 111 conditions read] [Type: WallCondition2D2N]
  [Total Lines Read : 14317]
adding nodes and elements to fluid_computational_model_part
-fluid_computational_model_part- model part
    Number of tables : 0
    Number of sub model parts : 0

    Mesh 0 : 
        Number of Nodes      : 2322
        Number of Properties : 0
        Number of Elements   : 4313
        Number of Conditions : 304


No inverted elements found
Mesh orientation check found 134 inverted conditions.
Base class model reading finished.
No inverted elements found
No inverted conditions found
Base class fluid solver DOFs added correctly.
::[MeshSolverBase]:: DOFs ADDED.
::[ALENavierStokesSolverVMSMonolithic]:: DOFs ADDED.
Monolithic solver initialization finished.
::[MeshSolverBase]:: Finished initialization.
::[ALENavierStokesSolverVMSMonolithic]:: Finished initialization.
Segmentation fault (core dumped)

Do you have an idea what else we can do?

@pooyan-dadvand
Copy link
Member

in master? There is something wrong with my compilation then (or maybe yours which cause this segmentation fault)
let me see.

@pooyan-dadvand
Copy link
Member

With master branch last night I could not reproduce it.... It crashes before.

@philbucher
Copy link
Member Author

That is unfortunate.
Let my try again on mine and also on other machines

@pooyan-dadvand
Copy link
Member

@RiccardoRossi is looking into it also

@RiccardoRossi
Copy link
Member

Hi @philbucher i have been looking into this. This is some memory error, and i would bet that it is OpenMP related.

i tried out with Valgrind, and it is far from clean. Here is the log. Could u take a look at it?

(code compiled with FullDebug + -D_GLIBCXX_DEBUG)
valgrind --leak-check=full --track-origins=yes python3 Main....

| / |
' / | | __| _ \ __| . \ | ( | | ( |\__ \ _|\_\_| \__,_|\__|\___/ ____/ Multi-Physics 5.1.0-a898dcd-FullDebug Importing KratosFluidDynamicsApplication Initializing KratosFluidDynamicsApplication... Importing KratosExternalSolversApplication Initializing KratosExternalSolversApplication... Importing KratosMeshingApplication Initializing Kratos MeshingApplication... Importing KratosFSIApplication Initializing KratosFSIApplication... Importing KratosStructuralMechanicsApplication KRATOS ___| | | | \___ \ __| __| | | __| __| | | __| _ | |
| | | | | ( | | | | ( | |
_____/ _
|| _,_|_
|_|_,|| _,|| MECHANICS
Importing KratosALEApplication
KRATOS ___ __ ____
/ _ | / / / /
/ __ |/ /
/ /
/
/ |
/// application
Initializing KratosALEApplication...
==8758== Address 0xe8f7020 is 96 bytes inside a block of size 640 free'd
==8758== at 0x4C2F24B: operator delete(void*) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==8758== by 0xA555CCF: gnu_cxx::new_allocator<Kratos::IntegrationPoint<3ul, double, double> >::deallocate(Kratos::IntegrationPoint<3ul, double, double>, unsigned long) (new_allocator.h:110)
==8758== by 0xA53C10A: std::allocator_traits<std::allocator<Kratos::IntegrationPoint<3ul, double, double> > >::deallocate(std::allocator<Kratos::IntegrationPoint<3ul, double, double> >&, Kratos::IntegrationPoint<3ul, double, double>
, unsigned long) (alloc_traits.h:517)
==8758== by 0xA51E6A7: std::cxx1998::Vector_base<Kratos::IntegrationPoint<3ul, double, double>, std::allocator<Kratos::IntegrationPoint<3ul, double, double> > >::M_deallocate(Kratos::IntegrationPoint<3ul, double, double>, unsigned long) (stl_vector.h:178)
==8758== by 0xA51DF97: std::__cxx1998::_Vector_base<Kratos::IntegrationPoint<3ul, double, double>, std::allocator<Kratos::IntegrationPoint<3ul, double, double> > >::~_Vector_base() (stl_vector.h:160)
==8758== by 0xA4DCB66: std::__cxx1998::vector<Kratos::IntegrationPoint<3ul, double, double>, std::allocator<Kratos::IntegrationPoint<3ul, double, double> > >::~vector() (stl_vector.h:425)
==8758== by 0xA474005: std::__debug::vector<Kratos::IntegrationPoint<3ul, double, double>, std::allocator<Kratos::IntegrationPoint<3ul, double, double> > >::~vector() (vector:208)
==8758== by 0xA4740E5: boost::array<std::__debug::vector<Kratos::IntegrationPoint<3ul, double, double>, std::allocator<Kratos::IntegrationPoint<3ul, double, double> > >, 10ul>::~array() (in /home/rrossi/kratos_git/libs/Kratos.so)
==8758== by 0xA54351B: Kratos::Triangle3D3Kratos::Point::CalculateShapeFunctionsIntegrationPointsValues(Kratos::GeometryData::IntegrationMethod) (triangle_3d_3.h:1727)
==8758== by 0xA5264A1: Kratos::Triangle3D3Kratos::Point::AllShapeFunctionsValues() (triangle_3d_3.h:1844)
==8758== by 0xC86EBBC: __static_initialization_and_destruction_0(int, int) (triangle_3d_3.h:2407)
==8758== by 0xC86F9E3: _GLOBAL__sub_I_simple_mortar_mapper_process.cpp (simple_mortar_mapper_process.cpp:764)
==8758== Block was alloc'd at
==8758== at 0x4C2E0EF: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==8758== by 0xA571737: __gnu_cxx::new_allocator<Kratos::IntegrationPoint<3ul, double, double> >::allocate(unsigned long, void const
) (new_allocator.h:104)
==8758== by 0xA555CFA: std::allocator_traits<std::allocator<Kratos::IntegrationPoint<3ul, double, double> > >::allocate(std::allocator<Kratos::IntegrationPoint<3ul, double, double> >&, unsigned long) (alloc_traits.h:491)
==8758== by 0xA53C137: std::cxx1998::Vector_base<Kratos::IntegrationPoint<3ul, double, double>, std::allocator<Kratos::IntegrationPoint<3ul, double, double> > >::M_allocate(unsigned long) (stl_vector.h:170)
==8758== by 0xA5AB7E3: void std::cxx1998::vector<Kratos::IntegrationPoint<3ul, double, double>, std::allocator<Kratos::IntegrationPoint<3ul, double, double> > >::M_emplace_back_aux<Kratos::IntegrationPoint<3ul, double, double> >(Kratos::IntegrationPoint<3ul, double, double>&&) (vector.tcc:412)
==8758== by 0xA59DFE4: void std::cxx1998::vector<Kratos::IntegrationPoint<3ul, double, double>, std::allocator<Kratos::IntegrationPoint<3ul, double, double> > >::emplace_back<Kratos::IntegrationPoint<3ul, double, double> >(Kratos::IntegrationPoint<3ul, double, double>&&) (vector.tcc:101)
==8758== by 0xA58C483: void std::debug::vector<Kratos::IntegrationPoint<3ul, double, double>, std::allocator<Kratos::IntegrationPoint<3ul, double, double> > >::emplace_back<Kratos::IntegrationPoint<3ul, double, double> >(Kratos::IntegrationPoint<3ul, double, double>&&) (vector:477)
==8758== by 0xA5752EB: gnu_cxx::enable_if<!std::are_same<Kratos::IntegrationPoint<3ul, double, double>, bool>::value, void>::type std::debug::vector<Kratos::IntegrationPoint<3ul, double, double>, std::allocator<Kratos::IntegrationPoint<3ul, double, double> > >::push_back<Kratos::IntegrationPoint<3ul, double, double> >(Kratos::IntegrationPoint<3ul, double, double>&&) (vector:470)
==8758== by 0xA55C609: Kratos::Quadrature<Kratos::TriangleCollocationIntegrationPoints4, 2ul, Kratos::IntegrationPoint<3ul, double, double> >::GenerateIntegrationPoints(std::debug::vector<Kratos::IntegrationPoint<3ul, double, double>, std::allocator<Kratos::IntegrationPoint<3ul, double, double> > >&, Kratos::Quadrature<Kratos::TriangleCollocationIntegrationPoints4, 2ul, Kratos::IntegrationPoint<3ul, double, double> > const&) (quadrature.h:154)
==8758== by 0xA54319A: Kratos::Quadrature<Kratos::TriangleCollocationIntegrationPoints4, 2ul, Kratos::IntegrationPoint<3ul, double, double> >::GenerateIntegrationPoints() (quadrature.h:128)
==8758== by 0xA526372: Kratos::Triangle3D3Kratos::Point::AllIntegrationPoints() (triangle_3d_3.h:1811)
==8758== by 0xA5432C0: Kratos::Triangle3D3Kratos::Point::CalculateShapeFunctionsIntegrationPointsValues(Kratos::GeometryData::IntegrationMethod) (triangle_3d_3.h:1727)
==8758==
==8758== Invalid read of size 4
==8758== at 0x5D3416: ??? (in /usr/bin/python3.5)
==8758== by 0x4E9AC6: ??? (in /usr/bin/python3.5)
==8758== by 0x582267: PyDict_SetItem (in /usr/bin/python3.5)
==8758== by 0x525602: PyEval_EvalFrameEx (in /usr/bin/python3.5)
==8758== by 0x52E879: PyEval_EvalCodeEx (in /usr/bin/python3.5)
==8758== by 0x5C8E93: ??? (in /usr/bin/python3.5)
==8758== by 0x4E9BC6: PyCFunction_Call (in /usr/bin/python3.5)
==8758== by 0x524413: PyEval_EvalFrameEx (in /usr/bin/python3.5)
==8758== by 0x52D2E2: ??? (in /usr/bin/python3.5)
==8758== by 0x52DFDE: PyEval_EvalCode (in /usr/bin/python3.5)
==8758== by 0x5C7A77: ??? (in /usr/bin/python3.5)
==8758== by 0x4E9C55: PyCFunction_Call (in /usr/bin/python3.5)
==8758== Address 0xe912020 is 224 bytes inside an unallocated block of size 1,504 in arena "client"
==8758==
==8758== Invalid read of size 4
==8758== at 0x5D3416: ??? (in /usr/bin/python3.5)
==8758== by 0x5288A6: PyEval_EvalFrameEx (in /usr/bin/python3.5)
==8758== by 0x52D2E2: ??? (in /usr/bin/python3.5)
==8758== by 0x52DFDE: PyEval_EvalCode (in /usr/bin/python3.5)
==8758== by 0x5C7A77: ??? (in /usr/bin/python3.5)
==8758== by 0x4E9C55: PyCFunction_Call (in /usr/bin/python3.5)
==8758== by 0x52AD73: PyEval_EvalFrameEx (in /usr/bin/python3.5)
==8758== by 0x52D2E2: ??? (in /usr/bin/python3.5)
==8758== by 0x529331: PyEval_EvalFrameEx (in /usr/bin/python3.5)
==8758== by 0x528813: PyEval_EvalFrameEx (in /usr/bin/python3.5)
==8758== by 0x528813: PyEval_EvalFrameEx (in /usr/bin/python3.5)
==8758== by 0x528813: PyEval_EvalFrameEx (in /usr/bin/python3.5)
==8758== Address 0xe8d3020 is 32 bytes before a block of size 3,616 in arena "client"
==8758==
==8758== Conditional jump or move depends on uninitialised value(s)
==8758== at 0x5D341F: ??? (in /usr/bin/python3.5)
==8758== by 0xD0ABD40: boost::python::converter::(anonymous namespace)::slot_rvalue_from_python<std::cxx11::basic_string<char, std::char_traits, std::allocator >, boost::python::converter::(anonymous namespace)::string_rvalue_from_python>::construct(object*, boost::python::converter::rvalue_from_python_stage1_data*) (in /home/rrossi/compiled_libraries/boost/lib/libboost_python.so.1.63.0)
==8758== by 0xA2B28F2: boost::python::converter::arg_rvalue_from_python<std::cxx11::basic_string<char, std::char_traits, std::allocator > >::operator()() (arg_from_python.hpp:314)
==8758== by 0xB25EFAC: object* boost::python::detail::invoke<int, void ()(_object, std::cxx11::basic_string<char, std::char_traits, std::allocator >), boost::python::arg_from_python<object*>, boost::python::arg_from_python<std::cxx11::basic_string<char, std::char_traits, std::allocator > > >(boost::python::detail::invoke_tag<true, false>, int const&, void (&)(_object, std::cxx11::basic_string<char, std::char_traits, std::allocator >), boost::python::arg_from_python<object*>&, boost::python::arg_from_python<std::cxx11::basic_string<char, std::char_traits, std::allocator > >&) (invoke.hpp:81)
==8758== by 0xB25B164: boost::python::detail::caller_arity<2u>::impl<void ()(_object, std::cxx11::basic_string<char, std::char_traits, std::allocator >), boost::python::default_call_policies, boost::mpl::vector3<void, object*, std::cxx11::basic_string<char, std::char_traits, std::allocator > > >::operator()(object*, object*) (caller.hpp:223)
==8758== by 0xB25A53A: boost::python::objects::caller_py_function_impl<boost::python::detail::caller<void ()(_object, std::cxx11::basic_string<char, std::char_traits, std::allocator >), boost::python::default_call_policies, boost::mpl::vector3<void, object*, std::cxx11::basic_string<char, std::char_traits, std::allocator > > > >::operator()(object*, object*) (py_function.hpp:38)
==8758== by 0xD0A39FC: boost::python::objects::function::call(object*, object*) const (in /home/rrossi/compiled_libraries/boost/lib/libboost_python.so.1.63.0)
==8758== by 0xD0A3BF7: boost::detail::function::void_function_ref_invoker0<boost::python::objects::(anonymous namespace)::bind_return, void>::invoke(boost::detail::function::function_buffer&) (in /home/rrossi/compiled_libraries/boost/lib/libboost_python.so.1.63.0)
==8758== by 0xD0AA622: boost::python::handle_exception_impl(boost::function0) (in /home/rrossi/compiled_libraries/boost/lib/libboost_python.so.1.63.0)
==8758== by 0xD0A0F48: function_call (in /home/rrossi/compiled_libraries/boost/lib/libboost_python.so.1.63.0)
==8758== by 0x5B7166: PyObject_Call (in /usr/bin/python3.5)
==8758== by 0x4F413D: ??? (in /usr/bin/python3.5)
==8758== Uninitialised value was created by a heap allocation
==8758== at 0x4C2E0EF: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==8758== by 0xD0A5874: boost::python::objects::add_cast(boost::python::type_info, boost::python::type_info, void* ()(void), bool) (in /home/rrossi/compiled_libraries/boost/lib/libboost_python.so.1.63.0)
==8758== by 0xA600D98: void boost::python::objects::register_conversion<Kratos::Process, Kratos::FastTransferBetweenModelPartsProcess>(bool, Kratos::Process*, Kratos::FastTransferBetweenModelPartsProcess*) (inheritance.hpp:122)
==8758== by 0xA5E72BE: void boost::python::objects::register_base_ofKratos::FastTransferBetweenModelPartsProcess::register_downcastKratos::Process(Kratos::Process*, mpl
::bool
) (class_metadata.hpp:77)
==8758== by 0xA5D0882: void boost::python::objects::register_base_ofKratos::FastTransferBetweenModelPartsProcess::operator()Kratos::Process(Kratos::Process*) const (class_metadata.hpp:68)
==8758== by 0xA5AE648: void boost::mpl::aux::for_each_impl::execute<boost::mpl::v_iter<boost::python::bases<Kratos::Process, mpl::void, mpl::void, mpl::void, mpl::void, mpl::void, mpl::void, mpl::void, mpl::void, mpl::void>, 0l>, boost::mpl::v_iter<boost::python::bases<Kratos::Process, mpl::void, mpl::void, mpl::void, mpl::void, mpl::void, mpl::void, mpl::void, mpl::void, mpl::void>, 1l>, boost::add_pointer<mpl::arg<-1> >, boost::python::objects::register_base_ofKratos::FastTransferBetweenModelPartsProcess >(boost::mpl::v_iter<boost::python::bases<Kratos::Process, mpl::void, mpl::void, mpl::void, mpl::void, mpl::void, mpl::void, mpl::void, mpl::void, mpl::void>, 0l>*, boost::mpl::v_iter<boost::python::bases<Kratos::Process, mpl::void, mpl::void, mpl::void, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_>, 1l>, boost::add_pointer<mpl_::arg<-1> >, boost::python::objects::register_base_ofKratos::FastTransferBetweenModelPartsProcess) (for_each.hpp:78)
==8758== by 0xA5A1662: void boost::mpl::for_each<boost::python::bases<Kratos::Process, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_>, boost::add_pointer<mpl_::arg<-1> >, boost::python::objects::register_base_ofKratos::FastTransferBetweenModelPartsProcess >(boost::python::objects::register_base_ofKratos::FastTransferBetweenModelPartsProcess, boost::python::bases<Kratos::Process, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_>, boost::add_pointer<mpl_::arg<-1> >) (for_each.hpp:104)
==8758== by 0xA5926F3: void boost::python::objects::register_shared_ptr_from_python_and_casts<Kratos::FastTransferBetweenModelPartsProcess, boost::python::bases<Kratos::Process, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_> >(Kratos::FastTransferBetweenModelPartsProcess*, boost::python::bases<Kratos::Process, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_>) (class_metadata.hpp:101)
==8758== by 0xA5811F7: void boost::python::objects::class_metadata<Kratos::FastTransferBetweenModelPartsProcess, boost::python::bases<Kratos::Process, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_>, boost::python::detail::not_specified, boost::python::detail::not_specified>::register_aux2<Kratos::FastTransferBetweenModelPartsProcess, boost::integral_constant<bool, false> >(Kratos::FastTransferBetweenModelPartsProcess*, boost::integral_constant<bool, false>) (class_metadata.hpp:230)
==8758== by 0xA568CEE: boost::python::objects::class_metadata<Kratos::FastTransferBetweenModelPartsProcess, boost::python::bases<Kratos::Process, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_>, boost::python::detail::not_specified, boost::python::detail::not_specified>::register_aux(void*) (class_metadata.hpp:224)
==8758== by 0xA54FEB7: boost::python::objects::class_metadata<Kratos::FastTransferBetweenModelPartsProcess, boost::python::bases<Kratos::Process, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_>, boost::python::detail::not_specified, boost::python::detail::not_specified>::register_() (class_metadata.hpp:210)
==8758== by 0xA531ADE: void boost::python::class_<Kratos::FastTransferBetweenModelPartsProcess, boost::python::bases<Kratos::Process, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_>, boost::python::detail::not_specified, boost::python::detail::not_specified>::initialize<boost::python::init_base<boost::python::init<Kratos::ModelPart&, Kratos::ModelPart&, std::cxx11::basic_string<char, std::char_traits, std::allocator > const, mpl::void, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_> > >(boost::python::init_base<boost::python::init<Kratos::ModelPart&, Kratos::ModelPart&, std::cxx11::basic_string<char, std::char_traits, std::allocator > const, mpl::void, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_> > const&) (class.hpp:454)
==8758==
==8758== Use of uninitialised value of size 8
==8758== at 0x5D3438: ??? (in /usr/bin/python3.5)
==8758== by 0xD0ABD40: boost::python::converter::(anonymous namespace)::slot_rvalue_from_python<std::cxx11::basic_string<char, std::char_traits, std::allocator >, boost::python::converter::(anonymous namespace)::string_rvalue_from_python>::construct(object*, boost::python::converter::rvalue_from_python_stage1_data*) (in /home/rrossi/compiled_libraries/boost/lib/libboost_python.so.1.63.0)
==8758== by 0xA2B28F2: boost::python::converter::arg_rvalue_from_python<std::cxx11::basic_string<char, std::char_traits, std::allocator > >::operator()() (arg_from_python.hpp:314)
==8758== by 0xB25EFAC: object* boost::python::detail::invoke<int, void ()(_object, std::cxx11::basic_string<char, std::char_traits, std::allocator >), boost::python::arg_from_python<object*>, boost::python::arg_from_python<std::cxx11::basic_string<char, std::char_traits, std::allocator > > >(boost::python::detail::invoke_tag<true, false>, int const&, void (&)(_object, std::cxx11::basic_string<char, std::char_traits, std::allocator >), boost::python::arg_from_python<object*>&, boost::python::arg_from_python<std::cxx11::basic_string<char, std::char_traits, std::allocator > >&) (invoke.hpp:81)
==8758== by 0xB25B164: boost::python::detail::caller_arity<2u>::impl<void ()(_object, std::cxx11::basic_string<char, std::char_traits, std::allocator >), boost::python::default_call_policies, boost::mpl::vector3<void, object*, std::cxx11::basic_string<char, std::char_traits, std::allocator > > >::operator()(object*, object*) (caller.hpp:223)
==8758== by 0xB25A53A: boost::python::objects::caller_py_function_impl<boost::python::detail::caller<void ()(_object, std::cxx11::basic_string<char, std::char_traits, std::allocator >), boost::python::default_call_policies, boost::mpl::vector3<void, object*, std::cxx11::basic_string<char, std::char_traits, std::allocator > > > >::operator()(object*, object*) (py_function.hpp:38)
==8758== by 0xD0A39FC: boost::python::objects::function::call(object*, object*) const (in /home/rrossi/compiled_libraries/boost/lib/libboost_python.so.1.63.0)
==8758== by 0xD0A3BF7: boost::detail::function::void_function_ref_invoker0<boost::python::objects::(anonymous namespace)::bind_return, void>::invoke(boost::detail::function::function_buffer&) (in /home/rrossi/compiled_libraries/boost/lib/libboost_python.so.1.63.0)
==8758== by 0xD0AA622: boost::python::handle_exception_impl(boost::function0) (in /home/rrossi/compiled_libraries/boost/lib/libboost_python.so.1.63.0)
==8758== by 0xD0A0F48: function_call (in /home/rrossi/compiled_libraries/boost/lib/libboost_python.so.1.63.0)
==8758== by 0x5B7166: PyObject_Call (in /usr/bin/python3.5)
==8758== by 0x4F413D: ??? (in /usr/bin/python3.5)
==8758== Uninitialised value was created by a heap allocation
==8758== at 0x4C2E0EF: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==8758== by 0xD0A5874: boost::python::objects::add_cast(boost::python::type_info, boost::python::type_info, void* ()(void), bool) (in /home/rrossi/compiled_libraries/boost/lib/libboost_python.so.1.63.0)
==8758== by 0xA600D98: void boost::python::objects::register_conversion<Kratos::Process, Kratos::FastTransferBetweenModelPartsProcess>(bool, Kratos::Process*, Kratos::FastTransferBetweenModelPartsProcess*) (inheritance.hpp:122)
==8758== by 0xA5E72BE: void boost::python::objects::register_base_ofKratos::FastTransferBetweenModelPartsProcess::register_downcastKratos::Process(Kratos::Process*, mpl
::bool
) (class_metadata.hpp:77)
==8758== by 0xA5D0882: void boost::python::objects::register_base_ofKratos::FastTransferBetweenModelPartsProcess::operator()Kratos::Process(Kratos::Process*) const (class_metadata.hpp:68)
==8758== by 0xA5AE648: void boost::mpl::aux::for_each_impl::execute<boost::mpl::v_iter<boost::python::bases<Kratos::Process, mpl::void, mpl::void, mpl::void, mpl::void, mpl::void, mpl::void, mpl::void, mpl::void, mpl::void>, 0l>, boost::mpl::v_iter<boost::python::bases<Kratos::Process, mpl::void, mpl::void, mpl::void, mpl::void, mpl::void, mpl::void_, mpl_::void_, mpl_::void_, mpl_::void_>, 1l>, boost::add_pointer<mpl_::arg<-1> >, boost::python::objects::register_base_ofKratos::FastTransferBetweenModelPartsProcess >(boost::mpl::v_iter<boost::python::bases<Kratos::Process, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_>, 0l>, boost::mpl::v_iter<boost::python::bases<Kratos::Process, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_>, 1l>, boost::add_pointer<mpl_::arg<-1> >, boost::python::objects::register_base_ofKratos::FastTransferBetweenModelPartsProcess) (for_each.hpp:78)
==8758== by 0xA5A1662: void boost::mpl::for_each<boost::python::bases<Kratos::Process, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_>, boost::add_pointer<mpl_::arg<-1> >, boost::python::objects::register_base_ofKratos::FastTransferBetweenModelPartsProcess >(boost::python::objects::register_base_ofKratos::FastTransferBetweenModelPartsProcess, boost::python::bases<Kratos::Process, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_>
, boost::add_pointer<mpl_::arg<-1> >) (for_each.hpp:104)
==8758== by 0xA5926F3: void boost::python::objects::register_shared_ptr_from_python_and_casts<Kratos::FastTransferBetweenModelPartsProcess, boost::python::bases<Kratos::Process, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_> >(Kratos::FastTransferBetweenModelPartsProcess
, boost::python::bases<Kratos::Process, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_>) (class_metadata.hpp:101)
==8758== by 0xA5811F7: void boost::python::objects::class_metadata<Kratos::FastTransferBetweenModelPartsProcess, boost::python::bases<Kratos::Process, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_>, boost::python::detail::not_specified, boost::python::detail::not_specified>::register_aux2<Kratos::FastTransferBetweenModelPartsProcess, boost::integral_constant<bool, false> >(Kratos::FastTransferBetweenModelPartsProcess*, boost::integral_constant<bool, false>) (class_metadata.hpp:230)
==8758== by 0xA568CEE: boost::python::objects::class_metadata<Kratos::FastTransferBetweenModelPartsProcess, boost::python::bases<Kratos::Process, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_>, boost::python::detail::not_specified, boost::python::detail::not_specified>::register_aux(void*) (class_metadata.hpp:224)
==8758== by 0xA54FEB7: boost::python::objects::class_metadata<Kratos::FastTransferBetweenModelPartsProcess, boost::python::bases<Kratos::Process, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_>, boost::python::detail::not_specified, boost::python::detail::not_specified>::register_() (class_metadata.hpp:210)
==8758== by 0xA531ADE: void boost::python::class_<Kratos::FastTransferBetweenModelPartsProcess, boost::python::bases<Kratos::Process, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_>, boost::python::detail::not_specified, boost::python::detail::not_specified>::initialize<boost::python::init_base<boost::python::init<Kratos::ModelPart&, Kratos::ModelPart&, std::cxx11::basic_string<char, std::char_traits, std::allocator > const, mpl::void, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_> > >(boost::python::init_base<boost::python::init<Kratos::ModelPart&, Kratos::ModelPart&, std::cxx11::basic_string<char, std::char_traits, std::allocator > const, mpl::void, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_> > const&) (class.hpp:454)
==8758==
Construction of NavierStokesSolver_VMSMonolithic finished
==8758== Invalid read of size 4
==8758== at 0x5D3416: ??? (in /usr/bin/python3.5)
==8758== by 0xD0ABD40: boost::python::converter::(anonymous namespace)::slot_rvalue_from_python<std::__cxx11::basic_string<char, std::char_traits, std::allocator >, boost::python::converter::(anonymous namespace)::string_rvalue_from_python>::construct(_object*, boost::python::converter::rvalue_from_python_stage1_data*) (in /home/rrossi/compiled_libraries/boost/lib/libboost_python.so.1.63.0)
==8758== by 0xA2B28F2: boost::python::converter::arg_rvalue_from_python<std::__cxx11::basic_string<char, std::char_traits, std::allocator > >::operator()() (arg_from_python.hpp:314)
==8758== by 0xB25EFAC: _object* boost::python::detail::invoke<int, void ()(_object, std::__cxx11::basic_string<char, std::char_traits, std::allocator >), boost::python::arg_from_python<_object*>, boost::python::arg_from_python<std::_cxx11::basic_string<char, std::char_traits, std::allocator > > >(boost::python::detail::invoke_tag<true, false>, int const&, void (&)(_object, std::__cxx11::basic_string<char, std::char_traits, std::allocator >), boost::python::arg_from_python<_object*>&, boost::python::arg_from_python<std::__cxx11::basic_string<char, std::char_traits, std::allocator > >&) (invoke.hpp:81)
==8758== by 0xB25B164: boost::python::detail::caller_arity<2u>::impl<void ()(_object, std::__cxx11::basic_string<char, std::char_traits, std::allocator >), boost::python::default_call_policies, boost::mpl::vector3<void, _object*, std::__cxx11::basic_string<char, std::char_traits, std::allocator > > >::operator()(_object*, _object*) (caller.hpp:223)
==8758== by 0xB25A53A: boost::python::objects::caller_py_function_impl<boost::python::detail::caller<void ()(_object, std::__cxx11::basic_string<char, std::char_traits, std::allocator >), boost::python::default_call_policies, boost::mpl::vector3<void, _object*, std::__cxx11::basic_string<char, std::char_traits, std::allocator > > > >::operator()(_object*, _object*) (py_function.hpp:38)
==8758== by 0xD0A39FC: boost::python::objects::function::call(_object*, _object*) const (in /home/rrossi/compiled_libraries/boost/lib/libboost_python.so.1.63.0)
==8758== by 0xD0A3BF7: boost::detail::function::void_function_ref_invoker0<boost::python::objects::(anonymous namespace)::bind_return, void>::invoke(boost::detail::function::function_buffer&) (in /home/rrossi/compiled_libraries/boost/lib/libboost_python.so.1.63.0)
==8758== by 0xD0AA622: boost::python::handle_exception_impl(boost::function0) (in /home/rrossi/compiled_libraries/boost/lib/libboost_python.so.1.63.0)
==8758== by 0xD0A0F48: function_call (in /home/rrossi/compiled_libraries/boost/lib/libboost_python.so.1.63.0)
==8758== by 0x5B7166: PyObject_Call (in /usr/bin/python3.5)
==8758== by 0x4F413D: ??? (in /usr/bin/python3.5)
==8758== Address 0xecc0020 is 7,888 bytes inside a block of size 8,225 free'd
==8758== at 0x4C2FD5F: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==8758== by 0x5A6C83: _PyBytes_Resize (in /usr/bin/python3.5)
==8758== by 0x5DDA71: ??? (in /usr/bin/python3.5)
==8758== by 0x4E9BF3: PyCFunction_Call (in /usr/bin/python3.5)
==8758== by 0x5B7166: PyObject_Call (in /usr/bin/python3.5)
==8758== by 0x5B84BA: PyObject_CallMethodObjArgs (in /usr/bin/python3.5)
==8758== by 0x5DBA51: ??? (in /usr/bin/python3.5)
==8758== by 0x4DB015: ??? (in /usr/bin/python3.5)
==8758== by 0x4DB4A7: ??? (in /usr/bin/python3.5)
==8758== by 0x59F023: ??? (in /usr/bin/python3.5)
==8758== by 0x4E9BF3: PyCFunction_Call (in /usr/bin/python3.5)
==8758== by 0x5B7166: PyObject_Call (in /usr/bin/python3.5)
==8758== Block was alloc'd at
==8758== at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==8758== by 0x5D3AD6: PyObject_Malloc (in /usr/bin/python3.5)
==8758== by 0x5A641E: PyBytes_FromStringAndSize (in /usr/bin/python3.5)
==8758== by 0x5DD9F1: ??? (in /usr/bin/python3.5)
==8758== by 0x4E9BF3: PyCFunction_Call (in /usr/bin/python3.5)
==8758== by 0x5B7166: PyObject_Call (in /usr/bin/python3.5)
==8758== by 0x5B84BA: PyObject_CallMethodObjArgs (in /usr/bin/python3.5)
==8758== by 0x5DBA51: ??? (in /usr/bin/python3.5)
==8758== by 0x4DB015: ??? (in /usr/bin/python3.5)
==8758== by 0x4DB4A7: ??? (in /usr/bin/python3.5)
==8758== by 0x59F023: ??? (in /usr/bin/python3.5)
==8758== by 0x4E9BF3: PyCFunction_Call (in /usr/bin/python3.5)
==8758==
::[MeshSolverBase]:: Construction finished
::[MeshSolverStructuralSimilarity]:: Construction finished
::[ALENavierStokesSolverVMSMonolithic]:: Construction finished
Base class fluid solver variables added correctly
Monolithic fluid solver variables added correctly
::[MeshSolverBase]:: Variables ADDED.
::[ALENavierStokesSolverVMSMonolithic]:: Variables ADDED.
[Reading Nodes : 2322 nodes read]
[Reading Elements : 4313 elements read] [Type: Element2D3N]
[Reading Conditions : 10 conditions read] [Type: WallCondition2D2N]
[Reading Conditions : 62 conditions read] [Type: WallCondition2D2N]
[Reading Conditions : 60 conditions read] [Type: WallCondition2D2N]
[Reading Conditions : 60 conditions read] [Type: WallCondition2D2N]
[Reading Conditions : 1 conditions read] [Type: WallCondition2D2N]
[Reading Conditions : 111 conditions read] [Type: WallCondition2D2N]
[Total Lines Read : 14317]
adding nodes and elements to fluid_computational_model_part
-fluid_computational_model_part- model part
Number of tables : 0
Number of sub model parts : 0

Mesh 0 : 
    Number of Nodes      : 2322
    Number of Properties : 0
    Number of Elements   : 4313
    Number of Conditions : 304

No inverted elements found
Mesh orientation check found 134 inverted conditions.
Base class model reading finished.
No inverted elements found
No inverted conditions found
Base class fluid solver DOFs added correctly.
::[MeshSolverBase]:: DOFs ADDED.
::[ALENavierStokesSolverVMSMonolithic]:: DOFs ADDED.
Monolithic solver initialization finished.
::[MeshSolverBase]:: Finished initialization.
::[ALENavierStokesSolverVMSMonolithic]:: Finished initialization.
==8758== Invalid read of size 8
==8758== at 0xA1C9446: Kratos::array_1d<double, 3ul>::operator=(Kratos::array_1d<double, 3ul> const&) (array_1d.h:189)
==8758== by 0xA6C7D62: Kratos::Variable<Kratos::array_1d<double, 3ul> >::Assign(void const*, void*) const (variable.h:126)
==8758== by 0xA9CF80D: Kratos::VariablesListDataValueContainer::AssignData(double*, double*) (variables_list_data_value_container.h:954)
==8758== by 0xC9CB3FC: Kratos::VariablesListDataValueContainer::CloneFront() (variables_list_data_value_container.h:748)
==8758== by 0xC9D0891: Kratos::Node<3ul, Kratos::Dof >::CloneSolutionStepData() (node.h:525)
==8758== by 0xC9C99A3: Kratos::ModelPart::CloneSolutionStep() [clone ._omp_fn.0] (model_part.cpp:167)
==8758== by 0xDD0DCBE: GOMP_parallel (in /usr/lib/x86_64-linux-gnu/libgomp.so.1.0.0)
==8758== by 0xC9AD24F: Kratos::ModelPart::CloneSolutionStep() (model_part.cpp:163)
==8758== by 0xC9ADBC1: Kratos::ModelPart::CloneTimeStep(double) (model_part.cpp:211)
==8758== by 0xA29F3CF: object* boost::python::detail::invoke<boost::python::to_python_value<unsigned long const&>, unsigned long (Kratos::ModelPart::*)(double), boost::python::arg_from_pythonKratos::ModelPart&, boost::python::arg_from_python >(boost::python::detail::invoke_tag<false, true>, boost::python::to_python_value<unsigned long const&> const&, unsigned long (Kratos::ModelPart::&)(double), boost::python::arg_from_pythonKratos::ModelPart&&, boost::python::arg_from_python&) (invoke.hpp:88)
==8758== by 0xA289D4B: boost::python::detail::caller_arity<2u>::impl<unsigned long (Kratos::ModelPart::
)(double), boost::python::default_call_policies, boost::mpl::vector3<unsigned long, Kratos::ModelPart&, double> >::operator()(_object*, _object*) (caller.hpp:223)
==8758== by 0xA26F99E: boost::python::objects::caller_py_function_impl<boost::python::detail::caller<unsigned long (Kratos::ModelPart::)(double), boost::python::default_call_policies, boost::mpl::vector3<unsigned long, Kratos::ModelPart&, double> > >::operator()(_object, _object*) (py_function.hpp:38)
==8758== Address 0x1f268fc8 is 0 bytes after a block of size 1,032 alloc'd
==8758== at 0x4C2FD5F: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==8758== by 0xA1AF04C: Kratos::VariablesListDataValueContainer::Reallocate() (variables_list_data_value_container.h:918)
==8758== by 0xA1AE6DA: Kratos::VariablesListDataValueContainer::Resize(unsigned long) (variables_list_data_value_container.h:636)
==8758== by 0xB07F447: Kratos::Node<3ul, Kratos::Dof >::SetBufferSize(unsigned long) (node.h:859)
==8758== by 0xC9C9E8A: Kratos::ModelPart::SetBufferSize(unsigned long) [clone ._omp_fn.4] (model_part.cpp:1233)
==8758== by 0xDD0DCBE: GOMP_parallel (in /usr/lib/x86_64-linux-gnu/libgomp.so.1.0.0)
==8758== by 0xC9C5135: Kratos::ModelPart::SetBufferSize(unsigned long) (model_part.cpp:1229)
==8758== by 0xA29EE38: object* boost::python::detail::invoke<int, void (Kratos::ModelPart::*)(unsigned long), boost::python::arg_from_pythonKratos::ModelPart&, boost::python::arg_from_python >(boost::python::detail::invoke_tag<true, true>, int const&, void (Kratos::ModelPart::&)(unsigned long), boost::python::arg_from_pythonKratos::ModelPart&&, boost::python::arg_from_python&) (invoke.hpp:94)
==8758== by 0xA289428: boost::python::detail::caller_arity<2u>::impl<void (Kratos::ModelPart::
)(unsigned long), boost::python::default_call_policies, boost::mpl::vector3<void, Kratos::ModelPart&, unsigned long> >::operator()(_object*, _object*) (caller.hpp:223)
==8758== by 0xA26F836: boost::python::objects::caller_py_function_impl<boost::python::detail::caller<void (Kratos::ModelPart::)(unsigned long), boost::python::default_call_policies, boost::mpl::vector3<void, Kratos::ModelPart&, unsigned long> > >::operator()(_object, _object*) (py_function.hpp:38)
==8758== by 0xD0A39FC: boost::python::objects::function::call(_object*, _object*) const (in /home/rrossi/compiled_libraries/boost/lib/libboost_python.so.1.63.0)
==8758== by 0xD0A3BF7: boost::detail::function::void_function_ref_invoker0<boost::python::objects::(anonymous namespace)::bind_return, void>::invoke(boost::detail::function::function_buffer&) (in /home/rrossi/compiled_libraries/boost/lib/libboost_python.so.1.63.0)
==8758==
==8758== Invalid read of size 8
==8758== at 0xA1C944C: Kratos::array_1d<double, 3ul>::operator=(Kratos::array_1d<double, 3ul> const&) (array_1d.h:189)
==8758== by 0xA6C7D62: Kratos::Variable<Kratos::array_1d<double, 3ul> >::Assign(void const*, void*) const (variable.h:126)
==8758== by 0xA9CF80D: Kratos::VariablesListDataValueContainer::AssignData(double*, double*) (variables_list_data_value_container.h:954)
==8758== by 0xC9CB3FC: Kratos::VariablesListDataValueContainer::CloneFront() (variables_list_data_value_container.h:748)
==8758== by 0xC9D0891: Kratos::Node<3ul, Kratos::Dof >::CloneSolutionStepData() (node.h:525)
==8758== by 0xC9C99A3: Kratos::ModelPart::CloneSolutionStep() [clone ._omp_fn.0] (model_part.cpp:167)
==8758== by 0xDD0DCBE: GOMP_parallel (in /usr/lib/x86_64-linux-gnu/libgomp.so.1.0.0)
==8758== by 0xC9AD24F: Kratos::ModelPart::CloneSolutionStep() (model_part.cpp:163)
==8758== by 0xC9ADBC1: Kratos::ModelPart::CloneTimeStep(double) (model_part.cpp:211)
==8758== by 0xA29F3CF: object* boost::python::detail::invoke<boost::python::to_python_value<unsigned long const&>, unsigned long (Kratos::ModelPart::*)(double), boost::python::arg_from_pythonKratos::ModelPart&, boost::python::arg_from_python >(boost::python::detail::invoke_tag<false, true>, boost::python::to_python_value<unsigned long const&> const&, unsigned long (Kratos::ModelPart::&)(double), boost::python::arg_from_pythonKratos::ModelPart&&, boost::python::arg_from_python&) (invoke.hpp:88)
==8758== by 0xA289D4B: boost::python::detail::caller_arity<2u>::impl<unsigned long (Kratos::ModelPart::
)(double), boost::python::default_call_policies, boost::mpl::vector3<unsigned long, Kratos::ModelPart&, double> >::operator()(_object*, _object*) (caller.hpp:223)
==8758== by 0xA26F99E: boost::python::objects::caller_py_function_impl<boost::python::detail::caller<unsigned long (Kratos::ModelPart::)(double), boost::python::default_call_policies, boost::mpl::vector3<unsigned long, Kratos::ModelPart&, double> > >::operator()(_object, _object*) (py_function.hpp:38)
==8758== Address 0x1f268fd0 is 8 bytes after a block of size 1,032 alloc'd
==8758== at 0x4C2FD5F: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==8758== by 0xA1AF04C: Kratos::VariablesListDataValueContainer::Reallocate() (variables_list_data_value_container.h:918)
==8758== by 0xA1AE6DA: Kratos::VariablesListDataValueContainer::Resize(unsigned long) (variables_list_data_value_container.h:636)
==8758== by 0xB07F447: Kratos::Node<3ul, Kratos::Dof >::SetBufferSize(unsigned long) (node.h:859)
==8758== by 0xC9C9E8A: Kratos::ModelPart::SetBufferSize(unsigned long) [clone ._omp_fn.4] (model_part.cpp:1233)
==8758== by 0xDD0DCBE: GOMP_parallel (in /usr/lib/x86_64-linux-gnu/libgomp.so.1.0.0)
==8758== by 0xC9C5135: Kratos::ModelPart::SetBufferSize(unsigned long) (model_part.cpp:1229)
==8758== by 0xA29EE38: object* boost::python::detail::invoke<int, void (Kratos::ModelPart::*)(unsigned long), boost::python::arg_from_pythonKratos::ModelPart&, boost::python::arg_from_python >(boost::python::detail::invoke_tag<true, true>, int const&, void (Kratos::ModelPart::&)(unsigned long), boost::python::arg_from_pythonKratos::ModelPart&&, boost::python::arg_from_python&) (invoke.hpp:94)
==8758== by 0xA289428: boost::python::detail::caller_arity<2u>::impl<void (Kratos::ModelPart::
)(unsigned long), boost::python::default_call_policies, boost::mpl::vector3<void, Kratos::ModelPart&, unsigned long> >::operator()(_object*, _object*) (caller.hpp:223)
==8758== by 0xA26F836: boost::python::objects::caller_py_function_impl<boost::python::detail::caller<void (Kratos::ModelPart::)(unsigned long), boost::python::default_call_policies, boost::mpl::vector3<void, Kratos::ModelPart&, unsigned long> > >::operator()(_object, _object*) (py_function.hpp:38)
==8758== by 0xD0A39FC: boost::python::objects::function::call(_object*, _object*) const (in /home/rrossi/compiled_libraries/boost/lib/libboost_python.so.1.63.0)
==8758== by 0xD0A3BF7: boost::detail::function::void_function_ref_invoker0<boost::python::objects::(anonymous namespace)::bind_return, void>::invoke(boost::detail::function::function_buffer&) (in /home/rrossi/compiled_libraries/boost/lib/libboost_python.so.1.63.0)
==8758==
==8758== Invalid read of size 8
==8758== at 0xA1C9454: Kratos::array_1d<double, 3ul>::operator=(Kratos::array_1d<double, 3ul> const&) (array_1d.h:189)
==8758== by 0xA6C7D62: Kratos::Variable<Kratos::array_1d<double, 3ul> >::Assign(void const*, void*) const (variable.h:126)
==8758== by 0xA9CF80D: Kratos::VariablesListDataValueContainer::AssignData(double*, double*) (variables_list_data_value_container.h:954)
==8758== by 0xC9CB3FC: Kratos::VariablesListDataValueContainer::CloneFront() (variables_list_data_value_container.h:748)
==8758== by 0xC9D0891: Kratos::Node<3ul, Kratos::Dof >::CloneSolutionStepData() (node.h:525)
==8758== by 0xC9C99A3: Kratos::ModelPart::CloneSolutionStep() [clone ._omp_fn.0] (model_part.cpp:167)
==8758== by 0xDD0DCBE: GOMP_parallel (in /usr/lib/x86_64-linux-gnu/libgomp.so.1.0.0)
==8758== by 0xC9AD24F: Kratos::ModelPart::CloneSolutionStep() (model_part.cpp:163)
==8758== by 0xC9ADBC1: Kratos::ModelPart::CloneTimeStep(double) (model_part.cpp:211)
==8758== by 0xA29F3CF: object* boost::python::detail::invoke<boost::python::to_python_value<unsigned long const&>, unsigned long (Kratos::ModelPart::*)(double), boost::python::arg_from_pythonKratos::ModelPart&, boost::python::arg_from_python >(boost::python::detail::invoke_tag<false, true>, boost::python::to_python_value<unsigned long const&> const&, unsigned long (Kratos::ModelPart::&)(double), boost::python::arg_from_pythonKratos::ModelPart&&, boost::python::arg_from_python&) (invoke.hpp:88)
==8758== by 0xA289D4B: boost::python::detail::caller_arity<2u>::impl<unsigned long (Kratos::ModelPart::
)(double), boost::python::default_call_policies, boost::mpl::vector3<unsigned long, Kratos::ModelPart&, double> >::operator()(_object*, _object*) (caller.hpp:223)
==8758== by 0xA26F99E: boost::python::objects::caller_py_function_impl<boost::python::detail::caller<unsigned long (Kratos::ModelPart::)(double), boost::python::default_call_policies, boost::mpl::vector3<unsigned long, Kratos::ModelPart&, double> > >::operator()(_object, _object*) (py_function.hpp:38)
==8758== Address 0x1f268fd8 is 16 bytes after a block of size 1,032 alloc'd
==8758== at 0x4C2FD5F: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==8758== by 0xA1AF04C: Kratos::VariablesListDataValueContainer::Reallocate() (variables_list_data_value_container.h:918)
==8758== by 0xA1AE6DA: Kratos::VariablesListDataValueContainer::Resize(unsigned long) (variables_list_data_value_container.h:636)
==8758== by 0xB07F447: Kratos::Node<3ul, Kratos::Dof >::SetBufferSize(unsigned long) (node.h:859)
==8758== by 0xC9C9E8A: Kratos::ModelPart::SetBufferSize(unsigned long) [clone ._omp_fn.4] (model_part.cpp:1233)
==8758== by 0xDD0DCBE: GOMP_parallel (in /usr/lib/x86_64-linux-gnu/libgomp.so.1.0.0)
==8758== by 0xC9C5135: Kratos::ModelPart::SetBufferSize(unsigned long) (model_part.cpp:1229)
==8758== by 0xA29EE38: object* boost::python::detail::invoke<int, void (Kratos::ModelPart::*)(unsigned long), boost::python::arg_from_pythonKratos::ModelPart&, boost::python::arg_from_python >(boost::python::detail::invoke_tag<true, true>, int const&, void (Kratos::ModelPart::&)(unsigned long), boost::python::arg_from_pythonKratos::ModelPart&&, boost::python::arg_from_python&) (invoke.hpp:94)
==8758== by 0xA289428: boost::python::detail::caller_arity<2u>::impl<void (Kratos::ModelPart::
)(unsigned long), boost::python::default_call_policies, boost::mpl::vector3<void, Kratos::ModelPart&, unsigned long> >::operator()(_object*, _object*) (caller.hpp:223)
==8758== by 0xA26F836: boost::python::objects::caller_py_function_impl<boost::python::detail::caller<void (Kratos::ModelPart::)(unsigned long), boost::python::default_call_policies, boost::mpl::vector3<void, Kratos::ModelPart&, unsigned long> > >::operator()(_object, _object*) (py_function.hpp:38)
==8758== by 0xD0A39FC: boost::python::objects::function::call(_object*, _object*) const (in /home/rrossi/compiled_libraries/boost/lib/libboost_python.so.1.63.0)
==8758== by 0xD0A3BF7: boost::detail::function::void_function_ref_invoker0<boost::python::objects::(anonymous namespace)::bind_return, void>::invoke(boost::detail::function::function_buffer&) (in /home/rrossi/compiled_libraries/boost/lib/libboost_python.so.1.63.0)
==8758==
==8758== Thread 6:
==8758== Invalid write of size 8
==8758== at 0xA27C824: Kratos::Variable::Assign(void const*, void*) const (variable.h:126)
==8758== by 0xA9CF80D: Kratos::VariablesListDataValueContainer::AssignData(double*, double*) (variables_list_data_value_container.h:954)
==8758== by 0xC9CB3FC: Kratos::VariablesListDataValueContainer::CloneFront() (variables_list_data_value_container.h:748)
==8758== by 0xC9D0891: Kratos::Node<3ul, Kratos::Dof >::CloneSolutionStepData() (node.h:525)
==8758== by 0xC9C99A3: Kratos::ModelPart::CloneSolutionStep() [clone ._omp_fn.0] (model_part.cpp:167)
==8758== by 0xDD1143D: ??? (in /usr/lib/x86_64-linux-gnu/libgomp.so.1.0.0)
==8758== by 0x507B6B9: start_thread (pthread_create.c:333)
==8758== Address 0x1eff48e0 is 16 bytes after a block of size 1,040 in arena "client"
==8758==

valgrind: m_mallocfree.c:303 (get_bszB_as_is): Assertion 'bszB_lo == bszB_hi' failed.
valgrind: Heap block lo/hi size mismatch: lo = 1104, hi = 0.
This is probably caused by your program erroneously writing past the
end of a heap block and corrupting heap metadata. If you fix any
invalid writes reported by Memcheck, this assertion failure will
probably go away. Please try that before reporting this as a bug.

host stacktrace:
==8758== at 0x38083F48: ??? (in /usr/lib/valgrind/memcheck-amd64-linux)
==8758== by 0x38084064: ??? (in /usr/lib/valgrind/memcheck-amd64-linux)
==8758== by 0x380841F1: ??? (in /usr/lib/valgrind/memcheck-amd64-linux)
==8758== by 0x38091A9C: ??? (in /usr/lib/valgrind/memcheck-amd64-linux)
==8758== by 0x3807D673: ??? (in /usr/lib/valgrind/memcheck-amd64-linux)
==8758== by 0x3807BF03: ??? (in /usr/lib/valgrind/memcheck-amd64-linux)
==8758== by 0x380800DA: ??? (in /usr/lib/valgrind/memcheck-amd64-linux)
==8758== by 0x3807B49A: ??? (in /usr/lib/valgrind/memcheck-amd64-linux)
==8758== by 0x80A136DD9: ???
==8758== by 0x820216F1F: ???

sched status:
running_tid=6

Thread 1: status = VgTs_WaitSys (lwpid 8758)
==8758== at 0xDD13BA5: ??? (in /usr/lib/x86_64-linux-gnu/libgomp.so.1.0.0)
==8758== by 0xDD11A81: ??? (in /usr/lib/x86_64-linux-gnu/libgomp.so.1.0.0)
==8758== by 0xDD0DCB9: GOMP_parallel (in /usr/lib/x86_64-linux-gnu/libgomp.so.1.0.0)
==8758== by 0xC9AD24F: Kratos::ModelPart::CloneSolutionStep() (model_part.cpp:163)
==8758== by 0xC9ADBC1: Kratos::ModelPart::CloneTimeStep(double) (model_part.cpp:211)
==8758== by 0xA29F3CF: object* boost::python::detail::invoke<boost::python::to_python_value<unsigned long const&>, unsigned long (Kratos::ModelPart::*)(double), boost::python::arg_from_pythonKratos::ModelPart&, boost::python::arg_from_python >(boost::python::detail::invoke_tag<false, true>, boost::python::to_python_value<unsigned long const&> const&, unsigned long (Kratos::ModelPart::&)(double), boost::python::arg_from_pythonKratos::ModelPart&&, boost::python::arg_from_python&) (invoke.hpp:88)
==8758== by 0xA289D4B: boost::python::detail::caller_arity<2u>::impl<unsigned long (Kratos::ModelPart::
)(double), boost::python::default_call_policies, boost::mpl::vector3<unsigned long, Kratos::ModelPart&, double> >::operator()(_object*, _object*) (caller.hpp:223)
==8758== by 0xA26F99E: boost::python::objects::caller_py_function_impl<boost::python::detail::caller<unsigned long (Kratos::ModelPart::)(double), boost::python::default_call_policies, boost::mpl::vector3<unsigned long, Kratos::ModelPart&, double> > >::operator()(_object, _object*) (py_function.hpp:38)
==8758== by 0xD0A39FC: boost::python::objects::function::call(_object*, _object*) const (in /home/rrossi/compiled_libraries/boost/lib/libboost_python.so.1.63.0)
==8758== by 0xD0A3BF7: boost::detail::function::void_function_ref_invoker0<boost::python::objects::(anonymous namespace)::bind_return, void>::invoke(boost::detail::function::function_buffer&) (in /home/rrossi/compiled_libraries/boost/lib/libboost_python.so.1.63.0)
==8758== by 0xD0AA622: boost::python::handle_exception_impl(boost::function0) (in /home/rrossi/compiled_libraries/boost/lib/libboost_python.so.1.63.0)
==8758== by 0xD0A0F48: function_call (in /home/rrossi/compiled_libraries/boost/lib/libboost_python.so.1.63.0)
==8758== by 0x5B7166: PyObject_Call (in /usr/bin/python3.5)
==8758== by 0x528D05: PyEval_EvalFrameEx (in /usr/bin/python3.5)
==8758== by 0x52D2E2: ??? (in /usr/bin/python3.5)
==8758== by 0x52DFDE: PyEval_EvalCode (in /usr/bin/python3.5)
==8758== by 0x5FD2C1: ??? (in /usr/bin/python3.5)
==8758== by 0x5FF769: PyRun_FileExFlags (in /usr/bin/python3.5)
==8758== by 0x5FF95B: PyRun_SimpleFileExFlags (in /usr/bin/python3.5)
==8758== by 0x63E7D5: Py_Main (in /usr/bin/python3.5)
==8758== by 0x4CFE40: main (in /usr/bin/python3.5)

Thread 2: status = VgTs_WaitSys (lwpid 8767)
==8758== at 0x5081360: pthread_cond_wait@@GLIBC_2.3.2 (pthread_cond_wait.S:185)
==8758== by 0x12420DFA: ??? (in /usr/lib/libopenblasp-r0.2.18.so)
==8758== by 0x507B6B9: start_thread (pthread_create.c:333)

Thread 3: status = VgTs_WaitSys (lwpid 8768)
==8758== at 0x5081360: pthread_cond_wait@@GLIBC_2.3.2 (pthread_cond_wait.S:185)
==8758== by 0x12420DFA: ??? (in /usr/lib/libopenblasp-r0.2.18.so)
==8758== by 0x507B6B9: start_thread (pthread_create.c:333)

Thread 4: status = VgTs_WaitSys (lwpid 8769)
==8758== at 0x5081360: pthread_cond_wait@@GLIBC_2.3.2 (pthread_cond_wait.S:185)
==8758== by 0x12420DFA: ??? (in /usr/lib/libopenblasp-r0.2.18.so)
==8758== by 0x507B6B9: start_thread (pthread_create.c:333)

Thread 5: status = VgTs_Yielding (lwpid 8770)
==8758== at 0xDD13B29: ??? (in /usr/lib/x86_64-linux-gnu/libgomp.so.1.0.0)
==8758== by 0xDD11417: ??? (in /usr/lib/x86_64-linux-gnu/libgomp.so.1.0.0)
==8758== by 0x507B6B9: start_thread (pthread_create.c:333)

Thread 6: status = VgTs_Runnable (lwpid 8771)
==8758== at 0xA1C9449: Kratos::array_1d<double, 3ul>::operator=(Kratos::array_1d<double, 3ul> const&) (array_1d.h:189)
==8758== by 0xA6C7D62: Kratos::Variable<Kratos::array_1d<double, 3ul> >::Assign(void const*, void*) const (variable.h:126)
==8758== by 0xA9CF80D: Kratos::VariablesListDataValueContainer::AssignData(double*, double*) (variables_list_data_value_container.h:954)
==8758== by 0xC9CB3FC: Kratos::VariablesListDataValueContainer::CloneFront() (variables_list_data_value_container.h:748)
==8758== by 0xC9D0891: Kratos::Node<3ul, Kratos::Dof >::CloneSolutionStepData() (node.h:525)
==8758== by 0xC9C99A3: Kratos::ModelPart::CloneSolutionStep() [clone ._omp_fn.0] (model_part.cpp:167)
==8758== by 0xDD1143D: ??? (in /usr/lib/x86_64-linux-gnu/libgomp.so.1.0.0)
==8758== by 0x507B6B9: start_thread (pthread_create.c:333)

Thread 7: status = VgTs_Yielding (lwpid 8772)
==8758== at 0xDD13B29: ??? (in /usr/lib/x86_64-linux-gnu/libgomp.so.1.0.0)
==8758== by 0xDD11417: ??? (in /usr/lib/x86_64-linux-gnu/libgomp.so.1.0.0)
==8758== by 0x507B6B9: start_thread (pthread_create.c:333)

Note: see also the FAQ in the source distribution.
It contains workarounds to several common problems.
In particular, if Valgrind aborted or crashed after
identifying problems in your program, there's a good chance
that fixing those problems will prevent Valgrind aborting or
crashing, especially if it happened in m_mallocfree.c.

If that doesn't help, please report this bug to: www.valgrind.org

In the bug report, send all the above text, the valgrind
version, and what OS and version you are using. Thanks.

Compilation exited abnormally with code 1 at Thu Oct 26 13:30:50

@philbucher
Copy link
Member Author

I usually run with one thread

now I tried with 1 and with 6 threads, valgrindoutput is attached

We also tried with Klaus' computer, same Problem

valgrind_1_thread.txt
valgrind_6_threads.txt

@pooyan-dadvand
Copy link
Member

@philbucher so before more debugging I would suggest you to clean the memory problem....

@philbucher
Copy link
Member Author

How do you mean?
Isn't the memory the problem?

@pooyan-dadvand
Copy link
Member

Yes of course! Actually yesterday I thought the first error is directly in your application but now in your txt I saw that it is in initialize and clone time step.

Would you please try to reduce the script removing any application and steps that won't alter the first errors in the valgrind? we need a smaller test to deal with. (of course if is possible)

@philbucher
Copy link
Member Author

I reduced the test as much as I could
If a variable is added after the ModelPart is imported into the solver it crashes

Segfault_2.zip

@pooyan-dadvand
Copy link
Member

@RiccardoRossi are you on this?

@RiccardoRossi
Copy link
Member

well, the error is now clear. You can not import variables after having called the ImportModelPart function.

bad thing is that we currently have no mechanism to protect from this. I will post a proposal of what to do later on during the day (can not do it right now)

@jcotela
Copy link
Member

jcotela commented Oct 27, 2017

While what @RiccardoRossi is saying is 100% true, in @philbucher's script someone is reading the PENALTY variable from the nodes and it does not look like he's doing anything that could be considered non-standard... I'd say that either we add the variable to the nodes on the solver or we remove/replace whatever utility requires it.

Note that this is one of my motivations for #869.

EDIT: The cause of the SegFault is the addition of the PENALTY variable out of place in the script (it does not SegFault if I just comment out the addition). Please don't add variables after reading the ModelPart.

@philbucher
Copy link
Member Author

I also know that I should not add the Variables after ImportModelPart.
However if you are debugging you can easily forget abt this and suddenly everything breaks and you have no clue why. Happened several times already to me.
So I agree, there should be a Mechanism to prevent this, and throw a proper error

@jcotela the penatly variable was chosen randomly, just for demonstration purpose

@RiccardoRossi
Copy link
Member

My proposal in order to catch those errors would be to define in the root model part
a flag variable like

  mVariableListIsFrozen

initialized by default to false.

We could then add a function say

FreezeVariableImporting

which sets the variable to true. Such functions could be called at the beginning of the ImportModelPart function.

if then in the AddVariables we check if the variable is frozen, we would easily catch this sort of errors (or have the same behaviour as now if we never call the freezing function

@jcotela
Copy link
Member

jcotela commented Oct 27, 2017

Checking with @pooyan-dadvand, in this particular instance the error may be related to a bug in AddNodalSolutionStepData (it should work as it is done in SetBufferSize, but some code appears to be missing).

@pooyan-dadvand
Copy link
Member

An alternative solution to @RiccardoRossi proposal would be to check in AddNodalSolutionStepData method if modelpart has any node and give an error. So nobody can add new variables after adding nodes to a modelpart.

@philbucher
Copy link
Member Author

+1 for pooyan
Then it is independent of using the python solver wrappers or not

@RiccardoRossi
Copy link
Member

+1 for Pooyan's solution too

@RiccardoRossi
Copy link
Member

just to tell that i made PR #928 to implement the idea

@pooyan-dadvand
Copy link
Member

I close it as PR #928 merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants