Skip to content
This repository has been archived by the owner on May 11, 2020. It is now read-only.

How to solve disasm: stack underflow when call exec.NewVM(module) #140

Closed
lowesyang opened this issue Jul 19, 2019 · 2 comments
Closed

How to solve disasm: stack underflow when call exec.NewVM(module) #140

lowesyang opened this issue Jul 19, 2019 · 2 comments

Comments

@lowesyang
Copy link

lowesyang commented Jul 19, 2019

i try to exec the wast file and get disasm: stack underflow.

After i open debugMode and add extra logger print, and find out the error occurs in ops.End or ops.Else case:

image

curDepth is -1. prevDepth is 2. elemsDiscard is -3

image

Seems like set_local op push -1 to the top of stack. And then next op is op.end, makes the curDepth = -1, and elemsDiscard becomes -3, which throw ErrStackUnderflow.

What are the possible problems for this error? How can i solve it?

@lowesyang lowesyang changed the title How to solve failed to init wagon interpreter: disasm: stack underflow How to solve disasm: stack underflow when call exec.NewVM(module) Jul 19, 2019
@lowesyang
Copy link
Author

lowesyang commented Jul 22, 2019

Opened an issue in assemblyscript and seems like this is the unexpected result of wagon.

(The error above is from the same wast code)

@sbinet
Copy link
Contributor

sbinet commented Jul 29, 2019

apologies for the belated answer (holidays).
@vibhavp would be the one with the most expertise on this.

(feel free to reopen if that's still an issue for you)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants