Fix bug in wasm2c runtime's alternate stack deallocation#2466
Conversation
This makes `wasm_rt_init()` properly reentrant.
|
Seems reasonable to me. I guess technically the resetting could also be in |
|
Yeah I dont think this should be in |
I think "assigning the pointer to null is the proper cleanup behavior" is debatable, but I also don't think its super important in this case. Taken to the limit I think that would mean that all C++ destructors should zero all their fields. For performance reasons we don't tend to do this kind of thing in release builds. |
|
Agreed, that this would be needed in this case due to re-entrancy (this is independent of discussions around hardening destructors), i.e., calling |
|
Thanks for the reviews yall! |
This makes
wasm_rt_init()properly reentrant. By settingg_alt_stack = NULL, we allow execution to continue beyond wasm-rt-impl.c L171 inos_allocate_and_install_altstack.Applies to debug builds only due to
assert.