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.status_flags & PARSER_SCANNING_SUCCESSFUL in parser_parse_source #3174

Closed
renatahodovan opened this issue Sep 29, 2019 · 0 comments
Labels
bug Undesired behaviour parser Related to the JavaScript parser

Comments

@renatahodovan
Copy link
Contributor

JerryScript revision

a8fb4ee

Build platform

Linux-4.15.0-62-generic-x86_64-with-Ubuntu-18.04-bionic

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
if ($)
    function $ ( ) { };
else if ( b ) c
Output
ICE: Assertion 'context.status_flags & PARSER_SCANNING_SUCCESSFUL' failed at jerryscript/jerry-core/parser/js/js-parser.c(parser_parse_source):2552.
Error: ERR_FAILED_INTERNAL_ASSERTION
Backtrace
bt
#0  0xf7fd5079 in __kernel_vsyscall ()
#1  0xf77fc832 in raise () from /lib/i386-linux-gnu/libc.so.6
#2  0xf77fdcc1 in abort () from /lib/i386-linux-gnu/libc.so.6
#3  0x56579963 in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-port/default/default-fatal.c:71
#4  0x56615f84 in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:58
#5  0x56615fc5 in jerry_assert_fail (assertion=0x566ac9a0 "context.status_flags & PARSER_SCANNING_SUCCESSFUL", file=0x566ac660 "jerryscript/jerry-core/parser/js/js-parser.c", function=0x5668ec20 <__func__.5463.lto_priv.113> "parser_parse_source", line=2552) at jerryscript/jerry-core/jrt/jrt-fatals.c:82
#6  0x565d1693 in parser_parse_source (arg_list_p=0x0, arg_list_size=0, source_p=0x566f1ca0 <buffer.lto_priv> "var a = 1 , b = 2 ; \nvar c ; \nif ( a === 1 ) if ( b === 1 ) function nonStrictFuncExpr ( ) { print ( typeof nonStrictFuncExpr == \"function\" ) ; \nnonStrictFuncExpr = 123 ; \nprint ( typeof nonStrictFunc"..., source_size=297, parse_opts=0, error_location_p=0xffffc6b0) at jerryscript/jerry-core/parser/js/js-parser.c:2552
#7  0x565d3f87 in parser_parse_script (arg_list_p=0x0, arg_list_size=0, source_p=0x566f1ca0 <buffer.lto_priv> "var a = 1 , b = 2 ; \nvar c ; \nif ( a === 1 ) if ( b === 1 ) function nonStrictFuncExpr ( ) { print ( typeof nonStrictFuncExpr == \"function\" ) ; \nnonStrictFuncExpr = 123 ; \nprint ( typeof nonStrictFunc"..., source_size=297, parse_opts=0, bytecode_data_p=0xffffc770) at jerryscript/jerry-core/parser/js/js-parser.c:3001
#8  0x56649e72 in jerry_parse (resource_name_p=0xffffcd8e "/home/reni/.fuzzinator_21989//jerryscript/picireny/20458744229542037493109645523211383964.js", resource_name_length=92, source_p=0x566f1ca0 <buffer.lto_priv> "var a = 1 , b = 2 ; \nvar c ; \nif ( a === 1 ) if ( b === 1 ) function nonStrictFuncExpr ( ) { print ( typeof nonStrictFuncExpr == \"function\" ) ; \nnonStrictFuncExpr = 123 ; \nprint ( typeof nonStrictFunc"..., source_size=297, parse_opts=0) at jerryscript/jerry-core/api/jerry.c:426
#9  0x56646c62 in main (argc=3, argv=0xffffcb04) at jerryscript/jerry-main/main-unix.c:734

Found by Fuzzinator with grammarinator.

@rerobika rerobika added bug Undesired behaviour parser Related to the JavaScript parser labels Oct 2, 2019
rerobika added a commit to rerobika/jerryscript that referenced this issue Oct 2, 2019
This patch fixes jerryscript-project#3151 and fixes jerryscript-project#3174.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik [email protected]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Undesired behaviour parser Related to the JavaScript parser
Projects
None yet
Development

No branches or pull requests

2 participants