-
Notifications
You must be signed in to change notification settings - Fork 644
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
What breaks ABI? #3961
Comments
|
Hi, thanks for the quick reply.
We did consider
We didn't really consider
There were no clear signs of any degradation. (upd: I think I got some on low end device, I'll share later) I ran compressing 1GB with each version for 10 iterations with hyperfine. I tried 4 times in total: 2 times version without my changes was better, 2 times version with my changes was better. Here are 2 examples of output
Also I compared it with our app on a slow device(ARM Cortex A9 dual core 1 GHz from 2014) and there were also no clear winner, sometimes version with my changes was faster sometimes without, I was profiling iteration of the loop that covers everything. I checked that the AOT binaries that I ran were indeed different and it's Intermidiate representation code was different in exactly atomic store/load operations.
From https://en.cppreference.com/w/cpp/utility/program/signal I found it the only non UB way to access the data. In practice reading regular pointer in signal handler never caused me any problems in my testing |
I tried out the existing
|
Hi, I have a POC of a feature that let's pause WASM VM with a signal interruption, write function indexes of stackframes to a file and resume.
To make it async-signal-safe(signal is delivered asynchronously with pthread_kill from another native thread) I need to have an atomic copy of this variable
exec_env->wasm_stack->top
https://github.com/bytecodealliance/wasm-micro-runtime/blob/main/core/iwasm/common/wasm_exec_env.h#L85 Aomic basically would mean that updating valued of the variable couldn't be interrupted by signal and the pointer holds a valid value.I consider 3 options on how to store it but @loganek and I were discussing that it might break ABI:
exec_env->wasm_stack->top
atomic, I made a proof of concept of that . The idea is to check that sizeof uint8 and sizeof _Atomic(uint8) are the same and then set a compilation flag(needs to be added) to true otherwise don't enable the feature.I would appreciate an advice on that @wenyongh @yamt
Context: we need this feature to report stacktraces when WASM/AOT stuck somewhere (e.g. deadlock, infinite loop, a long operation). Sometimes the app unfreezes so we would like avoid crashing or terminating VM to get those stacktraces
The text was updated successfully, but these errors were encountered: