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

SEGV in parser_parse_class and parser_parse_for_statement_start #5153

Open
Qbtly opened this issue Aug 5, 2024 · 0 comments
Open

SEGV in parser_parse_class and parser_parse_for_statement_start #5153

Qbtly opened this issue Aug 5, 2024 · 0 comments

Comments

@Qbtly
Copy link

Qbtly commented Aug 5, 2024

Commit ID

2dbb6f7

Build platform

Ubuntu 22.04.3

Build steps
python3 ./tools/build.py --builddir=xxx --clean --compile-flag=-fsanitize=address --compile-flag=-g --strip=off --lto=off --logging=on --line-info=on --error-message=on --stack-limit=20
Execution steps
./jerry poc.js
Test case
//poc1.js
class C { async#* method () {
    class 
Output
AddressSanitizer:DEADLYSIGNAL
=================================================================
==2742590==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000008 (pc 0x0000007a8144 bp 0x7fff473ce8f0 sp 0x7fff473ce6a0 T0)
==2742590==The signal is caused by a READ memory access.
==2742590==Hint: address points to the zero page.
    #0 0x7a8144 in parser_parse_class /jerryscript/jerry-core/parser/js/js-parser-expr.c:1016:46
    #1 0x7dabc6 in parser_parse_statements /jerryscript/jerry-core/parser/js/js-parser-statm.c:2787:9
    #2 0x647e67 in parser_parse_function /jerryscript/jerry-core/parser/js/js-parser.c:2717:3
    #3 0x79eec2 in lexer_construct_function_object /jerryscript/jerry-core/parser/js/js-lexer.c:2695:23
    #4 0x7aa79e in parser_parse_class_body /jerryscript/jerry-core/parser/js/js-parser-expr.c:911:39
    #5 0x7aa79e in parser_parse_class /jerryscript/jerry-core/parser/js/js-parser-expr.c:1113:27
    #6 0x7dabc6 in parser_parse_statements /jerryscript/jerry-core/parser/js/js-parser-statm.c:2787:9
    #7 0x663433 in parser_parse_source /jerryscript/jerry-core/parser/js/js-parser.c:2280:5
    #8 0x6611ca in parser_parse_script /jerryscript/jerry-core/parser/js/js-parser.c:3332:38
    #9 0x4ec611 in jerry_parse_common /jerryscript/jerry-core/api/jerryscript.c:418:21
    #10 0x4ec23e in jerry_parse /jerryscript/jerry-core/api/jerryscript.c:486:10
    #11 0x80402d in jerryx_source_parse_script /jerryscript/jerry-ext/util/sources.c:52:26
    #12 0x80432c in jerryx_source_exec_script /jerryscript/jerry-ext/util/sources.c:63:26
    #13 0x4e0160 in main /jerryscript/jerry-main/main-desktop.c:156:20
    #14 0x7fdcb820ad8f  (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f)
    #15 0x7fdcb820ae3f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e3f)
    #16 0x427fd4 in _start (/jerryscript/0805/bin/jerry+0x427fd4)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV /jerryscript/jerry-core/parser/js/js-parser-expr.c:1016:46 in parser_parse_class
==2742590==ABORTING
Test case
//poc2.js
class C { async#* method () {
    for ()
Output
AddressSanitizer:DEADLYSIGNAL
=================================================================
==2736108==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000008 (pc 0x0000007dae99 bp 0x7ffe22722210 sp 0x7ffe22721760 T0)
==2736108==The signal is caused by a READ memory access.
==2736108==Hint: address points to the zero page.
    #0 0x7dae99 in parser_parse_for_statement_start /jerryscript/jerry-core/parser/js/js-parser-statm.c:1137:62
    #1 0x7dae99 in parser_parse_statements /jerryscript/jerry-core/parser/js/js-parser-statm.c:2851:9
    #2 0x647e67 in parser_parse_function /jerryscript/jerry-core/parser/js/js-parser.c:2717:3
    #3 0x79eec2 in lexer_construct_function_object /jerryscript/jerry-core/parser/js/js-lexer.c:2695:23
    #4 0x7aa79e in parser_parse_class_body /jerryscript/jerry-core/parser/js/js-parser-expr.c:911:39
    #5 0x7aa79e in parser_parse_class /jerryscript/jerry-core/parser/js/js-parser-expr.c:1113:27
    #6 0x7dabc6 in parser_parse_statements /jerryscript/jerry-core/parser/js/js-parser-statm.c:2787:9
    #7 0x663433 in parser_parse_source /jerryscript/jerry-core/parser/js/js-parser.c:2280:5
    #8 0x6611ca in parser_parse_script /jerryscript/jerry-core/parser/js/js-parser.c:3332:38
    #9 0x4ec611 in jerry_parse_common /jerryscript/jerry-core/api/jerryscript.c:418:21
    #10 0x4ec23e in jerry_parse /jerryscript/jerry-core/api/jerryscript.c:486:10
    #11 0x80402d in jerryx_source_parse_script /jerryscript/jerry-ext/util/sources.c:52:26
    #12 0x80432c in jerryx_source_exec_script /jerryscript/jerry-ext/util/sources.c:63:26
    #13 0x4e0160 in main /jerryscript/jerry-main/main-desktop.c:156:20
    #14 0x7f064248dd8f  (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f)
    #15 0x7f064248de3f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e3f)
    #16 0x427fd4 in _start (/jerryscript/0805/bin/jerry+0x427fd4)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV /jerryscript/jerry-core/parser/js/js-parser-statm.c:1137:62 in parser_parse_for_statement_start
==2736108==ABORTING
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant