Closed Desperationis closed 3 years ago
Looks like adding -s INITIAL_MEMORY=X
to the compile command is sufficient. Had the error you mentioned earlier but it was gone after adding this.
We will make this a default in the standard c++ kit. Let me know if setting X to something like 128mb works, so do
-s INITIAL_MEMORY=134217728
Full compile command is
emcc -s FORCE_FILESYSTEM=1 -s INITIAL_MEMORY=134217728 --pre-js internals/init_fs.js main.cpp -o main.js
@StoneT2000 That did the trick! Thanks :)
fixed in #51
I don't know how to explain this. I've literally debugged this for days, even rewrote my multi-file project into a one-file one, and I am still not sure what causes it. I am on Linux, and program in the C++ v1.1.x kit.
Basically, there are certain seeds that cause my bot to crash in one gigantic memory overflow, which is always near turn 340-360. The error always looks like this, though
memory access out of bounds
can also happen:Keep in mind that this only happens rarely, like 1 in 50 seeds.
Here is a one file version of my bot using the cpp kit in the v1.1.x branch:
To get the same error, you must crosscompile main.cpp into a JS file then run the
main.js
it against itself in seed556459304
using the v1.1.x cpp kit.Here are noteworthy findings: