jerryscript icon indicating copy to clipboard operation
jerryscript copied to clipboard

Weird behavior that comment matters what's happening.

Open ILyoan opened this issue 11 years ago • 3 comments

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:

  1. checkout iotjs/fs_readfile
  2. build
    • $ ./tools/build.py
  3. goto test directory
    • $ cd test/run_pass
  4. 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.

ILyoan avatar Jun 25 '15 09:06 ILyoan

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");
});

ILyoan avatar Jun 25 '15 10:06 ILyoan

Look like it was due to accessing after gc. https://github.com/Samsung/iotjs/pull/106 might fix this.

ILyoan avatar Jun 29 '15 02:06 ILyoan

The problem has gone away after Samsung/iotjs#106. Closing

ILyoan avatar Jun 29 '15 05:06 ILyoan