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 'JERRY_CONTEXT (jmem_heap_allocated_size) == 0' failed in jmem_heap_finalize #1873

Closed
renatahodovan opened this issue Jun 1, 2017 · 3 comments
Labels
bug Undesired behaviour

Comments

@renatahodovan
Copy link
Contributor

Jerry version:
Checked revision: a9e7dd7
Build command: ./tools/build.py --clean --debug
OS:
Ubuntu 16.04.2 LTS
Test case:
if (function() {
    while ({a: a,
            get a() {}
           })
        continue;
    })
    var a;
Backtrace:
Script Error: SyntaxError
ICE: Assertion 'JERRY_CONTEXT (jmem_heap_allocated_size) == 0' failed at jerryscript/jerry-core/jmem/jmem-heap.c(jmem_heap_finalize):184.
Error: ERR_FAILED_INTERNAL_ASSERTION
bt
#0  0x000000000046ee82 in syscall_2 () at jerryscript/jerry-libc/target/posix/jerry-asm.S:59
#1  0x0000000000402760 in raise (sig=6) at jerryscript/jerry-libc/target/posix/jerry-libc-target.c:95
#2  0x0000000000402732 in abort () at jerryscript/jerry-libc/target/posix/jerry-libc-target.c:81
#3  0x0000000000403b8e in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-port/default/default-fatal.c:71
#4  0x000000000042c99d in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:58
#5  0x000000000042c9ed in jerry_assert_fail (assertion=0x476540 "JERRY_CONTEXT (jmem_heap_allocated_size) == 0", file=0x4764b0 "jerryscript/jerry-core/jmem/jmem-heap.c", function=0x485aa0 <__func__.3082.lto_priv.272> "jmem_heap_finalize", line=184) at jerryscript/jerry-core/jrt/jrt-fatals.c:82
#6  0x000000000042bd9c in jmem_heap_finalize () at jerryscript/jerry-core/jmem/jmem-heap.c:184
#7  0x000000000042c6a9 in jmem_finalize () at jerryscript/jerry-core/jmem/jmem-allocator.c:51
#8  0x000000000046a659 in jerry_cleanup () at jerryscript/jerry-core/api/jerry.c:195
#9  0x000000000046e34c in main (argc=3, argv=0x7fffffffd178) at jerryscript/jerry-main/main-unix.c:787

Found by Fuzzinator with Grammarinator

@LaszloLango LaszloLango added the bug Undesired behaviour label Jun 1, 2017
@zherczeg
Copy link
Member

Note: object literal format changed in ES6. The syntax error is completely valid in ES5, but the memory leak is not. I would not change it until we support es6 object literals.

@akosthekiss
Copy link
Member

What do you mean by invalid memory leak? The engine tries to parse an input, throws an error, and finally asserts out at cleanup.

@zherczeg
Copy link
Member

This is what I am talking about as well. The leak is the error, not the syntax error, before somebody misunderstand the problem.

rerobika added a commit to rerobika/jerryscript that referenced this issue Jun 29, 2017
…is parsed

Fixes jerryscript-project#1873.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
rerobika added a commit to rerobika/jerryscript that referenced this issue Jun 29, 2017
…is parsed

Fixes jerryscript-project#1873.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
LaszloLango pushed a commit that referenced this issue Jun 30, 2017
…is parsed (#1897)

Fixes #1873.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Undesired behaviour
Projects
None yet
Development

No branches or pull requests

4 participants