-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
give a clear error when TOTAL_MEMORY is not big enough #8369
Conversation
…atic allocation + stack etc. not catching this early leads to late validation errors in asm2wasm. fixes WebAssembly/binaryen#1968
emscripten.py
Outdated
@@ -754,6 +754,9 @@ def __init__(self): | |||
# * then dynamic memory begins | |||
self.dynamic_base = align_memory(self.stack_high) | |||
|
|||
if self.dynamic_base >= shared.Settings.TOTAL_MEMORY: | |||
exit_with_error('Memory is not large enough for static initialization (%d) plus the stack (%d), please increase TOTAL_MEMORY (%d) to at least %d' % (self.static_bump, shared.Settings.TOTAL_STACK, shared.Settings.TOTAL_MEMORY, self.dynamic_base)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
static initialization -> static data?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixing.
tests/test_other.py
Outdated
double muchData[] = { | ||
''') | ||
for i in range(50 * 1000): | ||
f.write('1.2, 2.3, 3.4, 4.5, 5.6, 6.7, 7.8, 8.9, 9.9,\n') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why bother with this huge test? Why not just create little static data and set TOTAL_MEMORY to a small value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Tests that we should a" -> "Tests that we give a"
ret += muchData[i]; | ||
} | ||
return ret & 255; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also why doesn't this program just return &muchData
. There should be no need to actually do anything there since the program won't link..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, could be much simpler, improved it now.
…ly large static data; and not in wasm backend anyhow)
Some minor test fixes pushed. Should be green now except for |
wasm0.test_the_bullet looks like a llvm crash. We are not seeing it on the wasm waterfall because we only test |
@sbc100 cool, thanks. meanwhile i bisected it to the PIC changes ("Initial implementation of PIC code generation"). |
…re#8369) (for all the static allocation + stack etc.) Not catching this early leads to late validation errors in asm2wasm. fixes WebAssembly/binaryen#1968
…ipten-core#8369)" This reverts commit fabdd2a.
…ipten-core#8369)" This reverts commit fabdd2a.
(for all the static allocation + stack etc.)
Not catching this early leads to late validation errors in asm2wasm.
fixes WebAssembly/binaryen#1968