WaitAny segfaults when activities are cancelled
If we cancel an asynchronous activity that is waited upon by a WaitAny call, the application segfaults, regardless of the actual type (Comm, exec, IO).
I believe it is related to #110 (closed) , in the sense that waitAny is special because it seems not to generate a constraint in the model ??
I enclose a MWE based on the s4u-activity-waitany example:
Unfortunately, the stack trace is not very informative IMHO:
#0 0x0000000000000000 in ?? ()
#1 0x00007ffff73bdedd in simgrid::s4u::Activity::<lambda()>::operator()(void) const (
__closure=0x7ffff3e32ec8) at ./src/s4u/s4u_Activity.cpp:139
#2 0x00007ffff73bed8e in simgrid::xbt::fulfill_promise<simgrid::xbt::Result<void>, simgrid::s4u::Activity::cancel()::<lambda()> >(simgrid::xbt::Result<void> &, simgrid::s4u::Activity::<lambda()> &&) (
promise=..., code=...) at ./include/xbt/promise.hpp:104
#3 0x00007ffff73be63b in simgrid::kernel::actor::<lambda()>::operator()(void) const (
this=0x7ffff3e32e60) at ./include/simgrid/simix.hpp:57
#4 0x00007ffff73bf404 in std::_Function_handler<void(), simgrid::kernel::actor::simcall_answered(F&&, simgrid::kernel::actor::SimcallObserver*) [with F = simgrid::s4u::Activity::cancel()::<lambda()>; std::result_of_t<F()> = void]::<lambda()> >::_M_invoke(const std::_Any_data &) (__functor=...)
at /usr/include/c++/8/bits/std_function.h:297
#5 0x00007ffff741fd9a in std::function<void ()>::operator()() const (this=0x7ffff3e32e60)
at /usr/include/c++/8/bits/std_function.h:687
#6 0x00007ffff74c985b in simgrid::kernel::actor::ActorImpl::simcall_handle (this=0x64fc60,
times_considered=0) at ./src/kernel/actor/Simcall.cpp:32
#7 0x00007ffff74dc8bf in simgrid::kernel::EngineImpl::run (this=0x63bb80, max_date=-1)
at ./src/kernel/EngineImpl.cpp:679
#8 0x00007ffff7419d71 in simgrid::s4u::Engine::run_until (this=0x7fffffffcef8, max_date=-1)
at ./src/s4u/s4u_Engine.cpp:349
#9 0x00007ffff7419cfa in simgrid::s4u::Engine::run (this=0x7fffffffcef8)
at ./src/s4u/s4u_Engine.cpp:337
#10 0x000000000040a877 in main (argc=2, argv=0x7fffffffd148)
at ./examples/cpp/activity-waitany/s4u-activity-waitany.cpp:104
Edited by Fabien Chaix