Describe the bug
At the end of the simulation, the stack of the coroutines (SC_THREAD) is not properly cleaned up. When a local variable is created in an SC_THREAD, the destructor might not be called.
To Reproduce
The behavior can, e.g., be seen in the systemc-1666-2011-compliance-method_with_reset test, which fails when a sanitizer is used (leak sanitizer). The problem is that the destructor or_list, which is a local variable of the multiple_reset_handler SC_THREAD, is never called:
|
sc_event_or_list or_list; |
When the variable is moved to the class, the test succeeds.
Expected behavior
The coroutine stacks are cleaned up, and the destructors of local variables are called.
Environment
OS: e.g., Ubuntu 24.04
Compiler: Clang 14 with -fsanitize=address
SystemC version: e.g., 3.0.2
Describe the bug
At the end of the simulation, the stack of the coroutines (
SC_THREAD) is not properly cleaned up. When a local variable is created in anSC_THREAD, the destructor might not be called.To Reproduce
The behavior can, e.g., be seen in the
systemc-1666-2011-compliance-method_with_resettest, which fails when a sanitizer is used (leak sanitizer). The problem is that the destructoror_list, which is a local variable of themultiple_reset_handlerSC_THREAD, is never called:systemc/tests/systemc/1666-2011-compliance/method_with_reset/method_with_reset.cpp
Line 362 in 16b57dc
When the variable is moved to the class, the test succeeds.
Expected behavior
The coroutine stacks are cleaned up, and the destructors of local variables are called.
Environment
OS: e.g., Ubuntu 24.04
Compiler: Clang 14 with
-fsanitize=addressSystemC version: e.g., 3.0.2