jerryscript
jerryscript copied to clipboard
Weird behavior that comment matters what's happening.
I encountered a weird situation that I could not figure out what's going on that running a program ends with unexpected result runs good when added comments.
You may reproduce it by:
- checkout iotjs/fs_readfile
- build
$ ./tools/build.py
- goto test directory
$ cd test/run_pass
- run the program
$ ../../build/x86_64-linux/debug/iotjs/iotjs test_net.js
If you see this:
uncaughtException: TypeError
uncaughtException: AssertionError: { actual: 1, expected: 0, operator: == }
It is the unexpected result.
If you change the program "test_net.js" slightly by adding comment like this:
process.on('exit', function(code) {
// comment meaning nothing.
assert.equal(code, 0);
assert.equal(msg, "Hello IoT.js");
});
The program will end good.
Got
ICE: Assertion 'compressed_pointer != MEM_CP_NULL' failed at /home/ilyoan/project/harmony/iotjs/deps/jerry/jerry-core/mem/mem-allocator.cpp(mem_decompress_pointer):124.
Error: ERR_FAILED_INTERNAL_ASSERTION
with
...
process.on('exit', function(code) {
// comment
assert.equal(code, 0);
assert.equal(msg, "Hello IoT.js");
});
Look like it was due to accessing after gc. https://github.com/Samsung/iotjs/pull/106 might fix this.
The problem has gone away after Samsung/iotjs#106. Closing