Comments (6)
In general, there is no way to get location of the trap yet (although this should be very useful, and I think this is somwthing we want sooner rather than later)
However, it is possible to print information provided in panic payload, at least if you have a custom panic fmt. But im not sure how panics are reported in wasm32-unknown-unknown with std.
from wasmi.
However, it is possible to print information provided in panic payload, at least if you have a custom panic fmt. But im not sure how panics are reported in wasm32-unknown-unknown with std.
It looks like payload is ignored by rust compiler: https://github.com/rust-lang/rust/blob/master/src/libpanic_unwind/wasm32.rs#L28
Also, what do you mean by "print"? I don't think there is some builtin way to print something in wasm.
from wasmi.
AFAIK, actual printing happens in the panic hook, ie here which happens before libpanic_*
takes control (just take a look at other impls or at libpanic_abort).
Also, what do you mean by "print"? I don't think there is some builtin way to print something in wasm.
Yeah, you're right! However, in some envs such as web JS or wasmi we can define what it means to print something.
And, In fact, wasm std lib supports basic i/o however under special flag DEBUG
Hope this helps!
from wasmi.
Wow, that worked like a charm! Thanks. Here is the code that catches panics and logs payload and location for anyone trying to figure it out.
However, I think this issue (i.e. tracking traps and not only panics out of the box) depends on debugging symbols and should not be closed yet. Right?
from wasmi.
Im very happy thats worked!
And yea, you right, we still need to have means to debug different kinds of traps and print stacktraces. And yeah it depends on debugging symbols (although plain name section should do the trick for the start)
from wasmi.
Closed in favor of #538.
from wasmi.
Related Issues (20)
- Create C bindings for Wasmi
- Simplification: Rewrite `iNN.sub` with immediate to new `iNN.add` variant
- Restore CI benchmarks HOT 1
- Wasmi versions `0.32.0-beta.6` cannot run `ffmpeg.wasm` correctly HOT 20
- Update `wasmi_wasi` WASI implementing dependencies HOT 1
- Optimization: Fuse transitive copies HOT 1
- Add `--verbose` mode to Wasmi CLI HOT 2
- Add support for fully hibernate-able Wasm instances HOT 7
- Handle host function calls the same as other instructions in the Wasmi executor HOT 1
- Make it possible to debug and pretty print Wasmi bytecode
- Add Wasmi execution profiling HOT 1
- The URL in the project description is 404 HOT 1
- Optimize `Linker` setup
- Add customizable `wasmi::Engine` limits
- Reconsider proper fuel charging for lazily compiled functions
- Reduce `wasmi::Engine` memory consumption for storing function artifacts HOT 3
- Try to put the Wasmi engine internals into its own crate
- Wasmi v0.32 stable release preparations
- Wasmi `v0.32.0-beta.13` seems to have broken linking HOT 13
- CLI: cannot find definition for imported function HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wasmi.