Weird segfault when not sealing an host
Hello,
when an host is created programmatically and not sealed, one get a weird segfault somewhere in the LMM.
To reproduce, the best is to comment the line lilibeth->seal();
in s4u-platform-failure.cpp, and rerun that example. Valgrind then give the following backtrace as soon as this host gets used:
[...]
[ 0.000000] (7:sleeper@Lilibeth) Start sleeping...
==979178== Invalid read of size 4
==979178== at 0x4F97536: simgrid::kernel::lmm::Constraint::get_concurrency_slack() const (maxmin.hpp:236)
==979178== by 0x4F918AB: simgrid::kernel::lmm::System::expand(simgrid::kernel::lmm::Constraint*, simgrid::kernel::lmm::Variable*, double) (maxmin.cpp:227)
==979178== by 0x502CAD6: simgrid::kernel::resource::CpuCas01Action::CpuCas01Action(simgrid::kernel::resource::Model*, double, bool, double, simgrid::kernel::lmm::Constraint*, int) (cpu_cas01.cpp:202)
==979178== by 0x502C6D8: simgrid::kernel::resource::CpuCas01::sleep(double) (cpu_cas01.cpp:165)
==979178== by 0x4F7A2F2: simgrid::kernel::activity::SleepImpl::start() (SleepImpl.cpp:33)
==979178== by 0x4F7E3F8: simgrid::kernel::actor::ActorImpl::sleep(double) (ActorImpl.cpp:407)
==979178== by 0x4E98492: simgrid::s4u::this_actor::sleep_for(double)::{lambda()#1}::operator()() const (s4u_Actor.cpp:324)
==979178== by 0x4E9D826: decltype (({parm#1}.set_value)()) simgrid::xbt::fulfill_promise<simgrid::xbt::Result<void>, simgrid::s4u::this_actor::sleep_for(double)::{lambda()#1}>(simgrid::xbt::Result<void>&, simgrid::s4u::this_actor::sleep_for(double)::{lambda()#1}&&) (promise.hpp:105)
==979178== by 0x4E9BE8E: simgrid::kernel::actor::simcall_blocking<simgrid::s4u::this_actor::sleep_for(double)::{lambda()#1}>(simgrid::s4u::this_actor::sleep_for(double)::{lambda()#1}&&, simgrid::kernel::actor::SimcallObserver*)::{lambda()#1}::operator()() const (simix.hpp:85)
==979178== by 0x4EA1EA3: void std::__invoke_impl<void, simgrid::kernel::actor::simcall_blocking<simgrid::s4u::this_actor::sleep_for(double)::{lambda()#1}>(simgrid::s4u::this_actor::sleep_for(double)::{lambda()#1}&&, simgrid::kernel::actor::SimcallObserver*)::{lambda()#1}&>(std::__invoke_other, simgrid::kernel::actor::simcall_blocking<simgrid::s4u::this_actor::sleep_for(double)::{lambda()#1}>(simgrid::s4u::this_actor::sleep_for(double)::{lambda()#1}&&, simgrid::kernel::actor::SimcallObserver*)::{lambda()#1}&) (invoke.h:61)
==979178== by 0x4EA0720: std::enable_if<std::__and_<std::is_void<void>, std::__is_invocable<simgrid::kernel::actor::simcall_blocking<simgrid::s4u::this_actor::sleep_for(double)::{lambda()#1}>(simgrid::s4u::this_actor::sleep_for(double)::{lambda()#1}&&, simgrid::kernel::actor::SimcallObserver*)::{lambda()#1}&> >::value, void>::type std::__invoke_r<void, simgrid::kernel::actor::simcall_blocking<simgrid::s4u::this_actor::sleep_for(double)::{lambda()#1}>(simgrid::s4u::this_actor::sleep_for(double)::{lambda()#1}&&, simgrid::kernel::actor::SimcallObserver*)::{lambda()#1}&>(simgrid::kernel::actor::simcall_blocking<simgrid::s4u::this_actor::sleep_for(double)::{lambda()#1}>(simgrid::s4u::this_actor::sleep_for(double)::{lambda()#1}&&, simgrid::kernel::actor::SimcallObserver*)::{lambda()#1}&) (invoke.h:154)
==979178== by 0x4E9ECB6: std::_Function_handler<void (), simgrid::kernel::actor::simcall_blocking<simgrid::s4u::this_actor::sleep_for(double)::{lambda()#1}>(simgrid::s4u::this_actor::sleep_for(double)::{lambda()#1}&&, simgrid::kernel::actor::SimcallObserver*)::{lambda()#1}>::_M_invoke(std::_Any_data const&) (std_function.h:291)
==979178== by 0x4F44B79: std::function<void ()>::operator()() const (std_function.h:568)
==979178== by 0x4F629A2: SIMIX_run_blocking(std::function<void ()> const*) (popping.cpp:27)
==979178== by 0x4F89442: simgrid::kernel::actor::ActorImpl::simcall_handle(int) (popping_generated.cpp:101)
==979178== by 0x50224CC: simgrid::kernel::EngineImpl::run(double) (EngineImpl.cpp:786)
==979178== by 0x4EDCB06: simgrid::s4u::Engine::run_until(double) const (s4u_Engine.cpp:337)
==979178== by 0x4EDCA15: simgrid::s4u::Engine::run() const (s4u_Engine.cpp:320)
==979178== by 0x113F87: main (s4u-platform-failures.cpp:138)
==979178== Address 0xf0 is not stack'd, malloc'd or (recently) free'd
==979178==
Segmentation fault.
Thanks,