Navigation Menu

Skip to content
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

Assertion failed: TOTAL_MEMORY not big enough for stack #5662

Closed
Xaratas opened this issue Oct 12, 2017 · 2 comments
Closed

Assertion failed: TOTAL_MEMORY not big enough for stack #5662

Xaratas opened this issue Oct 12, 2017 · 2 comments
Labels

Comments

@Xaratas
Copy link

Xaratas commented Oct 12, 2017

Source i want to compile: Head of https://github.com/swipetospin/libbpg

Problem: The attached example crash right at the start with an Out of Memory error. Which is logged three times: as info, as warning and as error. I tested in Chrome and FF with the same results. The Chrome memory snapshot shows 32mb of allocated memory, matching the limit defined in the makefile. Different limits did not change the result.

For the attached example i added this to the makefile, and removed the -O3:
EMLDFLAGS+=-s ASSERTIONS=2 -s SAFE_HEAP=1 -s SAFE_HEAP_LOG=1 -O0

With ALLOW_MEMORY_GROW=1 it get in an infinite(?) loop allocating new memory. The tab becomes unresponsive.

Stacktrace:

uncaught exception: abort("Assertion failed: TOTAL_MEMORY not big enough for stack") at jsStackTrace@http://localhost:8000/bpgdec8_assert.js:937:13
stackTrace@http://localhost:8000/bpgdec8_assert.js:951:12
abort@http://localhost:8000/bpgdec8_assert.js:31932:44
assert@http://localhost:8000/bpgdec8_assert.js:417:4
@http://localhost:8000/bpgdec8_assert.js:1318:2
@http://localhost:8000/bpgdec8_assert.js:1:3

FF version: 56.0 (64bit)
Chromium version: Version 61.0.3163.100 (Official Build) Built on Ubuntu , running on Ubuntu 17.04 (64-bit)

Emscripten version:

emcc -v
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 1.37.21
clang version 4.0.0 (emscripten 1.37.21 : 1.37.21)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/xar/emsdk-portable/clang/e1.37.21_64bit
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/6.3.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.4.1
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6.3.0
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6.3.0
Candidate multilib: .;@m64
Selected multilib: .;@m64

Zip contains demo html page, demo image and with debug mode compiled js
bpg_example.zip

@kripken
Copy link
Member

kripken commented Oct 16, 2017

With ALLOW_MEMORY_GROW=1 it get in an infinite(?) loop allocating new memory.

This is what I would focus on debugging. Some debug printfs can help in my experience, it might be entering a code path it shouldn't etc.

@stale
Copy link

stale bot commented Sep 19, 2019

This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 7 days. Feel free to re-open at any time if this issue is still relevant.

@stale stale bot added the wontfix label Sep 19, 2019
@stale stale bot closed this as completed Sep 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants