Comments (4)
Not maintainer. Just to answer your question. Wasm is a stack machine with an implicit stack. So an instruction like i32.const 10
pushes a 32-bit integer with a value of 10 onto the stack. An instruction like i32.add
pops 2 values off the stack, adds them, and pushes the result back onto the stack. This error can occur if the generated wasm did not "typecheck" (validate) successfully and there are values remaining on the stack. So a good block without any values remaining may look like:
i32.const 1 ; 1 value on the stack
i32.const 2 ; 2 values on the stack
i32.add ; 1 value on the stack
drop ; no values on the stack. All good!
from wasmer.
Oh thank you for this information, yeah, I think I have a sense of what's wrong here. I think if I go over the components carefully, I can figure the error out. But I'm also wondering if there are some easier way to ping-poing the issue. When I use wasm2wat on the newhello.wasm, I got more detailed error description of the mismach
root@2299d4e20d1f:/lind-glibc/replace-sysroot/test# wasm2wat newhello.wasm -o newhello.wat
newhello.wasm:00001c6: error: type mismatch at end of function, expected [] but got [i32, i32]
Then is there a way to know what is this function that causes this?
Since I'm building my own libc, and manually locating the error is probably too hard due to the complexity of the codebase.
from wasmer.
Okay I see a good way, while wasm2wat
checks the stack issue and give the offset of where the error occurs, we can use wasm-objdump -d
to look at the offset position in the file, and know which function is causing the type mismatch
from wasmer.
@yagehu thanks for jumping in...
from wasmer.
Related Issues (20)
- Open with O_RDONLY, but fd_write succeed.
- Open with O_APPEND, but do not print the correct offset value.
- Fail to set the file time.
- Hard link creation successful print but the file do not exist.
- backend-api: Add query to retrieve app versions by app id
- Deprecate WebC v2
- Add region lock configuration to `app.yaml`
- CLI: Allow pushing packages with a name but no version HOT 1
- Proposal: Use git commit hashes as another way to specify packages HOT 1
- `make test` does not behave deterministically
- C API: Failed to resolve import "wasi" "thread-spawn"
- If you login, then attempt to login again it panics
- WASIX: Incorrect webc version mapping
- wasix: Replace hand-written GraphQL client with wasmer-api crate
- wasmer-api : Enable compression support for both queries and responses HOT 1
- CLI: app create - Deploy step broken
- Wasmer panics with HeapAccessOutOfBounds when using cranelift and multi-value HOT 1
- WASIX: `__asyncify_light` ignores the timeout argument HOT 1
- CLI Secrets management: Re-consider upsert logic HOT 3
- Ask user to redeploy after adding/changing a secret (CLI)
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 wasmer.