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 context_p->stack_top_uint8 == SCAN_STACK_TRY_STATEMENT || context_p->stack_top_uint8 == SCAN_STACK_CATCH_STATEMENT in scanner_scan_statement_end #3145

Closed
renatahodovan opened this issue Sep 23, 2019 · 0 comments · Fixed by #3150
Labels
bug Undesired behaviour pre-scanner Related to the JavaScript pre-scanner

Comments

@renatahodovan
Copy link
Contributor

JerryScript revision

25b81c1

Build platform

Linux-5.0.0-27-generic-x86_64-with-Ubuntu-19.04-disco

Build steps
./tools/build.py --clean --debug --compile-flag=-fsanitize=address \
--compile-flag=-m32 --compile-flag=-fno-omit-frame-pointer \
--compile-flag=-fno-common --compile-flag=-g \
--strip=off --system-allocator=on --logging=on \
--linker-flag=-fuse-ld=gold --error-messages=on --profile=es2015-subset
Test case
[this?$
Output
ICE: Assertion 'context_p->stack_top_uint8 == SCAN_STACK_TRY_STATEMENT || context_p->stack_top_uint8 == SCAN_STACK_CATCH_STATEMENT' failed at jerryscript/jerry-core/parser/js/js-scanner.c(scanner_scan_statement_end):1430.
Error: ERR_FAILED_INTERNAL_ASSERTION
Backtrace
bt
(gdb) bt
#0  0xf7fd3939 in __kernel_vsyscall ()
#1  0xf77bf182 in raise () from /lib/i386-linux-gnu/libc.so.6
#2  0xf77a92b6 in abort () from /lib/i386-linux-gnu/libc.so.6
#3  0x5666f7eb in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION)
    at jerryscript/jerry-port/default/default-fatal.c:71
#4  0x565d7aa0 in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:58
#5  0x565d7ae1 in jerry_assert_fail (
    assertion=0x5669e1c0 "context_p->stack_top_uint8 == SCAN_STACK_TRY_STATEMENT || context_p->stack_top_uint8 == SCAN_STACK_CATCH_STATEMENT", file=0x5669df20 "jerryscript/jerry-core/parser/js/js-scanner.c", 
    function=0x5669e560 <__func__.4162> "scanner_scan_statement_end", line=1430)
    at jerryscript/jerry-core/jrt/jrt-fatals.c:82
#6  0x565f0d21 in scanner_scan_statement_end (context_p=0xffffc750, scanner_context_p=0xffffc620, type=LEXER_EOS)
    at jerryscript/jerry-core/parser/js/js-scanner.c:1429
#7  0x565f1e70 in scanner_scan_all (context_p=0xffffc750, arg_list_p=0x0, arg_list_end_p=0x0, source_p=0x566e9b40 <buffer> "[this?$", 
    source_end_p=0x566e9b47 <buffer+7> "") at jerryscript/jerry-core/parser/js/js-scanner.c:1720
#8  0x565e7210 in parser_parse_source (arg_list_p=0x0, arg_list_size=0, source_p=0x566e9b40 <buffer> "[this?$", source_size=7, 
    parse_opts=0, error_location_p=0xffffc960) at jerryscript/jerry-core/parser/js/js-parser.c:2470
#9  0x565ea765 in parser_parse_script (arg_list_p=0x0, arg_list_size=0, source_p=0x566e9b40 <buffer> "[this?$", source_size=7, 
    parse_opts=0, bytecode_data_p=0xffffca20) at jerryscript/jerry-core/parser/js/js-parser.c:3001
#10 0x5657005e in jerry_parse (resource_name_p=0xffffd142 "test.js", resource_name_length=7, source_p=0x566e9b40 <buffer> "[this?$", 
    source_size=7, parse_opts=0) at jerryscript/jerry-core/api/jerry.c:426
#11 0x5656d05e in main (argc=3, argv=0xffffcf14) at jerryscript/jerry-main/main-unix.c:734

Found by Fuzzinator with grammarinator.

@rerobika rerobika added bug Undesired behaviour pre-scanner Related to the JavaScript pre-scanner labels Sep 23, 2019
zherczeg added a commit to zherczeg/jerryscript that referenced this issue Sep 23, 2019
Colon tokens must be present before the next statement is executed.

Fixes jerryscript-project#3145

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
dbatyai pushed a commit that referenced this issue Sep 24, 2019
Colon tokens must be present before the next statement is executed.

Fixes #3145

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Undesired behaviour pre-scanner Related to the JavaScript pre-scanner
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants