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
Double Free of std::coroutine_handle #1
Comments
Some further inspection: having tested also on Linux (with gdb, and compiling with g++-10) it seems that is the destruction of the vector of handles, i.e. std::vector<std::__n4861::coroutine_handle<void>,
std::allocator<std::__n4861::coroutine_handle<void> > >::~vector that raises the double free, which means that the handles were already destroyed earlier in the code flow. In this case the system is a Linux Ubuntu 20.04 with g++ v. 10.3.0. |
Eureka! I'll send a PullRequest... there was the call of the superclass desctructor of value_event that apparently is un-necessary (since the superclass/subclass destructors will always be called) and which raised the issue. |
Thanks for your investigation! Looking forward to the pull request. |
Sorry for not getting back to you sooner. Please see my comments on your PR #3 . A fix for this issue is in the main branch now, please test again and close this issue if the fix works for you. Thanks for your work! |
Apparently, when using the
value_event
class the system incurs in a double free error when exiting the program (i.e., all processes have been stopped).Unfortunately I cannot go too much in depth for debugging, but it seems that the error is related to the following destructor (and possibly to this phenomenon) in
event.hpp
:A possible workaround might be to use a
std::suspend_always
instead of astd::suspend_never
for thefinal_suspend
method, however I am not able to understand the implications for the simulation.My system is a MacOS 12.3.1 running on Arm M1 Pro. The code has been compiled with
g++-11 (Homebrew GCC 11.2.0_3) 11.2.0
.The text was updated successfully, but these errors were encountered: