Skip to content

addMemory in rt cannot handle more 65536 wasm page memory. #2653

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

Closed
HerrCai0907 opened this issue Feb 16, 2023 · 0 comments · Fixed by #2654
Closed

addMemory in rt cannot handle more 65536 wasm page memory. #2653

HerrCai0907 opened this issue Feb 16, 2023 · 0 comments · Fixed by #2654
Assignees
Labels

Comments

@HerrCai0907
Copy link
Member

Bug description

Meet runtime addMemory error.

RuntimeError: unreachable
at ~lib/rt/tlsf/addMemory (wasm://wasm/b69e6f5a:wasm-function[11]:0x47b)
at ~lib/rt/tlsf/growMemory (wasm://wasm/b69e6f5a:wasm-function[16]:0x853)
at ~lib/rt/tlsf/allocateBlock (wasm://wasm/b69e6f5a:wasm-function[18]:0x918)
at ~lib/rt/tlsf/__alloc (wasm://wasm/b69e6f5a:wasm-function[19]:0x965)
at ~lib/memory/heap.alloc (wasm://wasm/b69e6f5a:wasm-function[20]:0x970)
at start:assembly/index (wasm://wasm/b69e6f5a:wasm-function[23]:0x9fe)
at ~start (wasm://wasm/b69e6f5a:wasm-function[21]:0x976)
at file:///Users/q540239/as/tests/index.js:4:31

Steps to reproduce

// align memory page to 2**n
while (memory.size() != 128) {
  heap.alloc(16);
}
// alloc memory to more than 65536/2 wasm page
for (let i = 0; i < 32763; i++) {
  heap.alloc(64 * 1024);
}

AssemblyScript version

0.27.0

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

Successfully merging a pull request may close this issue.

1 participant