issue_owner_repo
sequencelengths
2
2
issue_body
stringlengths
0
261k
issue_title
stringlengths
1
925
issue_comments_url
stringlengths
56
81
issue_comments_count
int64
0
2.5k
issue_created_at
stringlengths
20
20
issue_updated_at
stringlengths
20
20
issue_html_url
stringlengths
37
62
issue_github_id
int64
387k
2.46B
issue_number
int64
1
127k
[ "jerryscript-project", "jerryscript" ]
version: commit 4dc2cb3328556cfb827f740bcb8d23be0ee14075 Build command: /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 poc: var v0 = /((\b){100000,})\3/g; (v1) = v0.exec("abc abc"); running results: ~/jerryscript/bin$ ./jerry poc.js Segmentation fault (core dumped) stack trace: (rr) bt #0 0x0000561a6169361a in re_get_opcode ( bc_p=<error reading variable: Cannot access memory at address 0x7ffcfb46aff8>) at /home/zdz/jerryscript/jerry-core/parser/regexp/re-bytecode.c:169 #1 0x0000561a616a2faf in ecma_regexp_match (re_ctx_p=0x7ffcfbc8a650, bc_p=0x561a619e53e3 <jerry_global_heap+643> "\025\004", str_curr_p=0x561a619e538c <jerry_global_heap+556> "abc abc\177") at /home/zdz/jerryscript/jerry-core/ecma/operations/ecma-regexp-object.c:545 #2 0x0000561a616a413c in ecma_regexp_match (re_ctx_p=0x7ffcfbc8a650, bc_p=0x561a619e53e3 <jerry_global_heap+643> "\025\004", str_curr_p=0x561a619e538c <jerry_global_heap+556> "abc abc\177") at /home/zdz/jerryscript/jerry-core/ecma/operations/ecma-regexp-object.c:1122 #3 0x0000561a616a413c in ecma_regexp_match (re_ctx_p=0x7ffcfbc8a650, bc_p=0x561a619e53e3 <jerry_global_heap+643> "\025\004", str_curr_p=0x561a619e538c <jerry_global_heap+556> "abc abc\177") at /home/zdz/jerryscript/jerry-core/ecma/operations/ecma-regexp-object.c:1122 #4 0x0000561a616a413c in ecma_regexp_match (re_ctx_p=0x7ffcfbc8a650, bc_p=0x561a619e53e3 <jerry_global_heap+643> "\025\004", str_curr_p=0x561a619e538c <jerry_global_heap+556> "abc abc\177") at /home/zdz/jerryscript/jerry-core/ecma/operations/ecma-regexp-object.c:1122 #5 0x0000561a616a413c in ecma_regexp_match (re_ctx_p=0x7ffcfbc8a650, bc_p=0x561a619e53e3 <jerry_global_heap+643> "\025\004", str_curr_p=0x561a619e538c <jerry_global_heap+556> "abc abc\177") at /home/zdz/jerryscript/jerry-core/ecma/operations/ecma-regexp-object.c:11---Type <return> to continue, or q <return> to quit--- 22 #6 0x0000561a616a413c in ecma_regexp_match (re_ctx_p=0x7ffcfbc8a650, bc_p=0x561a619e53e3 <jerry_global_heap+643> "\025\004", str_curr_p=0x561a619e538c <jerry_global_heap+556> "abc abc\177") at /home/zdz/jerryscript/jerry-core/ecma/operations/ecma-regexp-object.c:1122 Found by Dongzhuo Zhao working with ADLab of Venustech
Segmentation fault in function ecma_regexp_match in file ecma-regexp-object.c
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3733/comments
1
2020-05-13T07:16:05Z
2020-05-15T15:58:18Z
https://github.com/jerryscript-project/jerryscript/issues/3733
617,204,443
3,733
[ "jerryscript-project", "jerryscript" ]
###### JerryScript revision 90c7eccb ###### Build platform Linux-4.15.0-88-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 ```javascript Function("a = 5, b, c = function() { for (var a = 0; a < 4; a++) ; return a; } ()", "eval ('super (a, b, c, d)')") ``` ###### Output ```text ICE: Assertion 'context.stack_top_uint8 == CBC_MAXIMUM_BYTE_VALUE && context.stack.last_position == 1 && context.stack.first_p != NULL && context.stack.first_p->next_p == NULL && context.stack.last_p == NULL' failed at jerryscript/jerry-core/parser/js/js-parser.c(parser_parse_source):2154. Error: ERR_FAILED_INTERNAL_ASSERTION ASAN:DEADLYSIGNAL ================================================================= ==8872==ERROR: AddressSanitizer: ABRT on unknown address 0x000022a8 (pc 0xf7f0e079 bp 0xffae27ec sp 0xffae27d0 T0) #0 0xf7f0e078 (linux-gate.so.1+0x1078) #1 0xf7f0e078 (linux-gate.so.1+0x1078) #2 0xf7735831 in raise (/lib/i386-linux-gnu/libc.so.6+0x2d831) #3 0xf7736cc0 in abort (/lib/i386-linux-gnu/libc.so.6+0x2ecc0) #4 0x565bef33 in jerry_port_fatal jerryscript/jerry-port/default/default-fatal.c:30 #5 0x56674be6 in jerry_fatal jerryscript/jerry-core/jrt/jrt-fatals.c:63 #6 0x56674c27 in jerry_assert_fail jerryscript/jerry-core/jrt/jrt-fatals.c:87 #7 0x56683d7a in parser_parse_source jerryscript/jerry-core/parser/js/js-parser.c:2150 #8 0x56687127 in parser_parse_script jerryscript/jerry-core/parser/js/js-parser.c:2657 #9 0x566d245d in ecma_op_create_dynamic_function jerryscript/jerry-core/ecma/operations/ecma-function-object.c:263 #10 0x56633f05 in ecma_builtin_function_dispatch_construct jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-function.c:74 #11 0x566b74de in ecma_builtin_dispatch_construct jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.c:1160 #12 0x56690398 in ecma_op_function_construct jerryscript/jerry-core/ecma/operations/ecma-function-object.c:1207 #13 0x566577b4 in opfunc_construct.lto_priv.447 jerryscript/jerry-core/vm/vm.c:849 #14 0x56618744 in vm_execute jerryscript/jerry-core/vm/vm.c:4109 #15 0x56618c7e in vm_run jerryscript/jerry-core/vm/vm.c:4190 #16 0x56655866 in vm_run_global jerryscript/jerry-core/vm/vm.c:321 #17 0x566d91b5 in jerry_run jerryscript/jerry-core/api/jerry.c:596 #18 0x566d579f in main jerryscript/jerry-main/main-unix.c:759 #19 0xf7720e80 in __libc_start_main (/lib/i386-linux-gnu/libc.so.6+0x18e80) #20 0x565b2130 (jerryscript/build_gcc_asan_es2015/bin/jerry+0x1a130) AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: ABRT (linux-gate.so.1+0x1078) ==8872==ABORTING ``` <sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [grammarinator](https://github.com/renatahodovan/grammarinator). </sup>
Assertion 'context.stack_top_uint8 == CBC_MAXIMUM_BYTE_VALUE && context.stack.last_position == 1 && context.stack.first_p != NULL && context.stack.first_p->next_p == NULL && context.stack.last_p == NULL' failed in parser_parse_source
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3727/comments
1
2020-05-07T13:26:22Z
2020-05-25T14:51:05Z
https://github.com/jerryscript-project/jerryscript/issues/3727
614,056,951
3,727
[ "jerryscript-project", "jerryscript" ]
I've got a bug that only shows up when cross compiling for a raspberry pi target. The code base was cloned from github in October 2019. Unfortunately, the git information wasn't preserved when it was cloned. It looks like the relevant functions haven't changed since then. I'm not terribly familiar with the jerryscript code base so if someone could weigh in and help debug, that would be great. On the raspberry pi target, I'm getting a stack smash in ecma_errol0_dtoa() . The backtraces and whatnot are shown below. It appears that in ecma_errol0_dtoa() iterates around the loop "while (high_bound.value != 0.0 || high_bound.offset != 0.0)" adding 0x30 to the buffer until it walks up the stack and clobbers something that causes the crash. The maddening thing is that this bug only shows up on the raspberry pi builds and only triggers every few builds. The X64 and ESP8266 targets never have the same crash. r0 0x0 0 r1 0x0 0 r2 0x75dcf000 1977413632 r3 0x30 48 r4 0x0 0 r5 0x0 0 r6 0x0 0 r7 0xfff80000 4294443008 r8 0x7efff532 2130703666 r9 0x1 1 r10 0x1000 4096 r11 0x75dcde64 1977409124 r12 0x80000000 2147483648 sp 0x75dcda20 0x75dcda20 lr 0x37fa0 229280 pc 0x24c04 0x24c04 <ecma_errol0_dtoa+1472> cpsr 0x30 48 Thread 4 "main.bad" received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x75dce470 (LWP 18880)] 0x00024c04 in ecma_errol0_dtoa () (gdb) bt #0 0x00024c04 in ecma_errol0_dtoa () #1 0x000244f0 in ecma_number_to_utf8_string () #2 0x000255a8 in ecma_new_ecma_string_from_number () #3 0x30303030 in ?? (). <---smashed obviously :( Backtrace stopped: previous frame identical to this frame (corrupt stack?) (gdb) (gdb) x/10i $pc => 0x24c04 <ecma_errol0_dtoa+1472>: strb r3, [r2, #0] 0x24c06 <ecma_errol0_dtoa+1474>: movs r0, r4 0x24c08 <ecma_errol0_dtoa+1476>: bl 0x38394 <____aeabi_i2d_from_thumb> 0x24c0c <ecma_errol0_dtoa+1480>: movs r2, r0 0x24c0e <ecma_errol0_dtoa+1482>: movs r3, r1 0x24c10 <ecma_errol0_dtoa+1484>: movs r0, r6 0x24c12 <ecma_errol0_dtoa+1486>: movs r1, r7 0x24c14 <ecma_errol0_dtoa+1488>: bl 0x38258 <____aeabi_dsub_from_thumb> 0x24c18 <ecma_errol0_dtoa+1492>: movs r2, #0 0x24c1a <ecma_errol0_dtoa+1494>: ldr r3, [pc, #304] ; (0x24d4c <ecma_errol0_dtoa+1800>) (gdb) x/100bx $r2-80 <- 5200 0x30 written over the stack. This is the tail end of them. 0x75dcefb0: 0x30 0x30 0x30 0x30 0x30 0x30 0x30 0x30 0x75dcefb8: 0x30 0x30 0x30 0x30 0x30 0x30 0x30 0x30 0x75dcefc0: 0x30 0x30 0x30 0x30 0x30 0x30 0x30 0x30 0x75dcefc8: 0x30 0x30 0x30 0x30 0x30 0x30 0x30 0x30 0x75dcefd0: 0x30 0x30 0x30 0x30 0x30 0x30 0x30 0x30 0x75dcefd8: 0x30 0x30 0x30 0x30 0x30 0x30 0x30 0x30 0x75dcefe0: 0x30 0x30 0x30 0x30 0x30 0x30 0x30 0x30 0x75dcefe8: 0x30 0x30 0x30 0x30 0x30 0x30 0x30 0x30 0x75dceff0: 0x30 0x30 0x30 0x30 0x30 0x30 0x30 0x30 0x75dceff8: 0x30 0x30 0x30 0x30 0x30 0x30 0x30 0x30 0x75dcf000: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x75dcf008: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x75dcf010: 0x00 0x00 0x00 0x00 ###### Build platform Mac OS X 10.14.6 (Darwin 18.7.0 x86_64) arm-unknown-linux-gnueabi-gcc (crosstool-NG 1.24.0) 8.3.0 ###### Build steps python tools/build.py --profile=minimal --external-context=ON --verbose --clean --toolchain cmake/toolchain_raspberry_pi.cmake --lto off --jerry-cmdline off ###### Javascript print('Task Init'); automation.thisDevice.deviceID="8acaf075-2edd-4c27-ab9b-74c62b14d41d"; var p=automation.points[0]; print("Initial point",JSON.stringify(p)); This is the output on a loop that didn't crash. The conversion is obviously bad here as well. Initial point {"globalPointID":"20605adf-9566-80eb-7646-9a28c5fa3af3","localPointID":"aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee","description":"Percent door open","value":0.0005000000249999986823290498705318896099925041198730468750,"type":7} p is a structure created in C. The double that it's trying to convert to a string is created using this function. jerry_value_t pointValueToJerryValue(PointValueVariant* v){ debug3("pointValueToJerryValue\n"); switch (v->type){ case PointTypeInvalid: case PointTypeUnknown: return jerry_create_null(); case PointTypeBoolean: return jerry_create_boolean(v->value.boolean); case PointTypeInteger: return jerry_create_number(v->value.integer); case PointTypeDouble: return jerry_create_number(v->value.dbl); default: error2("Cannot convert this point type to javascript\n"); return jerry_create_undefined(); } } I'm happy to provide a test binary with the issue. Thanks in advance!
Infinite loop and stack smash in ecma_errol0_dtoa
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3724/comments
3
2020-05-07T00:52:42Z
2020-05-14T01:45:28Z
https://github.com/jerryscript-project/jerryscript/issues/3724
613,700,358
3,724
[ "jerryscript-project", "jerryscript" ]
###### JerryScript revision 409e1fec ###### Build platform Linux-4.15.0-88-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 ```javascript class B extends Array { constructor() { super (super.f) super.f = 8; } } new B ``` ###### Output ```text ICE: Assertion 'ecma_is_lexical_environment (object_p) || !ecma_op_object_is_fast_array (object_p)' failed at jerryscript/jerry-core/ecma/base/ecma-helpers.c(ecma_create_named_data_property):524. Error: ERR_FAILED_INTERNAL_ASSERTION ASAN:DEADLYSIGNAL ================================================================= ==47843==ERROR: AddressSanitizer: ABRT on unknown address 0x0000bae3 (pc 0xf7f11079 bp 0xff911c1c sp 0xff911c00 T0) #0 0xf7f11078 (linux-gate.so.1+0x1078) #1 0xf7f11078 (linux-gate.so.1+0x1078) #2 0xf7738831 in raise (/lib/i386-linux-gnu/libc.so.6+0x2d831) #3 0xf7739cc0 in abort (/lib/i386-linux-gnu/libc.so.6+0x2ecc0) #4 0x56587f33 in jerry_port_fatal jerryscript/jerry-port/default/default-fatal.c:30 #5 0x5663dbe6 in jerry_fatal jerryscript/jerry-core/jrt/jrt-fatals.c:63 #6 0x5663dc27 in jerry_assert_fail jerryscript/jerry-core/jrt/jrt-fatals.c:87 #7 0x566c7c0c in ecma_create_named_data_property jerryscript/jerry-core/ecma/base/ecma-helpers.c:523 #8 0x566654a9 in ecma_op_object_put_apply_receiver jerryscript/jerry-core/ecma/operations/ecma-objects.c:1198 #9 0x566667ad in ecma_op_object_put_with_receiver jerryscript/jerry-core/ecma/operations/ecma-objects.c:1542 #10 0x565865ea in opfunc_assign_super_reference jerryscript/jerry-core/vm/opcodes.c:1261 #11 0x566272b4 in vm_loop.lto_priv.451 jerryscript/jerry-core/vm/vm.c:2037 #12 0x565e16a2 in vm_execute jerryscript/jerry-core/vm/vm.c:4082 #13 0x565e1c7e in vm_run jerryscript/jerry-core/vm/vm.c:4190 #14 0x56658585 in ecma_op_function_call_simple jerryscript/jerry-core/ecma/operations/ecma-function-object.c:864 #15 0x5665957b in ecma_op_function_construct jerryscript/jerry-core/ecma/operations/ecma-function-object.c:1254 #16 0x566207b4 in opfunc_construct.lto_priv.447 jerryscript/jerry-core/vm/vm.c:849 #17 0x565e1744 in vm_execute jerryscript/jerry-core/vm/vm.c:4109 #18 0x565e1c7e in vm_run jerryscript/jerry-core/vm/vm.c:4190 #19 0x5661e866 in vm_run_global jerryscript/jerry-core/vm/vm.c:321 #20 0x566a218c in jerry_run jerryscript/jerry-core/api/jerry.c:596 #21 0x5669e776 in main jerryscript/jerry-main/main-unix.c:759 #22 0xf7723e80 in __libc_start_main (/lib/i386-linux-gnu/libc.so.6+0x18e80) #23 0x5657b130 (jerryscript/build_gcc_asan_es2015/bin/jerry+0x1a130) AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: ABRT (linux-gate.so.1+0x1078) ==47843==ABORTING ``` <sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [grammarinator](https://github.com/renatahodovan/grammarinator). </sup>
Assertion ecma_is_lexical_environment (object_p) || !ecma_op_object_is_fast_array (object_p) in ecma_create_named_data_property
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3715/comments
0
2020-05-04T19:41:33Z
2020-05-07T07:00:51Z
https://github.com/jerryscript-project/jerryscript/issues/3715
612,120,341
3,715
[ "jerryscript-project", "jerryscript" ]
###### JerryScript revision 409e1fec ###### Build platform Linux-4.15.0-88-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 ```javascript function $() { if ($) function } ``` ###### Output ```text ICE: Assertion 'context_p->next_scanner_info_p->source_p == context_p->source_p' failed at jerryscript/jerry-core/parser/js/js-parser-statm.c(parser_parse_function_statement):625. Error: ERR_FAILED_INTERNAL_ASSERTION ASAN:DEADLYSIGNAL ================================================================= ==3351==ERROR: AddressSanitizer: ABRT on unknown address 0x00000d17 (pc 0xf7f05079 bp 0xffc0dcbc sp 0xffc0dca0 T0) #0 0xf7f05078 (linux-gate.so.1+0x1078) #1 0xf7f05078 (linux-gate.so.1+0x1078) #2 0xf772c831 in raise (/lib/i386-linux-gnu/libc.so.6+0x2d831) #3 0xf772dcc0 in abort (/lib/i386-linux-gnu/libc.so.6+0x2ecc0) #4 0x56632f33 in jerry_port_fatal jerryscript/jerry-port/default/default-fatal.c:30 #5 0x566e8be6 in jerry_fatal jerryscript/jerry-core/jrt/jrt-fatals.c:63 #6 0x566e8c27 in jerry_assert_fail jerryscript/jerry-core/jrt/jrt-fatals.c:87 #7 0x566595b8 in parser_parse_function_statement jerryscript/jerry-core/parser/js/js-parser-statm.c:625 #8 0x56664a84 in parser_parse_statements jerryscript/jerry-core/parser/js/js-parser-statm.c:2806 #9 0x566fa46d in parser_parse_function jerryscript/jerry-core/parser/js/js-parser.c:2437 #10 0x5665a1f6 in parser_parse_function_statement jerryscript/jerry-core/parser/js/js-parser-statm.c:792 #11 0x56664a84 in parser_parse_statements jerryscript/jerry-core/parser/js/js-parser-statm.c:2806 #12 0x566f7b23 in parser_parse_source jerryscript/jerry-core/parser/js/js-parser.c:2146 #13 0x566fb127 in parser_parse_script jerryscript/jerry-core/parser/js/js-parser.c:2657 #14 0x5674cb1d in jerry_parse jerryscript/jerry-core/api/jerry.c:448 #15 0x5674972d in main jerryscript/jerry-main/main-unix.c:750 #16 0xf7717e80 in __libc_start_main (/lib/i386-linux-gnu/libc.so.6+0x18e80) #17 0x56626130 (jerryscript/build_gcc_asan_es2015/bin/jerry+0x1a130) AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: ABRT (linux-gate.so.1+0x1078) ==3351==ABORTING ``` <sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [grammarinator](https://github.com/renatahodovan/grammarinator). </sup>
Assertion context_p->next_scanner_info_p->source_p == context_p->source_p in parser_parse_function_statement
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3714/comments
1
2020-05-04T18:14:02Z
2020-05-25T14:44:52Z
https://github.com/jerryscript-project/jerryscript/issues/3714
612,068,926
3,714
[ "jerryscript-project", "jerryscript" ]
###### JerryScript revision 409e1fec ###### Build platform Linux-4.15.0-88-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 ```javascript function $(b = eval()) { ""() eval() } ``` ###### Output ```text ICE: Assertion 'context_p->stack_depth == 0' failed at jerryscript/jerry-core/parser/js/js-parser-statm.c(parser_parse_statements):2601. Error: ERR_FAILED_INTERNAL_ASSERTION ASAN:DEADLYSIGNAL ================================================================= ==3340==ERROR: AddressSanitizer: ABRT on unknown address 0x00000d0c (pc 0xf7f33079 bp 0xffacc02c sp 0xffacc010 T0) #0 0xf7f33078 (linux-gate.so.1+0x1078) #1 0xf7f33078 (linux-gate.so.1+0x1078) #2 0xf775a831 in raise (/lib/i386-linux-gnu/libc.so.6+0x2d831) #3 0xf775bcc0 in abort (/lib/i386-linux-gnu/libc.so.6+0x2ecc0) #4 0x56637f33 in jerry_port_fatal jerryscript/jerry-port/default/default-fatal.c:30 #5 0x566edbe6 in jerry_fatal jerryscript/jerry-core/jrt/jrt-fatals.c:63 #6 0x566edc27 in jerry_assert_fail jerryscript/jerry-core/jrt/jrt-fatals.c:87 #7 0x56669029 in parser_parse_statements jerryscript/jerry-core/parser/js/js-parser-statm.c:2601 #8 0x566ff46d in parser_parse_function jerryscript/jerry-core/parser/js/js-parser.c:2437 #9 0x5665f1f6 in parser_parse_function_statement jerryscript/jerry-core/parser/js/js-parser-statm.c:792 #10 0x56669a84 in parser_parse_statements jerryscript/jerry-core/parser/js/js-parser-statm.c:2806 #11 0x566fcb23 in parser_parse_source jerryscript/jerry-core/parser/js/js-parser.c:2146 #12 0x56700127 in parser_parse_script jerryscript/jerry-core/parser/js/js-parser.c:2657 #13 0x56751b1d in jerry_parse jerryscript/jerry-core/api/jerry.c:448 #14 0x5674e72d in main jerryscript/jerry-main/main-unix.c:750 #15 0xf7745e80 in __libc_start_main (/lib/i386-linux-gnu/libc.so.6+0x18e80) #16 0x5662b130 (jerryscript/build_gcc_asan_es2015/bin/jerry+0x1a130) AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: ABRT (linux-gate.so.1+0x1078) ==3340==ABORTING ``` <sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [grammarinator](https://github.com/renatahodovan/grammarinator). </sup>
Assertion context_p->stack_depth == 0 in parser_parse_statements
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3713/comments
0
2020-05-04T18:12:14Z
2020-05-18T11:13:44Z
https://github.com/jerryscript-project/jerryscript/issues/3713
612,067,934
3,713
[ "jerryscript-project", "jerryscript" ]
###### JerryScript revision 6ff299c8 ###### Build platform Linux-4.15.0-88-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 ```javascript function f() {} if (function() { return f.bind()(0, 0, 0, 0, 0, 0, 0) }()); ``` ###### Output ```text ================================================================= ==37810==ERROR: AddressSanitizer: heap-buffer-overflow on address 0xf530077c at pc 0xf798990e bp 0xff919678 sp 0xff919248 WRITE of size 28 at 0xf530077c thread T0 #0 0xf798990d (/usr/lib32/libasan.so.4+0x7790d) #1 0x567782c2 in ecma_collection_append jerryscript/jerry-core/ecma/base/ecma-helpers-collection.c:182 #2 0x5671e7fa in ecma_op_function_call_bound jerryscript/jerry-core/ecma/operations/ecma-function-object.c:1006 #3 0x5671ebd3 in ecma_op_function_call jerryscript/jerry-core/ecma/operations/ecma-function-object.c:1071 #4 0x566e5e9c in opfunc_call.lto_priv.453 jerryscript/jerry-core/vm/vm.c:773 #5 0x566a7581 in vm_execute jerryscript/jerry-core/vm/vm.c:4095 #6 0x566a7af9 in vm_run jerryscript/jerry-core/vm/vm.c:4197 #7 0x5671e20f in ecma_op_function_call_simple jerryscript/jerry-core/ecma/operations/ecma-function-object.c:864 #8 0x5671eb9b in ecma_op_function_call jerryscript/jerry-core/ecma/operations/ecma-function-object.c:1063 #9 0x566e5e9c in opfunc_call.lto_priv.453 jerryscript/jerry-core/vm/vm.c:773 #10 0x566a7581 in vm_execute jerryscript/jerry-core/vm/vm.c:4095 #11 0x566a7af9 in vm_run jerryscript/jerry-core/vm/vm.c:4197 #12 0x566e44e8 in vm_run_global jerryscript/jerry-core/vm/vm.c:330 #13 0x56767bf2 in jerry_run jerryscript/jerry-core/api/jerry.c:596 #14 0x567641dc in main jerryscript/jerry-main/main-unix.c:759 #15 0xf7731e80 in __libc_start_main (/lib/i386-linux-gnu/libc.so.6+0x18e80) #16 0x566410c0 (jerryscript/build/bin/jerry+0x1a0c0) 0xf530077c is located 0 bytes to the right of 28-byte region [0xf5300760,0xf530077c) allocated by thread T0 here: #0 0xf79f7f54 in malloc (/usr/lib32/libasan.so.4+0xe5f54) #1 0x56702b75 in jmem_heap_alloc jerryscript/jerry-core/jmem/jmem-heap.c:254 #2 0x56702c53 in jmem_heap_gc_and_alloc_block jerryscript/jerry-core/jmem/jmem-heap.c:289 #3 0x56702ce5 in jmem_heap_alloc_block jerryscript/jerry-core/jmem/jmem-heap.c:323 #4 0x567774df in ecma_new_collection jerryscript/jerry-core/ecma/base/ecma-helpers-collection.c:43 #5 0x5671e7c2 in ecma_op_function_call_bound jerryscript/jerry-core/ecma/operations/ecma-function-object.c:1001 #6 0x5671ebd3 in ecma_op_function_call jerryscript/jerry-core/ecma/operations/ecma-function-object.c:1071 #7 0x566e5e9c in opfunc_call.lto_priv.453 jerryscript/jerry-core/vm/vm.c:773 #8 0x566a7581 in vm_execute jerryscript/jerry-core/vm/vm.c:4095 #9 0x566a7af9 in vm_run jerryscript/jerry-core/vm/vm.c:4197 #10 0x5671e20f in ecma_op_function_call_simple jerryscript/jerry-core/ecma/operations/ecma-function-object.c:864 #11 0x5671eb9b in ecma_op_function_call jerryscript/jerry-core/ecma/operations/ecma-function-object.c:1063 #12 0x566e5e9c in opfunc_call.lto_priv.453 jerryscript/jerry-core/vm/vm.c:773 #13 0x566a7581 in vm_execute jerryscript/jerry-core/vm/vm.c:4095 #14 0x566a7af9 in vm_run jerryscript/jerry-core/vm/vm.c:4197 #15 0x566e44e8 in vm_run_global jerryscript/jerry-core/vm/vm.c:330 #16 0x56767bf2 in jerry_run jerryscript/jerry-core/api/jerry.c:596 #17 0x567641dc in main jerryscript/jerry-main/main-unix.c:759 #18 0xf7731e80 in __libc_start_main (/lib/i386-linux-gnu/libc.so.6+0x18e80) SUMMARY: AddressSanitizer: heap-buffer-overflow (/usr/lib32/libasan.so.4+0x7790d) Shadow bytes around the buggy address: 0x3ea60090: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x3ea600a0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x3ea600b0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x3ea600c0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x3ea600d0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa =>0x3ea600e0: fa fa fa fa fa fa fa fa fa fa fa fa 00 00 00[04] 0x3ea600f0: fa fa 00 00 00 fa fa fa 00 00 00 04 fa fa 00 00 0x3ea60100: 00 fa fa fa 00 00 00 fa fa fa 00 00 00 fa fa fa 0x3ea60110: 00 00 00 fa fa fa 00 00 00 fa fa fa 00 00 00 fa 0x3ea60120: fa fa 00 00 00 02 fa fa 00 00 00 00 fa fa 00 00 0x3ea60130: 00 fa fa fa 00 00 00 fa fa fa 00 00 00 fa fa fa Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb ==37810==ABORTING ``` <sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [grammarinator](https://github.com/renatahodovan/grammarinator). </sup>
heap-buffer-overflow in ecma_collection_append
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3711/comments
0
2020-05-04T11:35:42Z
2020-05-07T14:11:15Z
https://github.com/jerryscript-project/jerryscript/issues/3711
611,806,127
3,711
[ "jerryscript-project", "jerryscript" ]
###### JerryScript revision 6ff299c8 ###### Build platform Linux-4.15.0-88-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 ```javascript var obj = { get source() { return Set }, [Symbol.match]: true } RegExp(obj) ``` ###### Output ```text ICE: Assertion 'JERRY_CONTEXT (jmem_heap_allocated_size) == 0' failed at jerryscript/jerry-core/jmem/jmem-heap.c(jmem_heap_finalize):107. Error: ERR_FAILED_INTERNAL_ASSERTION ASAN:DEADLYSIGNAL ================================================================= ==37754==ERROR: AddressSanitizer: ABRT on unknown address 0x0000937a (pc 0xf7f95079 bp 0xff9d8bec sp 0xff9d8bd0 T0) #0 0xf7f95078 (linux-gate.so.1+0x1078) #1 0xf7f95078 (linux-gate.so.1+0x1078) #2 0xf77bc831 in raise (/lib/i386-linux-gnu/libc.so.6+0x2d831) #3 0xf77bdcc0 in abort (/lib/i386-linux-gnu/libc.so.6+0x2ecc0) #4 0x56638ec3 in jerry_port_fatal jerryscript/jerry-port/default/default-fatal.c:30 #5 0x566ee88e in jerry_fatal jerryscript/jerry-core/jrt/jrt-fatals.c:63 #6 0x566ee8cf in jerry_assert_fail jerryscript/jerry-core/jrt/jrt-fatals.c:87 #7 0x566eda3e in jmem_heap_finalize jerryscript/jerry-core/jmem/jmem-heap.c:107 #8 0x566ed864 in jmem_finalize jerryscript/jerry-core/jmem/jmem-allocator.c:170 #9 0x56751ed7 in jerry_cleanup jerryscript/jerry-core/api/jerry.c:255 #10 0x5674fb63 in main jerryscript/jerry-main/main-unix.c:994 #11 0xf77a7e80 in __libc_start_main (/lib/i386-linux-gnu/libc.so.6+0x18e80) #12 0x5662c0c0 (jerryscript/build/bin/jerry+0x1a0c0) AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: ABRT (linux-gate.so.1+0x1078) ==37754==ABORTING ``` <sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [grammarinator](https://github.com/renatahodovan/grammarinator). </sup>
Assertion JERRY_CONTEXT (jmem_heap_allocated_size) == 0 in jmem_heap_finalize
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3710/comments
2
2020-05-04T11:31:37Z
2020-05-14T15:11:30Z
https://github.com/jerryscript-project/jerryscript/issues/3710
611,803,626
3,710
[ "jerryscript-project", "jerryscript" ]
I have a question about ToLength function. I analyzed usage of Array.prototype.Map and it resulted in wrong output for lengths bigger than **2<sup>32</sup>** ###### Test code: ```js function callbackfn(val, idx, obj) { print("Inside callback, idx:", idx); return val; } var obj = { 0: 5, 1: 13, length: "Infinity" }; var ret = Array.prototype.map.call(obj, callbackfn); print(ret) ``` ###### Output: ``` Inside callback, idx: 0 Inside callback, idx: 1 [application hangs] ``` ###### Expected output: ``` RangeError ``` Application hangs, because JerryScript parses **Infinity** to **2<sup>32</sup>-1** and in internal functions it is just passed as *unit_32t* variable. In [ES6 ToLength](http://www.ecma-international.org/ecma-262/6.0/#sec-tolength) function there is limit to **2<sup>53</sup> - 1** and it differs with [ES5.1 ToUint32](http://www.ecma-international.org/ecma-262/5.1/#sec-9.6) (which plays role of ToLength function). I see that in the JerryScript both implementations use limits equal to **UINT32_MAX**: [ecma-conversion.c:943](https://github.com/jerryscript-project/jerryscript/blob/1b1460e61fa468829984134c92761088d3cc8cbd/jerry-core/ecma/operations/ecma-conversion.c#L943). I noticed that the same difference occurs in [String.prototype.split](https://github.com/jerryscript-project/jerryscript/blob/1b1460e61fa468829984134c92761088d3cc8cbd/jerry-core/ecma/builtin-objects/ecma-builtin-string-prototype.c#L795) and [RegExp.prototype [ @@split ]](https://github.com/jerryscript-project/jerryscript/blob/1b1460e61fa468829984134c92761088d3cc8cbd/jerry-core/ecma/operations/ecma-regexp-object.c#L1826) Is there any specific reason why it is limited to 32 bits? Of course changing it would result in many modifications - because we would need to pass 64 bits variable in *ecma_op_to_length* function and change all uses. Maybe it is made on purpose - JerryScript aims to low memory devices - probably nobody would ever need that sizes of Arrays / Strings?
ToLength function uses different limits than stated in ES6 standard
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3691/comments
4
2020-04-22T12:43:48Z
2020-07-29T20:17:28Z
https://github.com/jerryscript-project/jerryscript/issues/3691
604,727,657
3,691
[ "jerryscript-project", "jerryscript" ]
#### JerryScript revision 76bbb088e91d36ee19349b06127eb0cbd5eea94f ###### Build platform ``` operating system: ubuntu18.04 ``` ###### Build steps ``` python tools/build.py --debug --logging=on --error-messages=on --line-info=on --jerry-debugger=on ``` ###### Test case ``` try { alphabetR = ['a']; var ZHeb = alphabetR.push(alphabetR); var WsfW = alphabetR.toLocaleString(); } catch (ex) { sputnikException = ex; } var successfullyParsed = true; ``` ###### Execution platform operating system: ubuntu18.04 ###### Execution steps ``` ./build/bin/jerry poc ``` ###### Backtrace ![image](https://user-images.githubusercontent.com/13704697/79128589-5e7dd680-7dd6-11ea-9785-53347f26bd33.png) ###### Expected behavior Aborted (core dumped) ###### vulnerability description After analysis, it is found that this is an assert. The key place for assert is in ![image](https://user-images.githubusercontent.com/13704697/79128857-c46a5e00-7dd6-11ea-842d-abf2968a67d1.png) Through the index, the conversion of the string is through the index, when encountering the object, the object will be found through the pointer. Because `alphabetR` pushed itself, creating a circular list, and then in `toLocaleString`, ![image](https://user-images.githubusercontent.com/13704697/79128889-d1874d00-7dd6-11ea-8724-abaa69c32682.png) Constantly looping to find its own object, causing the object to find a reference error, that is, `ERR_REF_COUNT_LIMIT`.
DOS attack
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3674/comments
3
2020-04-13T14:38:17Z
2020-04-20T14:05:15Z
https://github.com/jerryscript-project/jerryscript/issues/3674
598,926,559
3,674
[ "jerryscript-project", "jerryscript" ]
###### JerryScript revision 901e57c ###### Build platform Linux-4.15.0-88-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 ```javascript var obj = { get source() { return "Iam" }, [Symbol.match]: true } RegExp(obj) ``` ###### Output ```text ICE: Assertion 'ECMA_STRING_IS_REF_EQUALS_TO_ONE (string_p)' failed at jerryscript/jerry-core/ecma/base/ecma-literal-storage.c(ecma_free_string_list):75. Error: ERR_FAILED_INTERNAL_ASSERTION ``` ###### Backtrace ```text (gdb) 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 0x5657b5b7 in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at /home/reni/work/sut/jerryscript/jerry-port/default/default-fatal.c:30 #4 0x56639e87 in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at /home/reni/work/sut/jerryscript/jerry-core/jrt/jrt-fatals.c:63 #5 0x56639ec8 in jerry_assert_fail (assertion=0x56707f00 "ECMA_STRING_IS_REF_EQUALS_TO_ONE (string_p)", file=0x56707e80 "/home/reni/work/sut/jerryscript/jerry-core/ecma/base/ecma-literal-storage.c", function=0x566c4a80 <__func__.5687.lto_priv.780> "ecma_free_string_list", line=75) at /home/reni/work/sut/jerryscript/jerry-core/jrt/jrt-fatals.c:87 #6 0x56678a9e in ecma_free_string_list (string_list_cp=4124051312) at /home/reni/work/sut/jerryscript/jerry-core/ecma/base/ecma-literal-storage.c:75 #7 0x56678cd1 in ecma_finalize_lit_storage () at /home/reni/work/sut/jerryscript/jerry-core/ecma/base/ecma-literal-storage.c:121 #8 0x56677882 in ecma_finalize () at /home/reni/work/sut/jerryscript/jerry-core/ecma/base/ecma-init-finalize.c:92 #9 0x5669d4f3 in jerry_cleanup () at /home/reni/work/sut/jerryscript/jerry-core/api/jerry.c:239 #10 0x5669b422 in main (argc=2, argv=0xffffd1a4) at /home/reni/work/sut/jerryscript/jerry-main/main-unix.c:994 ``` <sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [grammarinator](https://github.com/renatahodovan/grammarinator). </sup>
Assertion ECMA_STRING_IS_REF_EQUALS_TO_ONE (string_p) in ecma_free_string_list
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3671/comments
1
2020-04-07T16:35:45Z
2020-05-14T15:11:54Z
https://github.com/jerryscript-project/jerryscript/issues/3671
596,002,568
3,671
[ "jerryscript-project", "jerryscript" ]
According to the ES5.1, `/^[\s]/` means a space character from the beginning of a string, and the `String.prototype.split` method divides a String into an ordered set of substrings. The division of the testcase is done by searching for the pattern `/^[\s]/`. And the output is different from other engines like V8, SpiderMonkey and javascriptCore. It maybe an issue of jerryscript. ###### JerryScript revision [996bf76](https://github.com/jerryscript-project/jerryscript/commit/996bf76f5956c65342c1726d3f629fbea41320ab) ###### Test case ``` var NISLFuzzingFunc=function(){ var dt = "a "; dt = dt.split(/^[\s]/); print("0:",dt[0]); print("1:",dt[1]); }; NISLFuzzingFunc(); ``` ###### Output ``` 0:a 1: ``` ###### Expected output ``` 0:a 1:undefined ```
an issue about String.prototype.split
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3669/comments
1
2020-04-07T10:49:17Z
2020-04-07T20:22:23Z
https://github.com/jerryscript-project/jerryscript/issues/3669
595,775,210
3,669
[ "jerryscript-project", "jerryscript" ]
First of all, when reporting a bug, give the issue a descriptive title. In the body of the issue, optionally give a free-form text description of the bug. Give the context necessary for others to understand the problem. Then, provide information necessary to reproduce the bug. Omit sections that are irrelevant for the bug report, but note that information like git revision, build platform, build command, and test case are required in almost all cases. ###### JerryScript revision Identify the git hash(es) or tag(s) where the issue was observed. ###### Build platform Name the build platform. E.g., copy the output of `echo "$(lsb_release -ds) ($(uname -mrs))"` (on Linux), `echo "$(sw_vers -productName) $(sw_vers -productVersion) ($(uname -mrs))"` (on macOS), or `python -c "import platform; print(platform.platform())"` (should work everywhere). ###### Build steps Describe how to build JerryScript. Give all the necessary details of the build (e.g., environment variables, command(s), profile, command line options, etc.). E.g.: ```sh tools/build.py --clean --debug ``` Or: ```sh mkdir build && cmake -H. -Bbuild && make -C build ``` Even if the bug was originally observed when JerryScript was integrated into a larger project, try to reproduce it with as few external code as possible, preferably by building the `jerry` command line tool. ###### Build log Copy the build log if the reported issue is a build problem. Do a verbose build if necessary. Try and trim the log to relevant parts. ###### Test case Give the JavaScript input that should be passed to the engine to trigger the bug. Try and post a reduced test case that is minimally necessary to reproduce the issue. As a rule of thumb, use Markdown's fenced code block syntax for the test case. Attach the file (renamed to .txt) if the test case contains 'problematic' bytes that cannot be copied in the bug report directly. ###### Execution platform Unnecessary if the same as the build platform. ###### Execution steps List the steps that trigger the bug. E.g., if a bug is snapshot-specific: ```sh build/bin/jerry-snapshot generate -o testcase.js.snapshot testcase.js build/bin/jerry --exec-snapshot testcase.js.snapshot ``` Unnecessary if trivial (i.e., `build/bin/jerry testcase.js`). ###### Output Copy relevant output from the standard output and/or error channels. ###### Backtrace In case of a crash (assertion failure, etc.), try to copy the backtrace from a debugger at the point of failure. ###### Expected behavior Describe what should happen instead of current behavior. Unnecessary if trivial (e.g., in case of a crash, the trivial expected behavior is not to crash).
split
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3668/comments
0
2020-04-07T10:19:28Z
2020-04-07T10:19:39Z
https://github.com/jerryscript-project/jerryscript/issues/3668
595,757,675
3,668
[ "jerryscript-project", "jerryscript" ]
###### JerryScript revision 28f2772 ###### Build platform Linux-4.15.0-88-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 ```javascript (function() { [Date[ReferenceError][String]] = [] })(function() {}) (function() {})( function() { [...{}] } ) ``` ###### Output ```text ICE: Assertion 'ecma_is_value_object (iterator)' failed at jerryscript/jerry-core/ecma/operations/ecma-iterator-object.c(ecma_op_iterator_next):246. Error: ERR_FAILED_INTERNAL_ASSERTION ``` ###### Backtrace ```text (gdb) 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 0x5657b557 in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-port/default/default-fatal.c:30 #4 0x5662eaa4 in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:63 #5 0x5662eae5 in jerry_assert_fail (assertion=0x566fe840 "ecma_is_value_object (iterator)", file=0x566fe5e0 "jerryscript/jerry-core/ecma/operations/ecma-iterator-object.c", function=0x566c6cc0 <__func__.6467.lto_priv.675> "ecma_op_iterator_next", line=246) at jerryscript/jerry-core/jrt/jrt-fatals.c:87 #6 0x5664c505 in ecma_op_iterator_next (iterator=72, value=8) at jerryscript/jerry-core/ecma/operations/ecma-iterator-object.c:246 #7 0x5664cb3a in ecma_op_iterator_step (iterator=72) at jerryscript/jerry-core/ecma/operations/ecma-iterator-object.c:509 #8 0x5661707a in vm_loop.lto_priv.458 (frame_ctx_p=0xffffcac0) at jerryscript/jerry-core/vm/vm.c:1801 #9 0x565d1ca7 in vm_execute (frame_ctx_p=0xffffcac0) at jerryscript/jerry-core/vm/vm.c:4042 #10 0x565d2283 in vm_run (bytecode_header_p=0xf5500e10, this_binding_value=4126149459, lex_env_p=0xf5d007b0, arg_list_p=0xffffcd30, arg_list_len=1) at jerryscript/jerry-core/vm/vm.c:4150 #11 0x56649d38 in ecma_op_function_call_simple (func_obj_p=0xf5f00820, this_arg_value=72, arguments_list_p=0xffffcd30, arguments_list_len=1) at jerryscript/jerry-core/ecma/operations/ecma-function-object.c:854 #12 0x5664a6b5 in ecma_op_function_call (func_obj_p=0xf5f00820, this_arg_value=72, arguments_list_p=0xffffcd30, arguments_list_len=1) at jerryscript/jerry-core/ecma/operations/ecma-function-object.c:1053 #13 0x5661120f in opfunc_call.lto_priv.457 (frame_ctx_p=0xffffcd00) at jerryscript/jerry-core/vm/vm.c:773 #14 0x565d1d0b in vm_execute (frame_ctx_p=0xffffcd00) at jerryscript/jerry-core/vm/vm.c:4048 #15 0x565d2283 in vm_run (bytecode_header_p=0xf5500dd0, this_binding_value=4126149459, lex_env_p=0xf5d007b0, arg_list_p=0x0, arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:4150 #16 0x5660f85b in vm_run_global (bytecode_p=0xf5500dd0) at jerryscript/jerry-core/vm/vm.c:330 #17 0x5669197e in jerry_run (func_val=4126148691) at jerryscript/jerry-core/api/jerry.c:596 #18 0x5668df68 in main (argc=2, argv=0xffffd1c4) at jerryscript/jerry-main/main-unix.c:759 ``` <sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [grammarinator](https://github.com/renatahodovan/grammarinator). </sup>
Assertion ecma_is_value_object (iterator) in ecma_op_iterator_next
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3665/comments
1
2020-04-02T16:49:09Z
2020-04-20T17:32:59Z
https://github.com/jerryscript-project/jerryscript/issues/3665
592,775,181
3,665
[ "jerryscript-project", "jerryscript" ]
According to Standard ECMA-262(from ES3 to ES10), when running this testcase blow, undefined should be converted to the global object in line 3 and line5, but jerry didn't do that in line 5 and threw a TypeError: Argument cannot be converted to an object. ###### JerryScript revision [996bf76](https://github.com/jerryscript-project/jerryscript/commit/996bf76f5956c65342c1726d3f629fbea41320ab) ###### Build platform Ubuntu 16.04.6 LTS (Linux 4.15.0-55-generic x86_64) ###### Build steps python tools/build.py --clean --debug --logging=on --line-info=on --error-messages=on --cpointer-32bit=on --mem-heap=1572864 --profile=es2015-subset ###### Test case ``` var f = function() { print(typeof Object.prototype.isPrototypeOf); var a = Object.prototype.isPrototypeOf.call(undefined); print("a:", a); var b = Object.prototype.isPrototypeOf.call(undefined, []); print("b:", b); }; f(); ``` ###### Execution steps build/bin/jerry testcase.js ###### Output ``` function a: false Exception backtrace: 0: test case.js:5 1: test case.js:8 Script Error: TypeError: Argument cannot be converted to an object. ``` ###### Expected behavior ``` function a: false b: false ```
An issue about function.prototype.call
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3664/comments
7
2020-04-02T15:04:32Z
2020-04-03T14:33:35Z
https://github.com/jerryscript-project/jerryscript/issues/3664
592,703,143
3,664
[ "jerryscript-project", "jerryscript" ]
When printing `this`, most engines output `[object global]`, such as v8, spiderMonkey, chakra, etc., but the output of jerry is `[object Object]`. Why does it happen? ###### JerryScript revision [996bf76](https://github.com/jerryscript-project/jerryscript/commit/996bf76f5956c65342c1726d3f629fbea41320ab) ###### Build platform Ubuntu 16.04.6 LTS (Linux 4.15.0-55-generic x86_64) ###### Build steps python tools/build.py --clean --debug --logging=on --line-info=on --error-messages=on --cpointer-32bit=on --mem-heap=1572864 --profile=es2015-subset ###### Test case ``` var f = function() { print(this); }; f(); ``` ###### Execution steps build/bin/jerry testcase.js ###### Output ``` [object Object] ``` ###### Expected behavior ``` [object global] ```
A question about this
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3661/comments
2
2020-04-01T12:30:39Z
2020-04-03T23:45:07Z
https://github.com/jerryscript-project/jerryscript/issues/3661
591,878,903
3,661
[ "jerryscript-project", "jerryscript" ]
###### JerryScript revision c237ba60 ###### Build platform Linux-4.15.0-88-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 ```javascript function g({ ["y"]: { a } }) { { function a() {} } } ``` ###### Output ```text ICE: Assertion 'literal_p->type == LEXER_UNUSED_LITERAL && literal_p->status_flags == LEXER_FLAG_FUNCTION_ARGUMENT' failed at jerryscript/jerry-core/parser/js/js-parser.c(parser_compute_indicies):183. Error: ERR_FAILED_INTERNAL_ASSERTION ``` ###### Backtrace ```text (gdb) 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 0x5657b4c8 in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-port/default/default-fatal.c:30 #4 0x5662ea8d in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:63 #5 0x5662eace in jerry_assert_fail (assertion=0x566fc080 "literal_p->type == LEXER_UNUSED_LITERAL && literal_p->status_flags == LEXER_FLAG_FUNCTION_ARGUMENT", file=0x566fbee0 "jerryscript/jerry-core/parser/js/js-parser.c", function=0x566d0460 <__func__.5690.lto_priv.41> "parser_compute_indicies", line=183) at jerryscript/jerry-core/jrt/jrt-fatals.c:87 #6 0x56634f8b in parser_compute_indicies (context_p=0xffffcaf0, ident_end=0xffffc500, const_literal_end=0xffffc4c0) at jerryscript/jerry-core/parser/js/js-parser.c:182 #7 0x56636679 in parser_post_processing (context_p=0xffffcaf0) at jerryscript/jerry-core/parser/js/js-parser.c:949 #8 0x5663f9b3 in parser_parse_function (context_p=0xffffcaf0, status_flags=6) at jerryscript/jerry-core/parser/js/js-parser.c:2380 #9 0x5659fd5b in parser_parse_function_statement (context_p=0xffffcaf0) at jerryscript/jerry-core/parser/js/js-parser-statm.c:766 #10 0x565aa4cc in parser_parse_statements (context_p=0xffffcaf0) at jerryscript/jerry-core/parser/js/js-parser-statm.c:2770 #11 0x5663d157 in parser_parse_source (arg_list_p=0x0, arg_list_size=0, source_p=0x56743760 <buffer.lto_priv> "function g({\n [\"y\"]: {\n a\n }\n})\n{\n {\n function a() {}\n }\n}\n", source_size=71, parse_opts=0, error_location_p=0xffffcd20) at jerryscript/jerry-core/parser/js/js-parser.c:2096 #12 0x5664065f in parser_parse_script (arg_list_p=0x0, arg_list_size=0, source_p=0x56743760 <buffer.lto_priv> "function g({\n [\"y\"]: {\n a\n }\n})\n{\n {\n function a() {}\n }\n}\n", source_size=71, parse_opts=0, bytecode_data_p=0xffffcde0) at jerryscript/jerry-core/parser/js/js-parser.c:2605 #13 0x566912de in jerry_parse (resource_name_p=0xffffd391 "test.js", resource_name_length=7, source_p=0x56743760 <buffer.lto_priv> "function g({\n [\"y\"]: {\n a\n }\n})\n{\n {\n function a() {}\n }\n}\n", source_size=71, parse_opts=0) at jerryscript/jerry-core/api/jerry.c:448 #14 0x5668dee4 in main (argc=2, argv=0xffffd1d4) at jerryscript/jerry-main/main-unix.c:744 ``` <sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [grammarinator](https://github.com/renatahodovan/grammarinator). </sup>
Assertion literal_p->type == LEXER_UNUSED_LITERAL && literal_p->status_flags == LEXER_FLAG_FUNCTION_ARGUMENT in parser_compute_indicies
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3658/comments
0
2020-03-29T22:02:57Z
2020-04-21T09:59:31Z
https://github.com/jerryscript-project/jerryscript/issues/3658
589,896,293
3,658
[ "jerryscript-project", "jerryscript" ]
###### JerryScript revision c237ba6 ###### Build platform Linux-4.15.0-88-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 ```javascript $ => $++ [ ] ``` ###### Output ```text ICE: Assertion 'context.status_flags & PARSER_SCANNING_SUCCESSFUL' failed at jerryscript/jerry-core/parser/js/js-parser.c(parser_parse_source):2111. Error: ERR_FAILED_INTERNAL_ASSERTION ``` ###### Backtrace ```text (gdb) 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 0x5657b4c8 in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-port/default/default-fatal.c:30 #4 0x5662ea8d in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:63 #5 0x5662eace in jerry_assert_fail (assertion=0x566fcc40 "context.status_flags & PARSER_SCANNING_SUCCESSFUL", file=0x566fbee0 "jerryscript/jerry-core/parser/js/js-parser.c", function=0x566d05e0 <__func__.5893.lto_priv.502> "parser_parse_source", line=2111) at jerryscript/jerry-core/jrt/jrt-fatals.c:87 #6 0x5663d5bd in parser_parse_source (arg_list_p=0x0, arg_list_size=0, source_p=0x56743760 <buffer.lto_priv> "$ => $++\n[ ]\n", source_size=13, parse_opts=0, error_location_p=0xffffcd20) at jerryscript/jerry-core/parser/js/js-parser.c:2111 #7 0x5664065f in parser_parse_script (arg_list_p=0x0, arg_list_size=0, source_p=0x56743760 <buffer.lto_priv> "$ => $++\n[ ]\n", source_size=13, parse_opts=0, bytecode_data_p=0xffffcde0) at jerryscript/jerry-core/parser/js/js-parser.c:2605 #8 0x566912de in jerry_parse (resource_name_p=0xffffd391 "test.js", resource_name_length=7, source_p=0x56743760 <buffer.lto_priv> "$ => $++\n[ ]\n", source_size=13, parse_opts=0) at jerryscript/jerry-core/api/jerry.c:448 #9 0x5668dee4 in main (argc=2, argv=0xffffd1d4) at jerryscript/jerry-main/main-unix.c:744 ``` <sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [grammarinator](https://github.com/renatahodovan/grammarinator). </sup>
Assertion context.status_flags & PARSER_SCANNING_SUCCESSFUL in parser_parse_source
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3656/comments
0
2020-03-29T14:47:42Z
2020-04-21T09:25:37Z
https://github.com/jerryscript-project/jerryscript/issues/3656
589,808,522
3,656
[ "jerryscript-project", "jerryscript" ]
###### JerryScript revision 3c7a776c ###### Build platform Linux-4.15.0-88-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 ```javascript for (let i of id_36()) function testcase() { testcase ``` ###### Output ```text ICE: Assertion 'literal_index < PARSER_REGISTER_START || !has_context' failed at jerryscript/jerry-core/parser/js/js-parser-statm.c(parser_parse_for_statement_start):1317. Error: ERR_FAILED_INTERNAL_ASSERTION ``` ###### Backtrace ```text (gdb) 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 0x5657b43d in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-port/default/default-fatal.c:30 #4 0x5662e775 in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:63 #5 0x5662e7b6 in jerry_assert_fail (assertion=0x566e9f00 "literal_index < PARSER_REGISTER_START || !has_context", file=0x566e93a0 "jerryscript/jerry-core/parser/js/js-parser-statm.c", function=0x566d8fc0 <__func__.5874.lto_priv.28> "parser_parse_for_statement_start", line=1317) at jerryscript/jerry-core/jrt/jrt-fatals.c:87 #6 0x565a323a in parser_parse_for_statement_start (context_p=0xffffcaf0) at jerryscript/jerry-core/parser/js/js-parser-statm.c:1317 #7 0x565aa6ea in parser_parse_statements (context_p=0xffffcaf0) at jerryscript/jerry-core/parser/js/js-parser-statm.c:2812 #8 0x5663ce3f in parser_parse_source (arg_list_p=0x0, arg_list_size=0, source_p=0x567436c0 <buffer.lto_priv> "for (let i of id_36())\n\nfunction testcase() {\n testcase\n", source_size=59, parse_opts=0, error_location_p=0xffffcd20) at jerryscript/jerry-core/parser/js/js-parser.c:2096 #9 0x56640347 in parser_parse_script (arg_list_p=0x0, arg_list_size=0, source_p=0x567436c0 <buffer.lto_priv> "for (let i of id_36())\n\nfunction testcase() {\n testcase\n", source_size=59, parse_opts=0, bytecode_data_p=0xffffcde0) at jerryscript/jerry-core/parser/js/js-parser.c:2605 #10 0x56690c81 in jerry_parse (resource_name_p=0xffffd391 "test.js", resource_name_length=7, source_p=0x567436c0 <buffer.lto_priv> "for (let i of id_36())\n\nfunction testcase() {\n testcase\n", source_size=59, parse_opts=0) at jerryscript/jerry-core/api/jerry.c:448 #11 0x5668d887 in main (argc=2, argv=0xffffd1d4) at jerryscript/jerry-main/main-unix.c:744 ``` <sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [grammarinator](https://github.com/renatahodovan/grammarinator). </sup>
Assertion literal_index < PARSER_REGISTER_START || !has_context in parser_parse_for_statement_start
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3655/comments
0
2020-03-28T14:02:55Z
2020-04-21T10:00:40Z
https://github.com/jerryscript-project/jerryscript/issues/3655
589,583,157
3,655
[ "jerryscript-project", "jerryscript" ]
When running this test case blow, jerry threw an exception in line 5. Why does this happen?Is it a bug of jerry? ###### JerryScript revision [996bf76](https://github.com/jerryscript-project/jerryscript/commit/996bf76f5956c65342c1726d3f629fbea41320ab) ###### Build platform Ubuntu 16.04.6 LTS (Linux 4.15.0-55-generic x86_64) ###### Build steps python tools/build.py --clean --debug --logging=on --line-info=on --error-messages=on --cpointer-32bit=on --mem-heap=1572864 --profile=es2015-subset ###### Test case ``` var NISLFuzzingFunc = function(u) { print([u = u-1, this]); print([this, 1]); print([1, u = u-1]); print([this, u = u-1]); }; var NISLParameter0 = 2; NISLFuzzingFunc(NISLParameter0); ``` ###### Execution steps build/bin/jerry testcase.js ###### Output ``` 1, [object Object] [object Object], 1 1, 0 Exception backtrace: 0: testcase.js:5 1: testcase.js:8 Script Error: ReferenceError: Undefined reference. ``` ###### Expected behavior ``` 1, [object Object] [object Object], 1 1, 0 [object Object], -1 ```
A question about creating arrays.
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3650/comments
1
2020-03-27T13:58:24Z
2020-03-27T20:20:38Z
https://github.com/jerryscript-project/jerryscript/issues/3650
589,152,617
3,650
[ "jerryscript-project", "jerryscript" ]
###### JerryScript revision 3c7a776c ###### Build platform Linux-4.15.0-88-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 ```javascript Array.prototype.sort.call(unescape) ``` ###### Output ```text ICE: Assertion 'index != ECMA_STRING_NOT_ARRAY_INDEX' failed at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype.c(ecma_builtin_array_prototype_object_sort):1106. Error: ERR_FAILED_INTERNAL_ASSERTION ``` ###### Backtrace ```text (gdb) 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 0x5657b43d in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-port/default/default-fatal.c:30 #4 0x5662e775 in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:63 #5 0x5662e7b6 in jerry_assert_fail (assertion=0x566f0a80 "index != ECMA_STRING_NOT_ARRAY_INDEX", file=0x566f06a0 "jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype.c", function=0x566d1860 <__func__.6105.lto_priv.134> "ecma_builtin_array_prototype_object_sort", line=1106) at jerryscript/jerry-core/jrt/jrt-fatals.c:87 #6 0x565e078c in ecma_builtin_array_prototype_object_sort (this_arg=4126148451, arg1=72, obj_p=0xf5f00760, len=1) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype.c:1106 #7 0x565e5776 in ecma_builtin_array_prototype_dispatch_routine (builtin_routine_id=91, this_arg=4126148451, arguments_list_p=0xffffc850, arguments_number=0) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype.c:2658 #8 0x56671f9e in ecma_builtin_dispatch_routine (func_obj_p=0xf5f00820, this_arg_value=4126148451, arguments_list_p=0xffffc850, arguments_list_len=0) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.c:1080 #9 0x56672176 in ecma_builtin_dispatch_call (obj_p=0xf5f00820, this_arg_value=4126148451, arguments_list_p=0xffffca84, arguments_list_len=0) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.c:1104 #10 0x566499c8 in ecma_op_function_call_simple (func_obj_p=0xf5f00820, this_arg_value=4126148451, arguments_list_p=0xffffca84, arguments_list_len=0) at jerryscript/jerry-core/ecma/operations/ecma-function-object.c:750 #11 0x5664a889 in ecma_op_function_call (func_obj_p=0xf5f00820, this_arg_value=4126148451, arguments_list_p=0xffffca84, arguments_list_len=0) at jerryscript/jerry-core/ecma/operations/ecma-function-object.c:1053 #12 0x565ecae4 in ecma_builtin_function_prototype_object_call (func_obj_p=0xf5f00820, arguments_list_p=0xffffca80, arguments_number=1) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-function-prototype.c:191 #13 0x565ed12d in ecma_builtin_function_prototype_dispatch_routine (builtin_routine_id=83, this_arg=4126148643, arguments_list_p=0xffffca80, arguments_number=1) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-function-prototype.c:377 #14 0x56671f9e in ecma_builtin_dispatch_routine (func_obj_p=0xf5f007c0, this_arg_value=4126148643, arguments_list_p=0xffffca80, arguments_list_len=1) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.c:1080 #15 0x56672176 in ecma_builtin_dispatch_call (obj_p=0xf5f007c0, this_arg_value=4126148643, arguments_list_p=0xffffcce8, arguments_list_len=1) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.c:1104 #16 0x566499c8 in ecma_op_function_call_simple (func_obj_p=0xf5f007c0, this_arg_value=4126148643, arguments_list_p=0xffffcce8, arguments_list_len=1) at jerryscript/jerry-core/ecma/operations/ecma-function-object.c:750 #17 0x5664a889 in ecma_op_function_call (func_obj_p=0xf5f007c0, this_arg_value=4126148643, arguments_list_p=0xffffcce8, arguments_list_len=1) at jerryscript/jerry-core/ecma/operations/ecma-function-object.c:1053 #18 0x56610fa9 in opfunc_call.lto_priv.457 (frame_ctx_p=0xffffccb0) at jerryscript/jerry-core/vm/vm.c:763 #19 0x565d1e61 in vm_execute (frame_ctx_p=0xffffccb0) at jerryscript/jerry-core/vm/vm.c:4031 #20 0x565d23d9 in vm_run (bytecode_header_p=0xf6301580, this_binding_value=4126149459, lex_env_p=0xf5d007b0, arg_list_p=0x0, arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:4133 #21 0x5660f5f5 in vm_run_global (bytecode_p=0xf6301580) at jerryscript/jerry-core/vm/vm.c:320 #22 0x566912f0 in jerry_run (func_val=4126148883) at jerryscript/jerry-core/api/jerry.c:596 #23 0x5668d8d0 in main (argc=2, argv=0xffffd174) at jerryscript/jerry-main/main-unix.c:753 ``` <sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [grammarinator](https://github.com/renatahodovan/grammarinator). </sup>
Assertion index != ECMA_STRING_NOT_ARRAY_INDEX in ecma_builtin_array_prototype_object_sort
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3648/comments
0
2020-03-27T12:28:17Z
2020-04-15T13:21:07Z
https://github.com/jerryscript-project/jerryscript/issues/3648
589,099,893
3,648
[ "jerryscript-project", "jerryscript" ]
###### JerryScript revision 655110ad ###### Build platform Linux-4.15.0-88-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 ```javascript switch (g) { case f(): let g; function f() { eval('function g({["y"]: []}) {}; g({xy: {}})') } } switch (g) { case f: function f() {} case g(): function g() {} } ``` ###### Output ```text ICE: Assertion 'object_p->type_flags_refs >= ECMA_OBJECT_REF_ONE' failed at jerryscript/jerry-core/ecma/base/ecma-gc.c(ecma_deref_object):149. Error: ERR_FAILED_INTERNAL_ASSERTION ``` ###### Backtrace ```text (gdb) 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 0x5657b570 in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-port/default/default-fatal.c:30 #4 0x56630061 in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:63 #5 0x566300a2 in jerry_assert_fail (assertion=0x567091a0 "object_p->type_flags_refs >= ECMA_OBJECT_REF_ONE", file=0x56709140 "jerryscript/jerry-core/ecma/base/ecma-gc.c", function=0x566bfe60 <__func__.6504.lto_priv.910> "ecma_deref_object", line=149) at jerryscript/jerry-core/jrt/jrt-fatals.c:87 #6 0x5669c63c in ecma_deref_object (object_p=0xf5f00490) at jerryscript/jerry-core/ecma/base/ecma-gc.c:149 #7 0x566b45bd in ecma_free_value (value=4126147731) at jerryscript/jerry-core/ecma/base/ecma-helpers-value.c:1047 #8 0x566b4647 in ecma_fast_free_value (value=4126147731) at jerryscript/jerry-core/ecma/base/ecma-helpers-value.c:1076 #9 0x5662397c in vm_loop.lto_priv.447 (frame_ctx_p=0xffffc460) at jerryscript/jerry-core/vm/vm.c:3773 #10 0x565d233f in vm_execute (frame_ctx_p=0xffffc460) at jerryscript/jerry-core/vm/vm.c:4028 #11 0x565d291b in vm_run (bytecode_header_p=0xf5500cd0, this_binding_value=4126149459, lex_env_p=0xf5d003f0, arg_list_p=0x1, arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:4136 #12 0x5661113f in vm_run_eval (bytecode_data_p=0xf5500cd0, parse_opts=140) at jerryscript/jerry-core/vm/vm.c:393 #13 0x56648ccf in ecma_op_eval_chars_buffer (code_p=0xf630152c "function g({[\"y\"]: []}) {}; g({xy: {}})", code_buffer_size=39, parse_opts=140) at jerryscript/jerry-core/ecma/operations/ecma-eval.c:123 #14 0x56648945 in ecma_op_eval (code_p=0xf6301520, parse_opts=8) at jerryscript/jerry-core/ecma/operations/ecma-eval.c:58 #15 0x565ee3a2 in ecma_builtin_global_object_eval (x=4130346273) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-global.c:111 #16 0x565f1b65 in ecma_builtin_global_dispatch_routine (builtin_routine_id=84, this_arg=72, arguments_list_p=0xffffc8e0, arguments_number=1) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-global.c:1162 #17 0x56673125 in ecma_builtin_dispatch_routine (func_obj_p=0xf5f004f0, this_arg_value=72, arguments_list_p=0xffffc8e0, arguments_list_len=1) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.c:1056 #18 0x566732fd in ecma_builtin_dispatch_call (obj_p=0xf5f004f0, this_arg_value=72, arguments_list_p=0xffffcb40, arguments_list_len=1) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.c:1080 #19 0x5664b306 in ecma_op_function_call_simple (func_obj_p=0xf5f004f0, this_arg_value=72, arguments_list_p=0xffffcb40, arguments_list_len=1) at jerryscript/jerry-core/ecma/operations/ecma-function-object.c:751 #20 0x5664c218 in ecma_op_function_call (func_obj_p=0xf5f004f0, this_arg_value=72, arguments_list_p=0xffffcb40, arguments_list_len=1) at jerryscript/jerry-core/ecma/operations/ecma-function-object.c:1054 #21 0x56612842 in opfunc_call.lto_priv.446 (frame_ctx_p=0xffffcb10) at jerryscript/jerry-core/vm/vm.c:765 #22 0x565d23a3 in vm_execute (frame_ctx_p=0xffffcb10) at jerryscript/jerry-core/vm/vm.c:4034 #23 0x565d291b in vm_run (bytecode_header_p=0xf5500dd0, this_binding_value=4126149459, lex_env_p=0xf5d00550, arg_list_p=0xffffcd80, arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:4136 #24 0x5664b89b in ecma_op_function_call_simple (func_obj_p=0xf5f00700, this_arg_value=72, arguments_list_p=0xffffcd80, arguments_list_len=0) at jerryscript/jerry-core/ecma/operations/ecma-function-object.c:855 #25 0x5664c218 in ecma_op_function_call (func_obj_p=0xf5f00700, this_arg_value=72, arguments_list_p=0xffffcd80, arguments_list_len=0) at jerryscript/jerry-core/ecma/operations/ecma-function-object.c:1054 #26 0x56612842 in opfunc_call.lto_priv.446 (frame_ctx_p=0xffffcd40) at jerryscript/jerry-core/vm/vm.c:765 #27 0x565d23a3 in vm_execute (frame_ctx_p=0xffffcd40) at jerryscript/jerry-core/vm/vm.c:4034 #28 0x565d291b in vm_run (bytecode_header_p=0xf5102a30, this_binding_value=4126149459, lex_env_p=0xf5d007b0, arg_list_p=0x0, arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:4136 #29 0x56610e9b in vm_run_global (bytecode_p=0xf5102a30) at jerryscript/jerry-core/vm/vm.c:320 #30 0x5669246e in jerry_run (func_val=4126148451) at jerryscript/jerry-core/api/jerry.c:595 #31 0x5668ea70 in main (argc=2, argv=0xffffd1d4) at jerryscript/jerry-main/main-unix.c:748 ``` <sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [grammarinator](https://github.com/renatahodovan/grammarinator). </sup>
Assertion object_p->type_flags_refs >= ECMA_OBJECT_REF_ONE in ecma_deref_object
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3647/comments
1
2020-03-26T15:26:28Z
2020-04-15T16:08:58Z
https://github.com/jerryscript-project/jerryscript/issues/3647
588,507,383
3,647
[ "jerryscript-project", "jerryscript" ]
According to the description of `Array.prototype.lastIndexOf` in ES5.1 and ES6, when `fromIndex` is greater than or equal to the length of array, the whole array will be searched. But the output shows that the element can not be found. ###### JerryScript revision [996bf76](https://github.com/jerryscript-project/jerryscript/commit/996bf76f5956c65342c1726d3f629fbea41320ab) ###### Test case ``` var NISLFuzzingFunc = function(){ return [1].lastIndexOf(1, 1); }; var NISLCallingResult = NISLFuzzingFunc(); print(NISLCallingResult); ``` ###### Output `-1` ###### Expected Output `0`
An issue about Array.prototype.lastIndexOf
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3646/comments
2
2020-03-26T14:10:40Z
2020-03-26T18:53:42Z
https://github.com/jerryscript-project/jerryscript/issues/3646
588,450,581
3,646
[ "jerryscript-project", "jerryscript" ]
###### JerryScript revision 655110ad ###### Build platform Linux-4.15.0-88-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 ```javascript eval = class extends SyntaxError { constructor() { super() } } eval() ``` ###### Output ```text ICE: Assertion '(uint_ptr & ECMA_VALUE_TYPE_MASK) == 0' failed at jerryscript/jerry-core/ecma/base/ecma-helpers-value.c(ecma_pointer_to_ecma_value):87. Error: ERR_FAILED_INTERNAL_ASSERTION ``` ###### Backtrace ```text (gdb) 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 0x5657b560 in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-port/default/default-fatal.c:30 #4 0x56630051 in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:63 #5 0x56630092 in jerry_assert_fail (assertion=0x5670be40 "(uint_ptr & ECMA_VALUE_TYPE_MASK) == 0", file=0x5670bbc0 "jerryscript/jerry-core/ecma/base/ecma-helpers-value.c", function=0x566c12a0 <__func__.4412.lto_priv.828> "ecma_pointer_to_ecma_value", line=87) at jerryscript/jerry-core/jrt/jrt-fatals.c:87 #6 0x566b26a8 in ecma_pointer_to_ecma_value () at jerryscript/jerry-core/ecma/base/ecma-helpers-value.c:87 #7 ecma_make_object_value (object_p=0x1) at jerryscript/jerry-core/ecma/base/ecma-helpers-value.c:635 #8 0x56657481 in ecma_op_object_get (object_p=0x1, property_name_p=0x1c8d) at jerryscript/jerry-core/ecma/operations/ecma-objects.c:799 #9 ecma_op_object_get_by_magic_id () at jerryscript/jerry-core/ecma/operations/ecma-objects.c:925 #10 0x5661197b in vm_super_call.lto_priv.447 (frame_ctx_p=0xffffca80) at jerryscript/jerry-core/vm/vm.c:572 #11 0x565d23a3 in vm_execute (frame_ctx_p=0xffffca80) at jerryscript/jerry-core/vm/vm.c:4040 #12 0x565d290b in vm_run (bytecode_header_p=0xf5f00910, this_binding_value=72, lex_env_p=0xf5d00650, arg_list_p=0xffffcce0, arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:4136 #13 0x5664b88b in ecma_op_function_call_simple (func_obj_p=0xf5f00850, this_arg_value=72, arguments_list_p=0xffffcce0, arguments_list_len=0) at jerryscript/jerry-core/ecma/operations/ecma-function-object.c:855 #14 0x5664c208 in ecma_op_function_call (func_obj_p=0xf5f00850, this_arg_value=72, arguments_list_p=0xffffcce0, arguments_list_len=0) at jerryscript/jerry-core/ecma/operations/ecma-function-object.c:1054 #15 0x56612832 in opfunc_call.lto_priv.448 (frame_ctx_p=0xffffccb0) at jerryscript/jerry-core/vm/vm.c:765 #16 0x565d2393 in vm_execute (frame_ctx_p=0xffffccb0) at jerryscript/jerry-core/vm/vm.c:4034 #17 0x565d290b in vm_run (bytecode_header_p=0xf5500ed0, this_binding_value=4126149459, lex_env_p=0xf5d007b0, arg_list_p=0x0, arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:4136 #18 0x56610e8b in vm_run_global (bytecode_p=0xf5500ed0) at jerryscript/jerry-core/vm/vm.c:320 #19 0x566920be in jerry_run (func_val=4126148835) at jerryscript/jerry-core/api/jerry.c:595 #20 0x5668e6c0 in main (argc=2, argv=0xffffd134) at jerryscript/jerry-main/main-unix.c:748 ``` <sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [grammarinator](https://github.com/renatahodovan/grammarinator). </sup>
Assertion (uint_ptr & ECMA_VALUE_TYPE_MASK) == 0 in ecma_pointer_to_ecma_value
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3641/comments
0
2020-03-25T20:31:45Z
2020-03-27T10:21:51Z
https://github.com/jerryscript-project/jerryscript/issues/3641
587,972,447
3,641
[ "jerryscript-project", "jerryscript" ]
###### JerryScript revision 5b6d4f39 ###### Build platform Linux-4.15.0-88-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 ```javascript var B = class {} eval = class extends B {} Infinity = class extends Object { constructor() { super() } } eval() ``` ###### Output ```text ICE: Assertion 'JERRY_CONTEXT (current_new_target) != JERRY_CONTEXT_INVALID_NEW_TARGET' failed at jerryscript/jerry-core/vm/opcodes.c(ecma_op_implicit_constructor_handler_heritage_cb):806. Error: ERR_FAILED_INTERNAL_ASSERTION ``` ###### Backtrace ```text (gdb) 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 0x5657b560 in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-port/default/default-fatal.c:30 #4 0x56630051 in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:63 #5 0x56630092 in jerry_assert_fail (assertion=0x566dcae0 "JERRY_CONTEXT (current_new_target) != JERRY_CONTEXT_INVALID_NEW_TARGET", file=0x566dc2a0 "jerryscript/jerry-core/vm/opcodes.c", function=0x566dd240 <__func__.6879> "ecma_op_implicit_constructor_handler_heritage_cb", line=806) at jerryscript/jerry-core/jrt/jrt-fatals.c:87 #6 0x565785f5 in ecma_op_implicit_constructor_handler_heritage_cb (function_obj=4126148595, this_val=72, args_p=0xffffcd50, args_count=0) at jerryscript/jerry-core/vm/opcodes.c:806 #7 0x5664badb in ecma_op_function_call_external (func_obj_p=0xf5f007f0, this_arg_value=72, arguments_list_p=0xffffcd50, arguments_list_len=0) at jerryscript/jerry-core/ecma/operations/ecma-function-object.c:912 #8 0x5664c227 in ecma_op_function_call (func_obj_p=0xf5f007f0, this_arg_value=72, arguments_list_p=0xffffcd50, arguments_list_len=0) at jerryscript/jerry-core/ecma/operations/ecma-function-object.c:1058 #9 0x56612832 in opfunc_call.lto_priv.448 (frame_ctx_p=0xffffcd20) at jerryscript/jerry-core/vm/vm.c:765 #10 0x565d2393 in vm_execute (frame_ctx_p=0xffffcd20) at jerryscript/jerry-core/vm/vm.c:4034 #11 0x565d290b in vm_run (bytecode_header_p=0xf5101ea0, this_binding_value=4126149459, lex_env_p=0xf5d007b0, arg_list_p=0x0, arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:4136 #12 0x56610e8b in vm_run_global (bytecode_p=0xf5101ea0) at jerryscript/jerry-core/vm/vm.c:320 #13 0x566920be in jerry_run (func_val=4126148835) at jerryscript/jerry-core/api/jerry.c:595 #14 0x5668e6c0 in main (argc=2, argv=0xffffd1a4) at jerryscript/jerry-main/main-unix.c:748 ``` <sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [grammarinator](https://github.com/renatahodovan/grammarinator). </sup>
Assertion JERRY_CONTEXT (current_new_target) != JERRY_CONTEXT_INVALID_NEW_TARGET in ecma_op_implicit_constructor_handler_heritage_cb
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3640/comments
0
2020-03-24T20:47:28Z
2020-03-27T10:21:51Z
https://github.com/jerryscript-project/jerryscript/issues/3640
587,269,250
3,640
[ "jerryscript-project", "jerryscript" ]
###### JerryScript revision `655110a` commit ###### Build steps ```sh python tools/build.py --clean --compile-flag=-fsanitize=address ``` ###### Test case ``` a = [] for(var i=0; i<100; i++) a.push(i) a.slice(0, {valueOf: function(){a.length=0; return 100;}}) ``` ###### Output ``` ==34465==ERROR: AddressSanitizer: SEGV on unknown address 0x000173d7b4e0 (pc 0x00010e47486f bp 0x7ffee179a130 sp 0x7ffee179a130 T0) ==34465==The signal is caused by a READ memory access. #0 0x10e47486e in ecma_ref_ecma_string (jerry:x86_64+0x10000f86e) #1 0x10e478e93 in ecma_copy_value (jerry:x86_64+0x100013e93) #2 0x10e47ef83 in ecma_builtin_array_prototype_dispatch_routine (jerry:x86_64+0x100019f83) #3 0x10e496a37 in ecma_builtin_dispatch_call (jerry:x86_64+0x100031a37) #4 0x10e4d9672 in vm_execute (jerry:x86_64+0x100074672) #5 0x10e4d910c in vm_run (jerry:x86_64+0x10007410c) #6 0x10e46a81f in jerry_run (jerry:x86_64+0x10000581f) #7 0x10e467e49 in main (jerry:x86_64+0x100002e49) #8 0x7fff72b5c7fc in start (libdyld.dylib:x86_64+0x1a7fc) ==34465==Register values: rax = 0x000000002e7af69c rbx = 0x0000000065737361 rcx = 0x000010002e7af600 rdx = 0x0000100000000000 rdi = 0x0000000173d7b4e0 rsi = 0x0000000000000000 rbp = 0x00007ffee179a130 rsp = 0x00007ffee179a130 r8 = 0x0000100000000000 r9 = 0x00000000000006e8 r10 = 0x000000010e644670 r11 = 0x00007fff72cccf00 r12 = 0x000000010e64470c r13 = 0x000000010e6441bc r14 = 0x0000100000000000 r15 = 0x000000000000000f AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: SEGV (jerry:x86_64+0x10000f86e) in ecma_ref_ecma_string ==34465==ABORTING [1] 34465 abort ./build/bin/jerry ```
SEGV on ecma_builtin_array_prototype_object_slice
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3637/comments
0
2020-03-24T14:11:59Z
2020-03-27T20:24:09Z
https://github.com/jerryscript-project/jerryscript/issues/3637
586,989,326
3,637
[ "jerryscript-project", "jerryscript" ]
###### JerryScript revision 5b6d4f39 ###### Build platform Linux-4.15.0-88-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 ```javascript function f() {} var B = class extends f { constructor() { String(Reflect.setPrototypeOf(B, null)); super($) } } C = class extends B { g() { return function() {} } } D = class extends C { constructor() { super() } g() {} } new D ``` ###### Output ```text ASAN:DEADLYSIGNAL ================================================================= ==42947==ERROR: AddressSanitizer: SEGV on unknown address 0x00000000 (pc 0x5674e257 bp 0xffb86508 sp 0xffb864f0 T0) ==42947==The signal is caused by a READ memory access. ==42947==Hint: address points to the zero page. #0 0x5674e256 in ecma_deref_object jerryscript/jerry-core/ecma/base/ecma-gc.c:149 #1 0x566fd066 in ecma_op_function_get_super_constructor jerryscript/jerry-core/ecma/operations/ecma-function-object.c:688 #2 0x566ca189 in vm_loop.lto_priv.449 jerryscript/jerry-core/vm/vm.c:1732 #3 0x5668432e in vm_execute jerryscript/jerry-core/vm/vm.c:4028 #4 0x5668490a in vm_run jerryscript/jerry-core/vm/vm.c:4136 #5 0x566c312e in vm_run_eval jerryscript/jerry-core/vm/vm.c:393 #6 0x566facbe in ecma_op_eval_chars_buffer jerryscript/jerry-core/ecma/operations/ecma-eval.c:123 #7 0x566fa934 in ecma_op_eval jerryscript/jerry-core/ecma/operations/ecma-eval.c:58 #8 0x566a0391 in ecma_builtin_global_object_eval jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-global.c:111 #9 0x566a3b54 in ecma_builtin_global_dispatch_routine jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-global.c:1162 #10 0x56724d74 in ecma_builtin_dispatch_routine jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.c:1056 #11 0x56724f4c in ecma_builtin_dispatch_call jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.c:1080 #12 0x566fd2f5 in ecma_op_function_call_simple jerryscript/jerry-core/ecma/operations/ecma-function-object.c:751 #13 0x566fe207 in ecma_op_function_call jerryscript/jerry-core/ecma/operations/ecma-function-object.c:1054 #14 0x566c4831 in opfunc_call.lto_priv.448 jerryscript/jerry-core/vm/vm.c:765 #15 0x56684392 in vm_execute jerryscript/jerry-core/vm/vm.c:4034 #16 0x5668490a in vm_run jerryscript/jerry-core/vm/vm.c:4136 #17 0x566c312e in vm_run_eval jerryscript/jerry-core/vm/vm.c:393 #18 0x566facbe in ecma_op_eval_chars_buffer jerryscript/jerry-core/ecma/operations/ecma-eval.c:123 #19 0x566fa934 in ecma_op_eval jerryscript/jerry-core/ecma/operations/ecma-eval.c:58 #20 0x566a0391 in ecma_builtin_global_object_eval jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-global.c:111 #21 0x566a3b54 in ecma_builtin_global_dispatch_routine jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-global.c:1162 #22 0x56724d74 in ecma_builtin_dispatch_routine jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.c:1056 #23 0x56724f4c in ecma_builtin_dispatch_call jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.c:1080 #24 0x566fd2f5 in ecma_op_function_call_simple jerryscript/jerry-core/ecma/operations/ecma-function-object.c:751 #25 0x566fe207 in ecma_op_function_call jerryscript/jerry-core/ecma/operations/ecma-function-object.c:1054 #26 0x566c4831 in opfunc_call.lto_priv.448 jerryscript/jerry-core/vm/vm.c:765 #27 0x56684392 in vm_execute jerryscript/jerry-core/vm/vm.c:4034 #28 0x5668490a in vm_run jerryscript/jerry-core/vm/vm.c:4136 #29 0x566fd88a in ecma_op_function_call_simple jerryscript/jerry-core/ecma/operations/ecma-function-object.c:855 #30 0x566fe847 in ecma_op_function_construct jerryscript/jerry-core/ecma/operations/ecma-function-object.c:1240 #31 0x5662a652 in ecma_op_implicit_constructor_handler_heritage_cb jerryscript/jerry-core/vm/opcodes.c:818 #32 0x566fdada in ecma_op_function_call_external jerryscript/jerry-core/ecma/operations/ecma-function-object.c:912 #33 0x566fe4d0 in ecma_op_function_construct_external jerryscript/jerry-core/ecma/operations/ecma-function-object.c:1138 #34 0x566fe62e in ecma_op_function_construct jerryscript/jerry-core/ecma/operations/ecma-function-object.c:1191 #35 0x566c391c in vm_super_call.lto_priv.447 jerryscript/jerry-core/vm/vm.c:565 #36 0x566843a2 in vm_execute jerryscript/jerry-core/vm/vm.c:4040 #37 0x5668490a in vm_run jerryscript/jerry-core/vm/vm.c:4136 #38 0x566fd88a in ecma_op_function_call_simple jerryscript/jerry-core/ecma/operations/ecma-function-object.c:855 #39 0x566fe847 in ecma_op_function_construct jerryscript/jerry-core/ecma/operations/ecma-function-object.c:1240 #40 0x566c4dcb in opfunc_construct.lto_priv.445 jerryscript/jerry-core/vm/vm.c:850 #41 0x566843d0 in vm_execute jerryscript/jerry-core/vm/vm.c:4055 #42 0x5668490a in vm_run jerryscript/jerry-core/vm/vm.c:4136 #43 0x566c2e8a in vm_run_global jerryscript/jerry-core/vm/vm.c:320 #44 0x567440bd in jerry_run jerryscript/jerry-core/api/jerry.c:595 #45 0x567406bf in main jerryscript/jerry-main/main-unix.c:748 #46 0xf76f2e80 in __libc_start_main (/lib/i386-linux-gnu/libc.so.6+0x18e80) #47 0x56620e00 (jerryscript/build/bin/jerry+0x19e00) AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: SEGV jerryscript/jerry-core/ecma/base/ecma-gc.c:149 in ecma_deref_object ==42947==ABORTING ``` <sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [grammarinator](https://github.com/renatahodovan/grammarinator). </sup>
SEGV in ecma_deref_object
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3636/comments
0
2020-03-24T11:10:17Z
2020-03-27T10:28:24Z
https://github.com/jerryscript-project/jerryscript/issues/3636
586,879,228
3,636
[ "jerryscript-project", "jerryscript" ]
# JerryScript version Master HEAD # Case ```javascript var i = 0; for (i = 0; i < 20; i++) { console.log(`${i}.toString(16)=${i.toString(16)}`); } for (i = 0; i < 20; i++) { console.log(`${i}.toString(2)=${i.toString(2)}`); } ``` # Output ``` 0.toString(16)=0 1.toString(16)=1.0 2.toString(16)=2.0 3.toString(16)=3.0 4.toString(16)=4.0 5.toString(16)=5.0 6.toString(16)=6.0 7.toString(16)=7.0 8.toString(16)=8.0 9.toString(16)=9.0 10.toString(16)=a 11.toString(16)=b.0 12.toString(16)=c 13.toString(16)=d.0 14.toString(16)=e 15.toString(16)=f 16.toString(16)=10.0 17.toString(16)=11 18.toString(16)=12 19.toString(16)=13 0.toString(2)=0 1.toString(2)=1.0 2.toString(2)=10.0 3.toString(2)=11.0 4.toString(2)=100.0 5.toString(2)=101.0 6.toString(2)=110.0 7.toString(2)=111.0 8.toString(2)=1000.0 9.toString(2)=1001.0 10.toString(2)=1010 11.toString(2)=1011.0 12.toString(2)=1100 13.toString(2)=1101.0 14.toString(2)=1110 15.toString(2)=1111 16.toString(2)=10000.0 17.toString(2)=10001 18.toString(2)=10010 19.toString(2)=10011 ``` # Bug Some result of `Number.toString([2|16])` end of `.0`.
BUG: Number.toString([2|16])
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3634/comments
12
2020-03-21T14:53:47Z
2020-05-26T13:53:53Z
https://github.com/jerryscript-project/jerryscript/issues/3634
585,514,828
3,634
[ "jerryscript-project", "jerryscript" ]
###### JerryScript revision 5b6d4f39 ###### Build platform Linux-4.15.0-88-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 ```javascript { class eval {} eval() } ``` ###### Output ```text ICE: Assertion 'JERRY_CONTEXT (current_new_target) != JERRY_CONTEXT_INVALID_NEW_TARGET' failed at jerryscript/jerry-core/vm/opcodes.c(ecma_op_implicit_constructor_handler_cb):781. Error: ERR_FAILED_INTERNAL_ASSERTION ``` ###### Backtrace ```text bt #0 0xf7fd5079 in __kernel_vsyscall () #1 0xf7c96832 in raise () from /lib/i386-linux-gnu/libc.so.6 #2 0xf7c97cc1 in abort () from /lib/i386-linux-gnu/libc.so.6 #3 0x085028de in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-port/default/default-fatal.c:30 #4 0x0828bd9e in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:63 #5 0x0828be73 in jerry_assert_fail (assertion=0x85babe0 <.str.26> "JERRY_CONTEXT (current_new_target) != JERRY_CONTEXT_INVALID_NEW_TARGET", file=0x8548696 "jerryscript/jerry-core/vm/opcodes.c", function=0x85bacc0 <__func__.ecma_op_implicit_constructor_handler_cb> "ecma_op_implicit_constructor_handler_cb", line=781) at jerryscript/jerry-core/jrt/jrt-fatals.c:87 #6 0x084faab8 in ecma_op_implicit_constructor_handler_cb (function_obj=4115661923, this_val=72, args_p=0xffffc1a0, args_count=1) at jerryscript/jerry-core/vm/opcodes.c:781 #7 0x0821b937 in ecma_op_function_call_external (func_obj_p=0xf5500460, this_arg_value=72, arguments_list_p=0xffffc1a0, arguments_list_len=1) at jerryscript/jerry-core/ecma/operations/ecma-function-object.c:912 #8 0x0821a104 in ecma_op_function_call (func_obj_p=0xf5500460, this_arg_value=72, arguments_list_p=0xffffc1a0, arguments_list_len=1) at jerryscript/jerry-core/ecma/operations/ecma-function-object.c:1058 #9 0x083778fd in opfunc_call (frame_ctx_p=0xffffc160) at jerryscript/jerry-core/vm/vm.c:765 #10 0x0833c9cb in vm_execute (frame_ctx_p=0xffffc160) at jerryscript/jerry-core/vm/vm.c:4034 #11 0x0833b9b8 in vm_run (bytecode_header_p=0xf5f03d40, this_binding_value=4115663699, lex_env_p=0xf53007b0, arg_list_p=0x0, arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:4136 #12 0x0833c20d in vm_run_global (bytecode_p=0xf5f03d40) at jerryscript/jerry-core/vm/vm.c:320 #13 0x0812a1d0 in jerry_run (func_val=4115663123) at jerryscript/jerry-core/api/jerry.c:595 #14 0x0811d9cc in main (argc=2, argv=0xffffcb34) at jerryscript/jerry-main/main-unix.c:748 ``` <sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [grammarinator](https://github.com/renatahodovan/grammarinator). </sup>
Assertion JERRY_CONTEXT (current_new_target) != JERRY_CONTEXT_INVALID_NEW_TARGET in ecma_op_implicit_constructor_handler_cb
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3630/comments
0
2020-03-20T08:52:57Z
2020-03-27T10:21:51Z
https://github.com/jerryscript-project/jerryscript/issues/3630
584,924,416
3,630
[ "jerryscript-project", "jerryscript" ]
###### JerryScript revision b2e54e91 ###### Build platform Linux-4.15.0-88-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 ```javascript var g = Array.bind(0, 0, 0, 0) g.prototype = Array; class C extends g {} class D extends C { constructor(a, b, c) { eval("eval ('super (a, b, c, d)')") } } var d = new D ``` ###### Output ```text ================================================================= ==20956==ERROR: AddressSanitizer: heap-buffer-overflow on address 0xf540023c at pc 0xf799c90e bp 0xffd1eea8 sp 0xffd1ea78 WRITE of size 16 at 0xf540023c thread T0 #0 0xf799c90d (/usr/lib32/libasan.so.4+0x7790d) #1 0x5674d748 in ecma_collection_append jerryscript/jerry-core/ecma/base/ecma-helpers-collection.c:182 #2 0x566f7308 in ecma_op_function_construct_bound jerryscript/jerry-core/ecma/operations/ecma-function-object.c:1091 #3 0x566f75f9 in ecma_op_function_construct jerryscript/jerry-core/ecma/operations/ecma-function-object.c:1186 #4 0x56623652 in ecma_op_implicit_constructor_handler_heritage_cb jerryscript/jerry-core/vm/opcodes.c:818 #5 0x566f6acc in ecma_op_function_call_external jerryscript/jerry-core/ecma/operations/ecma-function-object.c:912 #6 0x566f74c2 in ecma_op_function_construct_external jerryscript/jerry-core/ecma/operations/ecma-function-object.c:1138 #7 0x566f7620 in ecma_op_function_construct jerryscript/jerry-core/ecma/operations/ecma-function-object.c:1191 #8 0x566bc90e in vm_super_call.lto_priv.447 jerryscript/jerry-core/vm/vm.c:565 #9 0x5667d394 in vm_execute jerryscript/jerry-core/vm/vm.c:4040 #10 0x5667d8fc in vm_run jerryscript/jerry-core/vm/vm.c:4136 #11 0x566bc120 in vm_run_eval jerryscript/jerry-core/vm/vm.c:393 #12 0x566f3cb0 in ecma_op_eval_chars_buffer jerryscript/jerry-core/ecma/operations/ecma-eval.c:123 #13 0x566f3926 in ecma_op_eval jerryscript/jerry-core/ecma/operations/ecma-eval.c:58 #14 0x56699383 in ecma_builtin_global_object_eval jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-global.c:111 #15 0x5669cb46 in ecma_builtin_global_dispatch_routine jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-global.c:1162 #16 0x5671dd66 in ecma_builtin_dispatch_routine jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.c:1056 #17 0x5671df3e in ecma_builtin_dispatch_call jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.c:1080 #18 0x566f62e7 in ecma_op_function_call_simple jerryscript/jerry-core/ecma/operations/ecma-function-object.c:751 #19 0x566f71f9 in ecma_op_function_call jerryscript/jerry-core/ecma/operations/ecma-function-object.c:1054 #20 0x566bd823 in opfunc_call.lto_priv.448 jerryscript/jerry-core/vm/vm.c:765 #21 0x5667d384 in vm_execute jerryscript/jerry-core/vm/vm.c:4034 #22 0x5667d8fc in vm_run jerryscript/jerry-core/vm/vm.c:4136 #23 0x566bc120 in vm_run_eval jerryscript/jerry-core/vm/vm.c:393 #24 0x566f3cb0 in ecma_op_eval_chars_buffer jerryscript/jerry-core/ecma/operations/ecma-eval.c:123 #25 0x566f3926 in ecma_op_eval jerryscript/jerry-core/ecma/operations/ecma-eval.c:58 #26 0x56699383 in ecma_builtin_global_object_eval jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-global.c:111 #27 0x5669cb46 in ecma_builtin_global_dispatch_routine jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-global.c:1162 #28 0x5671dd66 in ecma_builtin_dispatch_routine jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.c:1056 #29 0x5671df3e in ecma_builtin_dispatch_call jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.c:1080 #30 0x566f62e7 in ecma_op_function_call_simple jerryscript/jerry-core/ecma/operations/ecma-function-object.c:751 #31 0x566f71f9 in ecma_op_function_call jerryscript/jerry-core/ecma/operations/ecma-function-object.c:1054 #32 0x566bd823 in opfunc_call.lto_priv.448 jerryscript/jerry-core/vm/vm.c:765 #33 0x5667d384 in vm_execute jerryscript/jerry-core/vm/vm.c:4034 #34 0x5667d8fc in vm_run jerryscript/jerry-core/vm/vm.c:4136 #35 0x566f687c in ecma_op_function_call_simple jerryscript/jerry-core/ecma/operations/ecma-function-object.c:855 #36 0x566f7839 in ecma_op_function_construct jerryscript/jerry-core/ecma/operations/ecma-function-object.c:1240 #37 0x566bddbd in opfunc_construct.lto_priv.445 jerryscript/jerry-core/vm/vm.c:850 #38 0x5667d3c2 in vm_execute jerryscript/jerry-core/vm/vm.c:4055 #39 0x5667d8fc in vm_run jerryscript/jerry-core/vm/vm.c:4136 #40 0x566bbe7c in vm_run_global jerryscript/jerry-core/vm/vm.c:320 #41 0x5673d0af in jerry_run jerryscript/jerry-core/api/jerry.c:595 #42 0x567396b1 in main jerryscript/jerry-main/main-unix.c:748 #43 0xf7744e80 in __libc_start_main (/lib/i386-linux-gnu/libc.so.6+0x18e80) #44 0x56619e00 (jerryscript/build_gcc_asan_es2015/bin/jerry+0x19e00) 0xf540023c is located 0 bytes to the right of 28-byte region [0xf5400220,0xf540023c) allocated by thread T0 here: #0 0xf7a0af54 in malloc (/usr/lib32/libasan.so.4+0xe5f54) #1 0x566da329 in jmem_heap_alloc jerryscript/jerry-core/jmem/jmem-heap.c:254 #2 0x566da407 in jmem_heap_gc_and_alloc_block jerryscript/jerry-core/jmem/jmem-heap.c:289 #3 0x566da499 in jmem_heap_alloc_block jerryscript/jerry-core/jmem/jmem-heap.c:322 #4 0x5674c965 in ecma_new_collection jerryscript/jerry-core/ecma/base/ecma-helpers-collection.c:43 #5 0x566f72d0 in ecma_op_function_construct_bound jerryscript/jerry-core/ecma/operations/ecma-function-object.c:1086 #6 0x566f75f9 in ecma_op_function_construct jerryscript/jerry-core/ecma/operations/ecma-function-object.c:1186 #7 0x56623652 in ecma_op_implicit_constructor_handler_heritage_cb jerryscript/jerry-core/vm/opcodes.c:818 #8 0x566f6acc in ecma_op_function_call_external jerryscript/jerry-core/ecma/operations/ecma-function-object.c:912 #9 0x566f74c2 in ecma_op_function_construct_external jerryscript/jerry-core/ecma/operations/ecma-function-object.c:1138 #10 0x566f7620 in ecma_op_function_construct jerryscript/jerry-core/ecma/operations/ecma-function-object.c:1191 #11 0x566bc90e in vm_super_call.lto_priv.447 jerryscript/jerry-core/vm/vm.c:565 #12 0x5667d394 in vm_execute jerryscript/jerry-core/vm/vm.c:4040 #13 0x5667d8fc in vm_run jerryscript/jerry-core/vm/vm.c:4136 #14 0x566bc120 in vm_run_eval jerryscript/jerry-core/vm/vm.c:393 #15 0x566f3cb0 in ecma_op_eval_chars_buffer jerryscript/jerry-core/ecma/operations/ecma-eval.c:123 #16 0x566f3926 in ecma_op_eval jerryscript/jerry-core/ecma/operations/ecma-eval.c:58 #17 0x56699383 in ecma_builtin_global_object_eval jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-global.c:111 #18 0x5669cb46 in ecma_builtin_global_dispatch_routine jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-global.c:1162 #19 0x5671dd66 in ecma_builtin_dispatch_routine jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.c:1056 #20 0x5671df3e in ecma_builtin_dispatch_call jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.c:1080 #21 0x566f62e7 in ecma_op_function_call_simple jerryscript/jerry-core/ecma/operations/ecma-function-object.c:751 #22 0x566f71f9 in ecma_op_function_call jerryscript/jerry-core/ecma/operations/ecma-function-object.c:1054 #23 0x566bd823 in opfunc_call.lto_priv.448 jerryscript/jerry-core/vm/vm.c:765 #24 0x5667d384 in vm_execute jerryscript/jerry-core/vm/vm.c:4034 #25 0x5667d8fc in vm_run jerryscript/jerry-core/vm/vm.c:4136 #26 0x566bc120 in vm_run_eval jerryscript/jerry-core/vm/vm.c:393 #27 0x566f3cb0 in ecma_op_eval_chars_buffer jerryscript/jerry-core/ecma/operations/ecma-eval.c:123 #28 0x566f3926 in ecma_op_eval jerryscript/jerry-core/ecma/operations/ecma-eval.c:58 #29 0x56699383 in ecma_builtin_global_object_eval jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-global.c:111 SUMMARY: AddressSanitizer: heap-buffer-overflow (/usr/lib32/libasan.so.4+0x7790d) Shadow bytes around the buggy address: 0x3ea7fff0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x3ea80000: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x3ea80010: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x3ea80020: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x3ea80030: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa =>0x3ea80040: fa fa fa fa 00 00 00[04]fa fa 00 00 00 06 fa fa 0x3ea80050: 00 00 00 00 fa fa 00 00 00 fa fa fa 00 00 00 fa 0x3ea80060: fa fa 00 00 00 fa fa fa 00 00 00 fa fa fa 00 00 0x3ea80070: 00 fa fa fa 00 00 00 fa fa fa 00 00 00 fa fa fa 0x3ea80080: 00 00 00 03 fa fa fd fd fd fa fa fa 00 00 00 fa 0x3ea80090: fa fa 00 00 00 fa fa fa 00 00 00 fa fa fa 00 00 Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb ==20956==ABORTING ``` <sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [grammarinator](https://github.com/renatahodovan/grammarinator). </sup>
heap-buffer-overflow in ecma_collection_append
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3628/comments
0
2020-03-19T16:21:25Z
2020-03-27T10:28:37Z
https://github.com/jerryscript-project/jerryscript/issues/3628
584,533,998
3,628
[ "jerryscript-project", "jerryscript" ]
###### JerryScript revision b2e54e91 ###### Build platform Linux-4.15.0-88-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 ```javascript var Base = function() {}.bind(); Object.defineProperty(Base, 'prototype', { get: function() { return Int8Array + Function } }); class C extends Base {} ``` ###### Output ```text Script Error: TypeError: Property 'prototype' is not an object or null ICE: Assertion 'JERRY_CONTEXT (jmem_heap_allocated_size) == 0' failed at jerryscript/jerry-core/jmem/jmem-heap.c(jmem_heap_finalize):107. Error: ERR_FAILED_INTERNAL_ASSERTION ``` ###### Backtrace ```text 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 0x5657b552 in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-port/default/default-fatal.c:30 #4 0x56630043 in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:63 #5 0x56630084 in jerry_assert_fail (assertion=0x566f9c40 "JERRY_CONTEXT (jmem_heap_allocated_size) == 0", file=0x566f9be0 "jerryscript/jerry-core/jmem/jmem-heap.c", function=0x566c7fe0 <__func__.5684.lto_priv.162> "jmem_heap_finalize", line=107) at jerryscript/jerry-core/jrt/jrt-fatals.c:87 #6 0x5662f1f3 in jmem_heap_finalize () at jerryscript/jerry-core/jmem/jmem-heap.c:107 #7 0x5662f019 in jmem_finalize () at jerryscript/jerry-core/jmem/jmem-allocator.c:170 #8 0x56691395 in jerry_cleanup () at jerryscript/jerry-core/api/jerry.c:254 #9 0x5668f02b in main (argc=2, argv=0xffffcb44) at jerryscript/jerry-main/main-unix.c:983 ``` <sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [grammarinator](https://github.com/renatahodovan/grammarinator). </sup>
Assertion JERRY_CONTEXT (jmem_heap_allocated_size) == 0 in jmem_heap_finalize
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3625/comments
0
2020-03-19T12:50:01Z
2020-03-19T16:24:03Z
https://github.com/jerryscript-project/jerryscript/issues/3625
584,388,759
3,625
[ "jerryscript-project", "jerryscript" ]
Hello, I'm writing an encoding function from string to Uint8Array based on `'ascii'` encoding (1 char to 1 byte). I considered the functions `jerry_string_to_char_buffer()` and `jerry_string_to_utf8_char_buffer()`, but it encodes to two or more bytes for exceeding char code 127 (128 ~ 255). Here is an example of ascii encoding in Node.js: ```js > var s = String.fromCharCode(0, 1, 127, 128, 255); > var buf = new Buffer(s, 'ascii'); // <Buffer 00 01 7f 80 ff> ``` Is there any function or way to get char code at particular index from a string? (like `jerry_string_char_code_at()`). Thank you in advance.
Question: Is there C API corresponds to `string.charCodeAt()`?
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3622/comments
2
2020-03-18T08:18:31Z
2020-03-27T02:49:20Z
https://github.com/jerryscript-project/jerryscript/issues/3622
583,549,536
3,622
[ "jerryscript-project", "jerryscript" ]
Hello, I'm going to implement 'length' property of bound function. I think that there are 2 approaches as belows. 1) Adding 'length' property when each bound function generated This approach is simple but all bound function objects always hold 'length' property whether it is really used or not. 2) Lazily insert 'length' property Adding 'length' property when it is accessed for the first time. This approach could save memory, but we should hold the length of target function when each bound function is generated. From the standard [es6 19.2.3.2](https://www.ecma-international.org/ecma-262/6.0/#sec-function.prototype.bind), 'length' property of bound function is calculated using the length of target function and its number of arguments. number of arguments is already stored in `ecma_extended_object_t::u::bound_function::args_len_or_this`, but the length of target function is not. ```js var foo = function (x,y) {}; var bound1 = foo.bind(null); delete foo.length; var bound2 = foo.bind(null); print(bound1.length); // 2 (length property is defined when bound function is generated) print(bound2.length); // 0 ``` From the above case, we even cannot calculate the length property lazily because the length value of target function could be changed before the moment. To resolve this issue, I'm considering storing the length value of target function into additional space outside the `ecma_extended_object_t` by allocating a one-slot bigger ecma_extended_object_t using `ecma_create_object()` when creating a bound function object. Intialization of length property could be marked by pointer with tag (jmem_cpointer_tag_t) which is similar to the case of function object. Which one do you prefer?
Adding 'length' property to bound function
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3615/comments
1
2020-03-16T11:37:13Z
2020-04-04T00:04:03Z
https://github.com/jerryscript-project/jerryscript/issues/3615
582,221,874
3,615
[ "jerryscript-project", "jerryscript" ]
###### JerryScript revision 47d85a12 ###### Build platform Linux-4.15.0-88-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 ```javascript for (const [] in $) ``` ###### Output ```text ICE: Assertion 'context_p->next_scanner_info_p->type == SCANNER_TYPE_BLOCK' failed at jerryscript/jerry-core/parser/js/js-parser-statm.c(parser_push_block_context):378. Error: ERR_FAILED_INTERNAL_ASSERTION ``` ###### Backtrace ```text 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 0x5657de5c in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-port/default/default-fatal.c:30 #4 0x5662ea2d in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:63 #5 0x5662ea6e in jerry_assert_fail (assertion=0x566e86a0 "context_p->next_scanner_info_p->type == SCANNER_TYPE_BLOCK", file=0x566e8540 "jerryscript/jerry-core/parser/js/js-parser-statm.c", function=0x566d6f80 <__func__.5751.lto_priv.221> "parser_push_block_context", line=378) at jerryscript/jerry-core/jrt/jrt-fatals.c:87 #6 0x565af751 in parser_push_block_context.lto_priv.207 (context_p=0xffffc480, is_private=true) at jerryscript/jerry-core/parser/js/js-parser-statm.c:378 #7 0x565b44cf in parser_parse_for_statement_start.lto_priv.201 (context_p=0xffffc480) at jerryscript/jerry-core/parser/js/js-parser-statm.c:1246 #8 0x565710dc in parser_parse_statements (context_p=0xffffc480) at jerryscript/jerry-core/parser/js/js-parser-statm.c:2869 #9 0x5663d100 in parser_parse_source (arg_list_p=0x0, arg_list_size=0, source_p=0x567404c0 <buffer.lto_priv> "'use strict' ; \ntry { eval ( 'for (var i = 0 in {}) {}' ) ; \nString ( false ) ; \n} catch ( e ) { String ( e instanceof SyntaxError ) ; \n} \ntry { eval ( 'for (var = i of {}) {}' ) ; \nString ( false ) ;"..., source_size=704, parse_opts=0, error_location_p=0xffffc6b0) at jerryscript/jerry-core/parser/js/js-parser.c:2097 #10 0x56640637 in parser_parse_script (arg_list_p=0x0, arg_list_size=0, source_p=0x567404c0 <buffer.lto_priv> "'use strict' ; \ntry { eval ( 'for (var i = 0 in {}) {}' ) ; \nString ( false ) ; \n} catch ( e ) { String ( e instanceof SyntaxError ) ; \n} \ntry { eval ( 'for (var = i of {}) {}' ) ; \nString ( false ) ;"..., source_size=704, parse_opts=0, bytecode_data_p=0xffffc770) at jerryscript/jerry-core/parser/js/js-parser.c:2608 #11 0x56691699 in jerry_parse (resource_name_p=0xffffcd9a "/home/reni/.fuzzinator_24620//jerryscript/picireny/88658893044897015945437448205094781788.js", resource_name_length=92, source_p=0x567404c0 <buffer.lto_priv> "'use strict' ; \ntry { eval ( 'for (var i = 0 in {}) {}' ) ; \nString ( false ) ; \n} catch ( e ) { String ( e instanceof SyntaxError ) ; \n} \ntry { eval ( 'for (var = i of {}) {}' ) ; \nString ( false ) ;"..., source_size=704, parse_opts=0) at jerryscript/jerry-core/api/jerry.c:447 #12 0x5668e2c1 in main (argc=2, argv=0xffffcb24) at jerryscript/jerry-main/main-unix.c:739 ``` <sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [grammarinator](https://github.com/renatahodovan/grammarinator). </sup>
Assertion context_p->next_scanner_info_p->type == SCANNER_TYPE_BLOCK in parser_push_block_context
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3611/comments
0
2020-03-14T13:28:05Z
2020-03-16T13:53:03Z
https://github.com/jerryscript-project/jerryscript/issues/3611
581,209,708
3,611
[ "jerryscript-project", "jerryscript" ]
###### JerryScript revision 38862c39 ###### Build platform Linux-4.15.0-88-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 ```javascript function $() { return $ ? $ : $ * $++() } switch ($) {} ``` ###### Output ```text ICE: Assertion 'context_p->next_scanner_info_p->source_p == context_p->source_p && context_p->next_scanner_info_p->type == SCANNER_TYPE_SWITCH' failed at jerryscript/jerry-core/parser/js/js-parser-statm.c(parser_parse_switch_statement_start):1694. Error: ERR_FAILED_INTERNAL_ASSERTION ``` ###### Backtrace ```text 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 0x5657de2c in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-port/default/default-fatal.c:30 #4 0x5662e9fd in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:63 #5 0x5662ea3e in jerry_assert_fail (assertion=0x566e8820 "context_p->next_scanner_info_p->source_p == context_p->source_p && context_p->next_scanner_info_p->type == SCANNER_TYPE_SWITCH", file=0x566e7a00 "jerryscript/jerry-core/parser/js/js-parser-statm.c", function=0x566d68c0 <__func__.5912.lto_priv.202> "parser_parse_switch_statement_start", line=1694) at jerryscript/jerry-core/jrt/jrt-fatals.c:87 #6 0x565b6a22 in parser_parse_switch_statement_start.lto_priv.195 (context_p=0xffffc480) at jerryscript/jerry-core/parser/js/js-parser-statm.c:1693 #7 0x56570eaa in parser_parse_statements (context_p=0xffffc480) at jerryscript/jerry-core/parser/js/js-parser-statm.c:2839 #8 0x5663d0d0 in parser_parse_source (arg_list_p=0x0, arg_list_size=0, source_p=0x56740480 <buffer.lto_priv> "function fact ( n ) { return n < 2 ? 1 : n * Uint8ClampedArray ++ ( ) ; \n} \nswitch ( fact ( 5 ) ) { case 5 * fact ( 4 ) : break ; \ndefault : String ( false ) ; \n} \n ", source_size=165, parse_opts=0, error_location_p=0xffffc6b0) at jerryscript/jerry-core/parser/js/js-parser.c:2097 #9 0x56640607 in parser_parse_script (arg_list_p=0x0, arg_list_size=0, source_p=0x56740480 <buffer.lto_priv> "function fact ( n ) { return n < 2 ? 1 : n * Uint8ClampedArray ++ ( ) ; \n} \nswitch ( fact ( 5 ) ) { case 5 * fact ( 4 ) : break ; \ndefault : String ( false ) ; \n} \n ", source_size=165, parse_opts=0, bytecode_data_p=0xffffc770) at jerryscript/jerry-core/parser/js/js-parser.c:2608 #10 0x56690bc0 in jerry_parse (resource_name_p=0xffffcd99 "/home/reni/.fuzzinator_24620//jerryscript/picireny/137660742279437109932472843853345619685.js", resource_name_length=93, source_p=0x56740480 <buffer.lto_priv> "function fact ( n ) { return n < 2 ? 1 : n * Uint8ClampedArray ++ ( ) ; \n} \nswitch ( fact ( 5 ) ) { case 5 * fact ( 4 ) : break ; \ndefault : String ( false ) ; \n} \n ", source_size=165, parse_opts=0) at jerryscript/jerry-core/api/jerry.c:447 #11 0x5668d7e8 in main (argc=2, argv=0xffffcb24) at jerryscript/jerry-main/main-unix.c:739 ``` <sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [grammarinator](https://github.com/renatahodovan/grammarinator). </sup>
Assertion context_p->next_scanner_info_p->source_p == context_p->source_p && context_p->next_scanner_info_p->type == SCANNER_TYPE_SWITCH in parser_parse_switch_statement_start
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3608/comments
0
2020-03-11T09:58:22Z
2020-03-16T13:44:40Z
https://github.com/jerryscript-project/jerryscript/issues/3608
579,138,917
3,608
[ "jerryscript-project", "jerryscript" ]
###### JerryScript revision 72f8ef34 ###### Build platform Linux-4.15.0-88-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 ```javascript String(JSON.stringify(Array.prototype[Symbol.unscopables])) ``` ###### Output ```text ICE: Assertion 'ecma_object_check_class_name_is_object (obj_p)' failed at jerryscript/jerry-core/ecma/operations/ecma-objects.c(ecma_object_get_class_name):2600. Error: ERR_FAILED_INTERNAL_ASSERTION ``` ###### Backtrace ```text 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 0x5657de1c in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-port/default/default-fatal.c:30 #4 0x5662e9d8 in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:63 #5 0x5662ea19 in jerry_assert_fail (assertion=0x566fda80 "ecma_object_check_class_name_is_object (obj_p)", file=0x566fcd40 "jerryscript/jerry-core/ecma/operations/ecma-objects.c", function=0x566c3e00 <__func__.7039.lto_priv.640> "ecma_object_get_class_name", line=2600) at jerryscript/jerry-core/jrt/jrt-fatals.c:87 #6 0x5665ceff in ecma_object_get_class_name (obj_p=0xf5f01660) at jerryscript/jerry-core/ecma/operations/ecma-objects.c:2600 #7 0x5666f4e9 in ecma_builtin_json_serialize_property (context_p=0xffffc2f0, holder_p=0xf5d001b0, key_p=0xd) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-json.c:1171 #8 0x5666fae6 in ecma_builtin_json_str_helper (context_p=0xffffc2f0, arg1=4126152291) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-json.c:1313 #9 0x56670abc in ecma_builtin_json_stringify (this_arg=4126152195, arg1=4126152291, arg2=72, arg3=72) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-json.c:1556 #10 0x5666b667 in ecma_builtin_json_dispatch_routine (builtin_routine_id=83, this_arg_value=4126152195, arguments_list=0xffffc3d0, arguments_number=1) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-json.inc.h:34 #11 0x566739f7 in ecma_builtin_dispatch_routine (builtin_object_id=ECMA_BUILTIN_ID_JSON, builtin_routine_id=83, this_arg_value=4126152195, arguments_list_p=0xffffc3d0, arguments_list_len=1) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.c:1049 #12 0x56673c58 in ecma_builtin_dispatch_call (obj_p=0xf5f015d0, this_arg_value=4126152195, arguments_list_p=0xffffc6cc, arguments_list_len=1) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.c:1074 #13 0x5664c7ff in ecma_op_function_call_simple (func_obj_p=0xf5f015d0, this_arg_value=4126152195, arguments_list_p=0xffffc6cc, arguments_list_len=1) at jerryscript/jerry-core/ecma/operations/ecma-function-object.c:985 #14 0x5664d101 in ecma_op_function_call (func_obj_p=0xf5f015d0, this_arg_value=4126152195, arguments_list_p=0xffffc6cc, arguments_list_len=1) at jerryscript/jerry-core/ecma/operations/ecma-function-object.c:1206 #15 0x5660fa30 in opfunc_call.lto_priv.465 (frame_ctx_p=0xffffc690) at jerryscript/jerry-core/vm/vm.c:746 #16 0x565d962d in vm_execute (frame_ctx_p=0xffffc690) at jerryscript/jerry-core/vm/vm.c:4262 #17 0x565d9ba5 in vm_run (bytecode_header_p=0xf4f03c00, this_binding_value=4126149459, lex_env_p=0xf5d007b0, arg_list_p=0x0, arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:4364 #18 0x5660e1ec in vm_run_global (bytecode_p=0xf4f03c00) at jerryscript/jerry-core/vm/vm.c:320 #19 0x5669120a in jerry_run (func_val=4126148595) at jerryscript/jerry-core/api/jerry.c:594 #20 0x5668d80c in main (argc=2, argv=0xffffcb24) at jerryscript/jerry-main/main-unix.c:748 ``` <sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [grammarinator](https://github.com/renatahodovan/grammarinator). </sup>
Assertion ecma_object_check_class_name_is_object (obj_p) in ecma_object_get_class_name
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3606/comments
0
2020-03-10T15:09:13Z
2020-03-12T11:45:54Z
https://github.com/jerryscript-project/jerryscript/issues/3606
578,651,159
3,606
[ "jerryscript-project", "jerryscript" ]
###### JerryScript revision 9b393ee2 ###### Build platform Linux-4.15.0-74-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 ```javascript ({set $($) { super(...args) } ``` ###### Output ```text ================================================================= ==33389==ERROR: AddressSanitizer: heap-use-after-free on address 0xf4502098 at pc 0x5670900a bp 0xfff41388 sp 0xfff41378 READ of size 1 at 0xf4502098 thread T0 #0 0x56709009 in scanner_pop_binding_list jerryscript/jerry-core/parser/js/js-scanner-util.c:1383 #1 0x566ba72a in scanner_scan_primary_expression_end jerryscript/jerry-core/parser/js/js-scanner.c:863 #2 0x566c1722 in scanner_scan_all jerryscript/jerry-core/parser/js/js-scanner.c:2442 #3 0x566fe9a8 in parser_parse_source jerryscript/jerry-core/parser/js/js-parser.c:1996 #4 0x56702a09 in parser_parse_script jerryscript/jerry-core/parser/js/js-parser.c:2607 #5 0x5675599e in jerry_parse jerryscript/jerry-core/api/jerry.c:445 #6 0x5675257f in main jerryscript/jerry-main/main-unix.c:739 #7 0xf7738e80 in __libc_start_main (/lib/i386-linux-gnu/libc.so.6+0x18e80) #8 0x56632090 (jerryscript/build_gcc_asan_es2015/bin/jerry+0x19090) 0xf4502098 is located 24 bytes inside of 124-byte region [0xf4502080,0xf45020fc) freed by thread T0 here: #0 0xf79feb74 in __interceptor_free (/usr/lib32/libasan.so.4+0xe5b74) #1 0x566f0418 in jmem_heap_free_block_internal jerryscript/jerry-core/jmem/jmem-heap.c:475 #2 0x566f07cf in jmem_heap_free_block jerryscript/jerry-core/jmem/jmem-heap.c:684 #3 0x5666c8a8 in parser_free jerryscript/jerry-core/parser/js/js-parser-mem.c:59 #4 0x5666c8a8 in parser_data_free jerryscript/jerry-core/parser/js/js-parser-mem.c:135 #5 0x5666cc1d in parser_list_free jerryscript/jerry-core/parser/js/js-parser-mem.c:213 #6 0x5670637a in scanner_pop_literal_pool jerryscript/jerry-core/parser/js/js-scanner-util.c:852 #7 0x566bf4c6 in scanner_scan_statement_end jerryscript/jerry-core/parser/js/js-scanner.c:1975 #8 0x566c17e6 in scanner_scan_all jerryscript/jerry-core/parser/js/js-scanner.c:2467 #9 0x566fe9a8 in parser_parse_source jerryscript/jerry-core/parser/js/js-parser.c:1996 #10 0x56702a09 in parser_parse_script jerryscript/jerry-core/parser/js/js-parser.c:2607 #11 0x5675599e in jerry_parse jerryscript/jerry-core/api/jerry.c:445 #12 0x5675257f in main jerryscript/jerry-main/main-unix.c:739 #13 0xf7738e80 in __libc_start_main (/lib/i386-linux-gnu/libc.so.6+0x18e80) previously allocated by thread T0 here: #0 0xf79fef34 in malloc (/usr/lib32/libasan.so.4+0xe5f34) #1 0x566f00df in jmem_heap_alloc jerryscript/jerry-core/jmem/jmem-heap.c:254 #2 0x566f01bd in jmem_heap_gc_and_alloc_block jerryscript/jerry-core/jmem/jmem-heap.c:289 #3 0x566f0278 in jmem_heap_alloc_block_null_on_error jerryscript/jerry-core/jmem/jmem-heap.c:340 #4 0x5666c548 in parser_malloc jerryscript/jerry-core/parser/js/js-parser-mem.c:43 #5 0x5666cdbf in parser_list_append jerryscript/jerry-core/parser/js/js-parser-mem.c:242 #6 0x56707aa8 in scanner_append_argument jerryscript/jerry-core/parser/js/js-scanner-util.c:1154 #7 0x566c2aed in scanner_scan_all jerryscript/jerry-core/parser/js/js-scanner.c:2692 #8 0x566fe9a8 in parser_parse_source jerryscript/jerry-core/parser/js/js-parser.c:1996 #9 0x56702a09 in parser_parse_script jerryscript/jerry-core/parser/js/js-parser.c:2607 #10 0x5675599e in jerry_parse jerryscript/jerry-core/api/jerry.c:445 #11 0x5675257f in main jerryscript/jerry-main/main-unix.c:739 #12 0xf7738e80 in __libc_start_main (/lib/i386-linux-gnu/libc.so.6+0x18e80) SUMMARY: AddressSanitizer: heap-use-after-free jerryscript/jerry-core/parser/js/js-scanner-util.c:1383 in scanner_pop_binding_list Shadow bytes around the buggy address: 0x3e8a03c0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x3e8a03d0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x3e8a03e0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x3e8a03f0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x3e8a0400: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa =>0x3e8a0410: fd fd fd[fd]fd fd fd fd fd fd fd fd fd fd fd fd 0x3e8a0420: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00 0x3e8a0430: 00 00 00 00 00 00 00 04 fa fa fa fa fa fa fa fa 0x3e8a0440: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x3e8a0450: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd 0x3e8a0460: fd fd fd fd fd fd fd fd fa fa fa fa fa fa fa fa Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb ==33389==ABORTING ``` <sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [grammarinator](https://github.com/renatahodovan/grammarinator). </sup>
heap-use-after-free in scanner_pop_binding_list
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3595/comments
0
2020-02-27T16:15:26Z
2020-03-16T13:52:06Z
https://github.com/jerryscript-project/jerryscript/issues/3595
572,189,711
3,595
[ "jerryscript-project", "jerryscript" ]
As stated in [ES6 23.1.3.5](https://www.ecma-international.org/ecma-262/6.0/#sec-map.prototype.foreach), elements added after the call to __forEach__ begins should be visited. So new element added in callback needs to be visited after _old_ elements. ###### Test code: ```js var map = new Map; map.set('a', 1); map.set('b', 2); var l = 0; map.forEach(function(value, key) { print(key, value); if(l === 0) { map.set('c', 3); } l++; }); print("Loops:", l); ``` ###### Output: ``` a 1 b 2 Loops: 2 ``` ###### Expected Output: ``` a 1 b 2 c 3 Loops: 3 ``` I have checked current implementation and it looks like list of the properties' names is gathered at the beginning of execution and used till the end. I think there should be some check after each callback execution, which would update properties' list. The problem is in optimal implementation of this function - properties are stored in reversed singly linked list - new elements are added at the beginning (these elements should be listed at the end of foreach). Something like internal iterator for collection object would be helpful, but this requires invalidating properties and deleting them not directly but a bit later by GC. But this needs a bit of additional memory for each collection's property and will be time consuming. Is there any special reason why property list is reversed? Is this for optimization of adding new properties or it affects also implementations of other functions?
Map.forEach omits newly added elements
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3592/comments
1
2020-02-26T14:15:42Z
2020-03-17T18:30:56Z
https://github.com/jerryscript-project/jerryscript/issues/3592
571,407,379
3,592
[ "jerryscript-project", "jerryscript" ]
###### JerryScript revision 9b393ee2ea07ef4e7971e72637e46923dfc15e6f ###### Build platform Ubuntu 18.04.4 LTS (Linux 4.15.0-76-generic x86_64) ###### Build steps ``` ./tools/build.py --clean --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 ``` ###### Output ``` AddressSanitizer:DEADLYSIGNAL ================================================================= ==16395==ERROR: AddressSanitizer: SEGV on unknown address 0x5f5e0ff4 (pc 0x0813fa83 bp 0xffc3b0c8 sp 0xffc3b0b0 T0) ==16395==The signal is caused by a READ memory access. #0 0x813fa82 in ecma_compare_ecma_non_direct_strings /root/work/libfuzzer/jerryscript/jerry-core/ecma/base/ecma-helpers-string.c:1819:20 #1 0x81476d3 in ecma_find_named_property /root/work/libfuzzer/jerryscript/jerry-core/ecma/base/ecma-helpers.c:707:13 #2 0x8181593 in ecma_op_object_get_own_property /root/work/libfuzzer/jerryscript/jerry-core/ecma/operations/ecma-objects.c:236:33 #3 0x818209c in ecma_op_object_get_property /root/work/libfuzzer/jerryscript/jerry-core/ecma/operations/ecma-objects.c:354:32 #4 0x818209c in ecma_op_object_has_property /root/work/libfuzzer/jerryscript/jerry-core/ecma/operations/ecma-objects.c:409:30 #5 0x8235efa in ecma_op_put_value_lex_env_base /root/work/libfuzzer/jerryscript/jerry-core/ecma/operations/ecma-get-put-value.c:275:13 #6 0x81e7e8d in vm_loop /root/work/libfuzzer/jerryscript/jerry-core/vm/vm.c:3874:43 #7 0x81de804 in vm_execute /root/work/libfuzzer/jerryscript/jerry-core/vm/vm.c:4194:37 #8 0x81de12f in vm_run /root/work/libfuzzer/jerryscript/jerry-core/vm/vm.c:4302:10 #9 0x81de3b7 in vm_run_global /root/work/libfuzzer/jerryscript/jerry-core/vm/vm.c:320:10 #10 0x81235c7 in jerry_run /root/work/libfuzzer/jerryscript/jerry-core/api/jerry.c:593:24 #11 0x811b483 in main /root/work/libfuzzer/jerryscript/jerry-main/main-unix.c:748:23 #12 0xf7cd4e80 in __libc_start_main (/lib32/libc.so.6+0x18e80) #13 0x8071eb1 in _start (/root/work/libfuzzer/jerryscript/build/bin/jerry+0x8071eb1) AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: SEGV /root/work/libfuzzer/jerryscript/jerry-core/ecma/base/ecma-helpers-string.c:1819:20 in ecma_compare_ecma_non_direct_strings ==16395==ABORTING ```
Memory Access Violation in ecma_compare_ecma_non_direct_strings
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3589/comments
2
2020-02-25T18:13:45Z
2020-03-16T14:02:38Z
https://github.com/jerryscript-project/jerryscript/issues/3589
570,741,895
3,589
[ "jerryscript-project", "jerryscript" ]
###### JerryScript revision 9b393ee2 ###### Build platform Linux-4.15.0-74-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 ```javascript class A extends Uint8Array { f() {} } class C extends gc { h() {} } new C ``` ###### Output ```text ICE: Assertion '!ecma_op_function_args_has_flag (arguments_list_p, ECMA_FUNC_ARG_FLAG_CONSTRUCT_SUPER)' failed at jerryscript/jerry-core/ecma/operations/ecma-function-object.c(ecma_op_function_call_external):1084. Error: ERR_FAILED_INTERNAL_ASSERTION ``` ###### Backtrace ```text 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 0x5657d319 in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-port/default/default-fatal.c:30 #4 0x5662cdfa in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:63 #5 0x5662ce3b in jerry_assert_fail (assertion=0x566f5ee0 "!ecma_op_function_args_has_flag (arguments_list_p, ECMA_FUNC_ARG_FLAG_CONSTRUCT_SUPER)", file=0x566f5420 "jerryscript/jerry-core/ecma/operations/ecma-function-object.c", function=0x566bf360 <__func__.6569.lto_priv.656> "ecma_op_function_call_external", line=1084) at jerryscript/jerry-core/jrt/jrt-fatals.c:87 #6 0x5664d637 in ecma_op_function_call_external (func_obj_p=0xf5f00a60, this_arg_value=4124050579, arguments_list_p=0xffffc6c2, arguments_list_len=1) at jerryscript/jerry-core/ecma/operations/ecma-function-object.c:1084 #7 0x5664e5ae in ecma_op_function_construct (func_obj_p=0xf5f00a60, this_arg_value=4124050579, arguments_list_p=0xffffc6c2, arguments_list_len=1) at jerryscript/jerry-core/ecma/operations/ecma-function-object.c:1466 #8 0x5664e35e in ecma_op_function_construct (func_obj_p=0xf5f00520, this_arg_value=4124050579, arguments_list_p=0xffffc6c0, arguments_list_len=1) at jerryscript/jerry-core/ecma/operations/ecma-function-object.c:1427 #9 0x5660e587 in opfunc_construct.lto_priv.460 (frame_ctx_p=0xffffc690) at jerryscript/jerry-core/vm/vm.c:831 #10 0x565d7f23 in vm_execute (frame_ctx_p=0xffffc690) at jerryscript/jerry-core/vm/vm.c:4221 #11 0x565d8456 in vm_run (bytecode_header_p=0xf4f03ec0, this_binding_value=4126149459, lex_env_p=0xf5d00590, arg_list_p=0x0, arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:4302 #12 0x5660c7b3 in vm_run_global (bytecode_p=0xf4f03ec0) at jerryscript/jerry-core/vm/vm.c:320 #13 0x56691ff8 in jerry_run (func_val=4126148739) at jerryscript/jerry-core/api/jerry.c:593 #14 0x5668e5c9 in main (argc=2, argv=0xffffcb24) at jerryscript/jerry-main/main-unix.c:748 ``` <sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [grammarinator](https://github.com/renatahodovan/grammarinator). </sup>
Assertion !ecma_op_function_args_has_flag (arguments_list_p, ECMA_FUNC_ARG_FLAG_CONSTRUCT_SUPER) in ecma_op_function_call_external
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3588/comments
1
2020-02-25T16:53:58Z
2020-03-02T09:37:41Z
https://github.com/jerryscript-project/jerryscript/issues/3588
570,702,161
3,588
[ "jerryscript-project", "jerryscript" ]
Hi jerryscript Community 🤗 I've been asked to help make sure that all the OpenJS Foundation project communities are aware that the deadline for our [OpenJS Conference Call for Proposals](https://events.linuxfoundation.org/openjs-world/program/cfp/) has been extended through Feb. 28. Previously, this event was called 'Node + JS Interactive' and it leaned heavily toward Node.js. We're hoping to have a wider range of sessions about all the OpenJS Foundation projects, so we'd love to see presentations from all the foundation projects! I also wanted to make sure you're aware of the Collaborator's Summit, an event focused on project maintainers, collaborators & contributors. The goal for the collab summit is to provide opportunities for face-to-face working sessions within a single project or across multiple projects. So if you wanted to get your core team together you could do that, or if you want to have a session for new contributors to your project, or if you wanted to work across multiple OpenJS Foundation projects on issues like accessibility, privacy, security, modules, etc. you could do that too. **If you're interested in securing session space at the collab summit, please ping me here, reach out on slack or twitter, or open an issue on the [/summit](https://github.com/openjs-foundation/summit) repo.** The OpenJS World conference is June 23-24 and Collaborator's Summit is June 25-26 in Austin, TX. These are ticketed events, but **members of OpenJS Foundation project communities are eligible for [Travel Fund](https://github.com/openjs-foundation/cross-project-council/blob/master/project-resources/MEMBER_TRAVEL_FUND.md) assistance.** If you have questions or would like to find out more, please chime in on our /summit repo. as always, let me know how I can help <3 Jory Burson OpenJS Foundation Community Manager
[Info] OpenJS Conference & Collab Summit FYIs for Project Communities
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3587/comments
1
2020-02-25T14:54:12Z
2020-12-09T17:49:56Z
https://github.com/jerryscript-project/jerryscript/issues/3587
570,627,362
3,587
[ "jerryscript-project", "jerryscript" ]
###### JerryScript revision 68909fc5 ###### Build platform Linux-4.15.0-74-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 ```javascript var func = function(val, idx) { return val + idx }; String([0, "X"].map(func).copyWithin([])) ``` ###### Output ```text ================================================================= ==32593==ERROR: AddressSanitizer: heap-use-after-free on address 0xf5200250 at pc 0x566f4cc1 bp 0xffb98168 sp 0xffb98158 READ of size 4 at 0xf5200250 thread T0 #0 0x566f4cc0 in ecma_ref_ecma_string jerryscript/jerry-core/ecma/base/ecma-helpers-string.c:831 #1 0x566fe596 in ecma_copy_value jerryscript/jerry-core/ecma/base/ecma-helpers-value.c:811 #2 0x566fe7af in ecma_copy_value_if_not_object jerryscript/jerry-core/ecma/base/ecma-helpers-value.c:863 #3 0x566361c0 in ecma_builtin_array_prototype_object_copy_within jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype.c:2425 #4 0x56636e7c in ecma_builtin_array_prototype_dispatch_routine jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype.c:2685 #5 0x566c2717 in ecma_builtin_dispatch_routine jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.c:1042 #6 0x566c2978 in ecma_builtin_dispatch_call jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.c:1067 #7 0x5669883c in ecma_op_function_call_simple jerryscript/jerry-core/ecma/operations/ecma-function-object.c:960 #8 0x56698f58 in ecma_op_function_call jerryscript/jerry-core/ecma/operations/ecma-function-object.c:1147 #9 0x566597c1 in opfunc_call.lto_priv.471 jerryscript/jerry-core/vm/vm.c:745 #10 0x566236d3 in vm_execute jerryscript/jerry-core/vm/vm.c:4199 #11 0x56623c44 in vm_run jerryscript/jerry-core/vm/vm.c:4301 #12 0x56657f90 in vm_run_global jerryscript/jerry-core/vm/vm.c:320 #13 0x566dd750 in jerry_run jerryscript/jerry-core/api/jerry.c:593 #14 0x566d9d21 in main jerryscript/jerry-main/main-unix.c:748 #15 0xf77b6e80 in __libc_start_main (/lib/i386-linux-gnu/libc.so.6+0x18e80) #16 0x565b9fe0 (jerryscript/build_gcc_asan_es2015/bin/jerry+0x18fe0) 0xf5200250 is located 0 bytes inside of 14-byte region [0xf5200250,0xf520025e) freed by thread T0 here: #0 0xf7a7cb74 in __interceptor_free (/usr/lib32/libasan.so.4+0xe5b74) #1 0x56677bf5 in jmem_heap_free_block_internal jerryscript/jerry-core/jmem/jmem-heap.c:475 #2 0x56677fac in jmem_heap_free_block jerryscript/jerry-core/jmem/jmem-heap.c:684 #3 0x56623dd6 in ecma_dealloc_string_buffer jerryscript/jerry-core/ecma/base/ecma-alloc.c:208 #4 0x566f50c6 in ecma_destroy_ecma_string jerryscript/jerry-core/ecma/base/ecma-helpers-string.c:903 #5 0x566f4e74 in ecma_deref_ecma_string jerryscript/jerry-core/ecma/base/ecma-helpers-string.c:875 #6 0x566ff624 in ecma_free_value jerryscript/jerry-core/ecma/base/ecma-helpers-value.c:1032 #7 0x566ff81b in ecma_free_value_if_not_object jerryscript/jerry-core/ecma/base/ecma-helpers-value.c:1085 #8 0x566360ed in ecma_builtin_array_prototype_object_copy_within jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype.c:2424 #9 0x56636e7c in ecma_builtin_array_prototype_dispatch_routine jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype.c:2685 #10 0x566c2717 in ecma_builtin_dispatch_routine jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.c:1042 #11 0x566c2978 in ecma_builtin_dispatch_call jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.c:1067 #12 0x5669883c in ecma_op_function_call_simple jerryscript/jerry-core/ecma/operations/ecma-function-object.c:960 #13 0x56698f58 in ecma_op_function_call jerryscript/jerry-core/ecma/operations/ecma-function-object.c:1147 #14 0x566597c1 in opfunc_call.lto_priv.471 jerryscript/jerry-core/vm/vm.c:745 #15 0x566236d3 in vm_execute jerryscript/jerry-core/vm/vm.c:4199 #16 0x56623c44 in vm_run jerryscript/jerry-core/vm/vm.c:4301 #17 0x56657f90 in vm_run_global jerryscript/jerry-core/vm/vm.c:320 #18 0x566dd750 in jerry_run jerryscript/jerry-core/api/jerry.c:593 #19 0x566d9d21 in main jerryscript/jerry-main/main-unix.c:748 #20 0xf77b6e80 in __libc_start_main (/lib/i386-linux-gnu/libc.so.6+0x18e80) previously allocated by thread T0 here: #0 0xf7a7cf34 in malloc (/usr/lib32/libasan.so.4+0xe5f34) #1 0x566778bc in jmem_heap_alloc jerryscript/jerry-core/jmem/jmem-heap.c:254 #2 0x5667799a in jmem_heap_gc_and_alloc_block jerryscript/jerry-core/jmem/jmem-heap.c:289 #3 0x56677a2d in jmem_heap_alloc_block jerryscript/jerry-core/jmem/jmem-heap.c:322 #4 0x56623db3 in ecma_alloc_string_buffer jerryscript/jerry-core/ecma/base/ecma-alloc.c:194 #5 0x566f3f10 in ecma_new_ecma_string_from_utf8_buffer jerryscript/jerry-core/ecma/base/ecma-helpers-string.c:293 #6 0x566f3f10 in ecma_append_chars_to_string jerryscript/jerry-core/ecma/base/ecma-helpers-string.c:714 #7 0x566f4a1a in ecma_concat_ecma_strings jerryscript/jerry-core/ecma/base/ecma-helpers-string.c:777 #8 0x56655873 in opfunc_addition jerryscript/jerry-core/vm/opcodes-ecma-arithmetics.c:166 #9 0x56665461 in vm_loop.lto_priv.472 jerryscript/jerry-core/vm/vm.c:2797 #10 0x5662366f in vm_execute jerryscript/jerry-core/vm/vm.c:4193 #11 0x56623c44 in vm_run jerryscript/jerry-core/vm/vm.c:4301 #12 0x56698b5f in ecma_op_function_call_simple jerryscript/jerry-core/ecma/operations/ecma-function-object.c:1049 #13 0x56698f58 in ecma_op_function_call jerryscript/jerry-core/ecma/operations/ecma-function-object.c:1147 #14 0x5663481f in ecma_builtin_array_prototype_object_map jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype.c:1931 #15 0x56636dc7 in ecma_builtin_array_prototype_dispatch_routine jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype.c:2665 #16 0x566c2717 in ecma_builtin_dispatch_routine jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.c:1042 #17 0x566c2978 in ecma_builtin_dispatch_call jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.c:1067 #18 0x5669883c in ecma_op_function_call_simple jerryscript/jerry-core/ecma/operations/ecma-function-object.c:960 #19 0x56698f58 in ecma_op_function_call jerryscript/jerry-core/ecma/operations/ecma-function-object.c:1147 #20 0x566597c1 in opfunc_call.lto_priv.471 jerryscript/jerry-core/vm/vm.c:745 #21 0x566236d3 in vm_execute jerryscript/jerry-core/vm/vm.c:4199 #22 0x56623c44 in vm_run jerryscript/jerry-core/vm/vm.c:4301 #23 0x56657f90 in vm_run_global jerryscript/jerry-core/vm/vm.c:320 #24 0x566dd750 in jerry_run jerryscript/jerry-core/api/jerry.c:593 #25 0x566d9d21 in main jerryscript/jerry-main/main-unix.c:748 #26 0xf77b6e80 in __libc_start_main (/lib/i386-linux-gnu/libc.so.6+0x18e80) SUMMARY: AddressSanitizer: heap-use-after-free jerryscript/jerry-core/ecma/base/ecma-helpers-string.c:831 in ecma_ref_ecma_string Shadow bytes around the buggy address: 0x3ea3fff0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x3ea40000: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x3ea40010: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x3ea40020: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x3ea40030: fa fa fa fa fa fa fa fa fa fa fd fd fa fa fd fd =>0x3ea40040: fa fa fd fd fa fa 00 04 fa fa[fd]fd fa fa 00 fa 0x3ea40050: fa fa 00 fa fa fa 00 04 fa fa 00 00 fa fa 00 07 0x3ea40060: fa fa 00 00 fa fa 00 07 fa fa fd fd fa fa 00 06 0x3ea40070: fa fa 00 06 fa fa 00 00 fa fa 00 05 fa fa 00 05 0x3ea40080: fa fa 00 00 fa fa 00 00 fa fa 00 00 fa fa 00 00 0x3ea40090: fa fa 00 00 fa fa 00 07 fa fa 00 00 fa fa 00 00 Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb ==32593==ABORTING ``` <sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [grammarinator](https://github.com/renatahodovan/grammarinator). </sup>
heap-use-after-free in ecma_ref_ecma_string
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3580/comments
0
2020-02-22T17:03:27Z
2020-03-02T09:28:14Z
https://github.com/jerryscript-project/jerryscript/issues/3580
569,362,362
3,580
[ "jerryscript-project", "jerryscript" ]
###### JerryScript revision 68909fc5 ###### Build platform Linux-4.15.0-74-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 ```javascript for (let i of $) function $() {} ``` ###### Output ```text ICE: Assertion 'literal_index < PARSER_REGISTER_START || !has_context' failed at jerryscript/jerry-core/parser/js/js-parser-statm.c(parser_parse_for_statement_start):1373. Error: ERR_FAILED_INTERNAL_ASSERTION ``` ###### Backtrace ```text 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 0x5657d290 in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-port/default/default-fatal.c:30 #4 0x5662c5d7 in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:63 #5 0x5662c618 in jerry_assert_fail (assertion=0x566e2e20 "literal_index < PARSER_REGISTER_START || !has_context", file=0x566e2240 "jerryscript/jerry-core/parser/js/js-parser-statm.c", function=0x566d1260 <__func__.5807.lto_priv.236> "parser_parse_for_statement_start", line=1373) at jerryscript/jerry-core/jrt/jrt-fatals.c:87 #6 0x565b3fe1 in parser_parse_for_statement_start.lto_priv.224 (context_p=0xffffc4a0) at jerryscript/jerry-core/parser/js/js-parser-statm.c:1373 #7 0x5657054c in parser_parse_statements (context_p=0xffffc4a0) at jerryscript/jerry-core/parser/js/js-parser-statm.c:2868 #8 0x5663ad5f in parser_parse_source (arg_list_p=0x0, arg_list_size=0, source_p=0x56738760 <buffer.lto_priv> "'use strict' ; \ntry { eval ( 'for (var i = 0 in {}) {}' ) ; \nString ( false ) ; \n} catch ( e ) { String ( e instanceof SyntaxError ) ; \n} \ntry { eval ( 'for (var = i of {}) {}' ) ; \nString ( false ) ;"..., source_size=701, parse_opts=0, error_location_p=0xffffc6b0) at jerryscript/jerry-core/parser/js/js-parser.c:2113 #9 0x5663e334 in parser_parse_script (arg_list_p=0x0, arg_list_size=0, source_p=0x56738760 <buffer.lto_priv> "'use strict' ; \ntry { eval ( 'for (var i = 0 in {}) {}' ) ; \nString ( false ) ; \n} catch ( e ) { String ( e instanceof SyntaxError ) ; \n} \ntry { eval ( 'for (var = i of {}) {}' ) ; \nString ( false ) ;"..., source_size=701, parse_opts=0, bytecode_data_p=0xffffc770) at jerryscript/jerry-core/parser/js/js-parser.c:2624 #10 0x566910f8 in jerry_parse (resource_name_p=0xffffcd93 "/home/reni/.fuzzinator_16690//jerryscript/picireny/112064616884918566181845407146609092378.js", resource_name_length=93, source_p=0x56738760 <buffer.lto_priv> "'use strict' ; \ntry { eval ( 'for (var i = 0 in {}) {}' ) ; \nString ( false ) ; \n} catch ( e ) { String ( e instanceof SyntaxError ) ; \n} \ntry { eval ( 'for (var = i of {}) {}' ) ; \nString ( false ) ;"..., source_size=701, parse_opts=0) at jerryscript/jerry-core/api/jerry.c:445 #11 0x5668dcd9 in main (argc=2, argv=0xffffcb24) at jerryscript/jerry-main/main-unix.c:739 ``` <sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [grammarinator](https://github.com/renatahodovan/grammarinator). </sup>
Assertion literal_index < PARSER_REGISTER_START || !has_context in parser_parse_for_statement_start
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3579/comments
1
2020-02-22T10:37:44Z
2020-03-16T13:59:56Z
https://github.com/jerryscript-project/jerryscript/issues/3579
569,316,075
3,579
[ "jerryscript-project", "jerryscript" ]
As ES6 standard says in [19.4.2.2 - 19.4.2.14](https://www.ecma-international.org/ecma-262/6.0/#sec-symbol.hasinstance) Symbol properties should have the attributes set to **false**. { [[Writable]]: **false**, [[Enumerable]]: **false**, [[Configurable]]: **false** }. ###### Test code: ```js ["hasInstance", "isConcatSpreadable", "iterator", "keyFor", "match", "prototype", "replace", "search", "species", "split", "toPrimitive", "toStringTag", "unscopables"].forEach(function (v) { var desc = Object.getOwnPropertyDescriptor(Symbol, v) print("Symbol." + v + ":", desc.writable, desc.enumerable, desc.configurable); }); ``` ###### Output: ``` Symbol.hasInstance: true false true Symbol.isConcatSpreadable: true false true Symbol.iterator: true false true Symbol.keyFor: true false true Symbol.match: true false true Symbol.prototype: false false false Symbol.replace: true false true Symbol.search: true false true Symbol.species: true false true Symbol.split: true false true Symbol.toPrimitive: true false true Symbol.toStringTag: true false true Symbol.unscopables: true false true ``` ###### Expected output: ``` Symbol.hasInstance: false false false Symbol.isConcatSpreadable: false false false Symbol.iterator: false false false Symbol.keyFor: true false true Symbol.match: false false false Symbol.prototype: false false false Symbol.replace: false false false Symbol.search: false false false Symbol.species: false false false Symbol.split: false false false Symbol.toPrimitive: false false false Symbol.toStringTag: false false false Symbol.unscopables: false false false ``` As I checked, this bug comes from #3490 . I think that **INTRINSIC_PROPERTY** macro should have flag parameter set to **ECMA_PROPERTY_FIXED** . But this will also change behaviour of other properties created with that macro: * _Array.prototype.values_ * _Array.prototype[Symbol.iterator]_ These properties should have { [[Writable]]: **true**, [[Enumerable]]: **false**, [[Configurable]]: **true** }, as stated in [ES 6 17](https://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-standard-built-in-objects) So it looks like other macro is needed, i.e. **INTRINSIC_PROPERTY_CONFIGURABLE.** Does it sound reasonable? If yes, then I could implement this and add some tests.
Symbol properties have invalid attributes
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3578/comments
2
2020-02-21T14:46:44Z
2020-02-24T13:06:15Z
https://github.com/jerryscript-project/jerryscript/issues/3578
568,998,634
3,578
[ "jerryscript-project", "jerryscript" ]
When building with `JERRY_LINE_INFO` enabled, generating and executing a snapshot seems to ignore the `resource_name` argument provided to `jerry_generate_snapshot_with_args`, meaning that when you attempt to get a backtrace, one is never available.
resource_name is undefined when executing from a snapshot
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3577/comments
2
2020-02-21T13:26:55Z
2020-05-28T10:33:53Z
https://github.com/jerryscript-project/jerryscript/issues/3577
568,954,414
3,577
[ "jerryscript-project", "jerryscript" ]
To conform compatibility with ES6 some of the Math functions need to be implemented. List of missing features: - [x] Math.acosh [ES v6, 20.2.2.3](https://www.ecma-international.org/ecma-262/6.0/#sec-math.acosh) - [x] Math.asinh [ES v6, 20.2.2.5](https://www.ecma-international.org/ecma-262/6.0/#sec-math.asinh) - [x] Math.atanh [ES v6, 20.2.2.7](https://www.ecma-international.org/ecma-262/6.0/#sec-math.atanh) - [x] Math.cbrt [ES v6, 20.2.2.9](https://www.ecma-international.org/ecma-262/6.0/#sec-math.cbrt) - [x] Math.clz32 [ES v6, 20.2.2.11](https://www.ecma-international.org/ecma-262/6.0/#sec-math.clz32) - [x] Math.cosh [ES v6, 20.2.2.13](https://www.ecma-international.org/ecma-262/6.0/#sec-math.cosh) - [x] Math.expm1 [ES v6, 20.2.2.15](https://www.ecma-international.org/ecma-262/6.0/#sec-math.expm1) - [x] Math.fround [ES v6, 20.2.2.17](https://www.ecma-international.org/ecma-262/6.0/#sec-math.fround) - [x] Math.hypot [ES v6, 20.2.2.18](https://www.ecma-international.org/ecma-262/6.0/#sec-math.hypot) - [x] Math.imul [ES v6, 20.2.2.19](https://www.ecma-international.org/ecma-262/6.0/#sec-math.imul) - [x] Math.log1p [ES v6, 20.2.2.21](https://www.ecma-international.org/ecma-262/6.0/#sec-math.log1p) - [x] Math.log10 [ES v6, 20.2.2.22](https://www.ecma-international.org/ecma-262/6.0/#sec-math.log10) - [x] Math.log2 [ES v6, 20.2.2.23](https://www.ecma-international.org/ecma-262/6.0/#sec-math.log2) - [x] Math.sinh [ES v6, 20.2.2.31](https://www.ecma-international.org/ecma-262/6.0/#sec-math.sinh) - [x] Math.tanh [ES v6, 20.2.2.34](https://www.ecma-international.org/ecma-262/6.0/#sec-math.tanh)
Implement missing Math functions from ES6 standard
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3568/comments
6
2020-02-19T12:39:59Z
2020-04-21T11:53:25Z
https://github.com/jerryscript-project/jerryscript/issues/3568
567,542,203
3,568
[ "jerryscript-project", "jerryscript" ]
Callback function of Map.prototype.forEach and Set.prototype.forEach does not provide third argument, which is object that is being traversed as wrote in [ES6 23.1.3.5](https://www.ecma-international.org/ecma-262/6.0/#sec-map.prototype.foreach) (map) and ES6 [23.2.3.6](https://www.ecma-international.org/ecma-262/6.0/#sec-set.prototype.foreach) (set). ###### Test code: ```js var map = new Map(); map.set('foo', 42); map.set('bar', 'baz'); map.forEach(function(value, key, thisArg) { assert(typeof thisArg === "object"); assert(thisArg === map); }); ``` ###### Output: ``` Script Error: assertion failed Aborted (core dumped) ``` ###### Expected Output: _None_
Map.forEach and Set.forEach callback does not provide third argument
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3564/comments
1
2020-02-18T11:09:39Z
2020-02-18T18:22:09Z
https://github.com/jerryscript-project/jerryscript/issues/3564
566,818,770
3,564
[ "jerryscript-project", "jerryscript" ]
###### JerryScript revision v2.2.0 5fdeb7c ###### Build platform win10 for x64 ###### Build steps 1. open cmake gui 2. configure vs2019 compilation target win32 3. change "JERRY_PROFILE" to "es2015-subset" 3. open project and build debug version ###### Build log success ###### Test case no ###### Execution platform win32 ###### Execution steps 1. open jerry.exe 2. input "const a = new Uint8Array([1,2,3])" 3. input "a" ###### Output ``` jerry> const a = new Uint8Array([1,2,3]) undefined jerry> a ``` ###### Backtrace ``` 0: <eval>:1 Script Error: ReferenceError: a is not defined ``` ###### Expected behavior 1,2,3 ###### Other problems Why the console prompts undefined, I have turned on all options in cmake-gui, including jerry-logging, jerry-debugger, jerry-error_message, then how to load the extension containing the console function
const variable prompt undefined
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3561/comments
1
2020-02-15T11:10:22Z
2020-02-21T12:30:50Z
https://github.com/jerryscript-project/jerryscript/issues/3561
565,733,475
3,561
[ "jerryscript-project", "jerryscript" ]
Hello, I have a request about es6 benchmark suite. The current process of implementing new es6 features looks not optimal because developer should manually add test files. How about using es6-version `test262` (https://github.com/tc39/test262)? test262 tests each language feature in a single file, so it would help finding bugs and eventually speed up development. (I found that JerryScript already has test262 suite but it is for es5.1) Thanks.
Benchmark test for ES2015
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3555/comments
5
2020-02-13T02:47:00Z
2020-05-19T08:07:09Z
https://github.com/jerryscript-project/jerryscript/issues/3555
564,403,931
3,555
[ "jerryscript-project", "jerryscript" ]
(my second bug report here. I apologize in advance for any mistakes) ###### JerryScript revision 5fdeb7c1d68e8c5209e186e1760bc703a723d588 ###### Build platform Debian GNU/Linux 10 (buster) (Linux 4.19.0-6-686-pae i686) ###### Build steps ``` CXX=afl-clang-fast++ CC=afl-clang-fast python tools/build.py --debug --clean --lto OFF ``` afl-clang-fast (and ++ version) built against `clang version 6.0.1-10 (tags/RELEASE_601/final)` ###### Test case ``` (function(){try{}catch(e){function e ``` ###### Output `Aborted` ###### Backtrace Valgrind output: ``` ==5914== Process terminating with default action of signal 6 (SIGABRT) ==5914== at 0x4079382: raise (raise.c:51) ==5914== by 0x40632B5: abort (abort.c:79) ==5914== by 0x80EFD4D: jerry_port_fatal (default-fatal.c:30) ==5914== by 0x8090F6D: jerry_fatal (jrt-fatals.c:63) ==5914== by 0x8090FAB: jerry_assert_fail (jrt-fatals.c:87) ==5914== by 0x809FBFF: scanner_is_context_needed (js-scanner-util.c:1605) ==5914== by 0x80E0FD0: parser_parse_try_statement_end (js-parser-statm.c:1897) ==5914== by 0x80E0FD0: parser_parse_statements (js-parser-statm.c:3123) ==5914== by 0x8098472: parser_parse_function (js-parser.c:2415) ==5914== by 0x80E04B4: parser_parse_function_statement (js-parser-statm.c:719) ==5914== by 0x80E04B4: parser_parse_statements (js-parser-statm.c:2780) ==5914== by 0x8098472: parser_parse_function (js-parser.c:2415) ==5914== by 0x80E04B4: parser_parse_function_statement (js-parser-statm.c:719) ==5914== by 0x80E04B4: parser_parse_statements (js-parser-statm.c:2780) ==5914== by 0x8098472: parser_parse_function (js-parser.c:2415) ```
Assertion (type == SCANNER_STREAM_TYPE_VAR) in scanner_is_context_needed
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3554/comments
2
2020-02-13T02:44:42Z
2020-03-17T12:07:00Z
https://github.com/jerryscript-project/jerryscript/issues/3554
564,403,349
3,554
[ "jerryscript-project", "jerryscript" ]
(my first bug report here. I apologize in advance for any mistakes) ###### JerryScript revision 5fdeb7c1d68e8c5209e186e1760bc703a723d588 ###### Build platform Debian GNU/Linux 10 (buster) (Linux 4.19.0-6-686-pae i686) ###### Build steps ``` CXX=afl-clang-fast++ CC=afl-clang-fast python tools/build.py --debug --clean --lto OFF ``` afl-clang-fast (and ++ version) built against `clang version 6.0.1-10 (tags/RELEASE_601/final)` ###### Build log Copy the build log if the reported issue is a build problem. Do a verbose build if necessary. Try and trim the log to relevant parts. ###### Test case ``` 0?0:0+++++0 ``` ###### Output `Aborted` ###### Backtrace Valgrind output: ``` ==7815== Process terminating with default action of signal 6 (SIGABRT) ==7815== at 0x4079382: raise (raise.c:51) ==7815== by 0x40632B5: abort (abort.c:79) ==7815== by 0x80EFD4D: jerry_port_fatal (default-fatal.c:30) ==7815== by 0x8090F6D: jerry_fatal (jrt-fatals.c:63) ==7815== by 0x8090FAB: jerry_assert_fail (jrt-fatals.c:87) ==7815== by 0x809C43E: parser_parse_source (js-parser.c:2143) ==7815== by 0x809C43E: parser_parse_script (js-parser.c:2639) ==7815== by 0x804EDA7: jerry_parse (jerry.c:445) ==7815== by 0x804A00D: main (main-unix.c:739) ```
Assertion (context.status_flags & PARSER_SCANNING_SUCCESSFUL) in parser_parse_source
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3553/comments
0
2020-02-13T02:42:22Z
2020-03-16T13:44:39Z
https://github.com/jerryscript-project/jerryscript/issues/3553
564,402,717
3,553
[ "jerryscript-project", "jerryscript" ]
Hi there, I have a question about compilation methodology of JerryScript. It seems that JerryScript generates all bytecode for the whole source code at once (correct me if I'm wrong). I think that it is inefficient for memory consumption because this approach holds the entire bytecode in memory but only part of source code is simultaneously executed during the runtime. Is there any special reason for eager compilation? And I have one more question. Do you have any plan to implement the latest ECMA standard such as es10? I ask you this because I also want to contribute to this project, so I'm searching for items now.
Why does JerryScript generate the all bytecode at once?
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3548/comments
2
2020-02-07T07:53:26Z
2020-02-10T04:47:30Z
https://github.com/jerryscript-project/jerryscript/issues/3548
561,477,516
3,548
[ "jerryscript-project", "jerryscript" ]
Building JerryScript Zephyr port with the latest Zephyr SDK 0.11.1, based on GCC 9.2.0, I get an error like: ~~~ In file included from /mnt/hdd/opt/zephyr-sdk-0.11.1/x86_64-zephyr-elf/x86_64-zephyr-elf/include/string.h:180, from /home/pfalcon/projects-3rdparty/Embedded/Zephyr/jerryscript/jerry-core/jrt/jrt.h:20, from /home/pfalcon/projects-3rdparty/Embedded/Zephyr/jerryscript/jerry-core/ecma/base/ecma-globals.h:20, from /home/pfalcon/projects-3rdparty/Embedded/Zephyr/jerryscript/jerry-core/debugger/debugger.h:19, from /home/pfalcon/projects-3rdparty/Embedded/Zephyr/jerryscript/jerry-core/api/jerry.c:18: /home/pfalcon/projects-3rdparty/Embedded/Zephyr/jerryscript/jerry-core/api/jerry.c: In function 'jerry_init': /home/pfalcon/projects-3rdparty/Embedded/Zephyr/jerryscript/jerry-core/api/jerry.c:194:3: error: '__builtin_memset' offset [17, 2144] from the object at 'jerry_global_context' is out of the bounds of referenced subobject 'ecma_builtin_objects' with type 'jmem_cpointer_t[8]' {aka 'short unsigned int[8]'} at offset 0 [-Werror=array-bounds] 194 | memset ((void*)(long) &JERRY_CONTEXT (JERRY_CONTEXT_FIRST_MEMBER), 0, | ^~~~~~ ~~~ This is an obvious false positive, with a compiler trying to outsmart a programmer in its understanding of the program being compiled, and failing. But given the pervasive love for `-Wall`, this is another problem to work around. Full build log can be seen at https://ci.linaro.org/view/lite-iot-ci/job/lite-aeolus-jerryscript/973/PLATFORM=disco_l475_iot1,ZEPHYR_GCC_VARIANT=zephyr,label=docker-xenial-amd64-13/console . ###### JerryScript revision This happens with the latest master, 0d7f26e2c4e7eb57ed277d112dc5bea663111a64. ###### Build platform Zephyr port, with Zephyr 4f1626851b8296a86edb67442d56f4ed5f17dc47 and Zephyr SDK 0.11.1 with: ~~~ $ /home/pfalcon/opt/zephyr-sdk-0.11.1/x86_64-zephyr-elf/bin/x86_64-zephyr-elf-gcc --version x86_64-zephyr-elf-gcc (crosstool-NG 1.24.0.37-3f461da-dirty) 9.2.0 ~~~ ###### Build steps Per the Zephyr port instructions: ~~~ make -f ./targets/zephyr/Makefile.zephyr BOARD=qemu_x86 ~~~ ###### Build log See above.
Apparent array bounds checking warning-as-error false positive with GCC 9.2
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3544/comments
2
2020-02-06T04:24:26Z
2020-02-06T13:18:20Z
https://github.com/jerryscript-project/jerryscript/issues/3544
560,770,536
3,544
[ "jerryscript-project", "jerryscript" ]
###### JerryScript revision b73100d9 ###### Build platform Linux-4.15.0-74-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 ```javascript class A { constructor() { var hasProp = $ => {} Object.preventExtensions(hasProp); Object.isSealed(hasProp); } super() { $: $ } } class B extends A { constructor() { super() (super.super) } } new B ``` ###### Output ```text ICE: Assertion 'ECMA_PROPERTY_GET_TYPE (property) == ECMA_PROPERTY_TYPE_NAMEDDATA || ECMA_PROPERTY_GET_TYPE (property) == ECMA_PROPERTY_TYPE_NAMEDACCESSOR || ECMA_PROPERTY_GET_TYPE (property) == ECMA_PROPERTY_TYPE_VIRTUAL' failed at jerryscript/jerry-core/ecma/base/ecma-helpers.c(ecma_is_property_configurable):1128. Error: ERR_FAILED_INTERNAL_ASSERTION ``` ###### Backtrace ```text 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 0x5657d1e7 in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-port/default/default-fatal.c:30 #4 0x56650566 in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:63 #5 0x566505a7 in jerry_assert_fail (assertion=0x566fbf40 "ECMA_PROPERTY_GET_TYPE (property) == ECMA_PROPERTY_TYPE_NAMEDDATA || ECMA_PROPERTY_GET_TYPE (property) == ECMA_PROPERTY_TYPE_NAMEDACCESSOR || ECMA_PROPERTY_GET_TYPE (property) == ECMA_PROPERTY_TYPE_VI"..., file=0x566fad40 "jerryscript/jerry-core/ecma/base/ecma-helpers.c", function=0x566b8640 <__func__.5932.lto_priv.785> "ecma_is_property_configurable", line=1128) at jerryscript/jerry-core/jrt/jrt-fatals.c:87 #6 0x566876a5 in ecma_is_property_configurable (property=0 '\000') at jerryscript/jerry-core/ecma/base/ecma-helpers.c:1126 #7 0x565c9d6b in ecma_builtin_object_frozen_or_sealed_helper (obj_p=0xf5f004c0, mode=97) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-object.c:489 #8 0x565cb107 in ecma_builtin_object_dispatch_routine (builtin_routine_id=97, this_arg=4126147731, arguments_list_p=0xffffbf50, arguments_number=1) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-object.c:1060 #9 0x56698c23 in ecma_builtin_dispatch_routine (builtin_object_id=ECMA_BUILTIN_ID_OBJECT, builtin_routine_id=97, this_arg_value=4126147731, arguments_list_p=0xffffbf50, arguments_list_len=1) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.c:1042 #10 0x56698e84 in ecma_builtin_dispatch_call (obj_p=0xf5f003a0, this_arg_value=4126147731, arguments_list_p=0xffffc244, arguments_list_len=1) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.c:1067 #11 0x5666bca6 in ecma_op_function_call_simple (func_obj_p=0xf5f003a0, this_arg_value=4126147731, arguments_list_p=0xffffc244, arguments_list_len=1) at jerryscript/jerry-core/ecma/operations/ecma-function-object.c:961 #12 0x5666c3c2 in ecma_op_function_call (func_obj_p=0xf5f003a0, this_arg_value=4126147731, arguments_list_p=0xffffc244, arguments_list_len=1) at jerryscript/jerry-core/ecma/operations/ecma-function-object.c:1148 #13 0x5663413a in opfunc_call.lto_priv.482 (frame_ctx_p=0xffffc200) at jerryscript/jerry-core/vm/vm.c:702 #14 0x565e8011 in vm_execute (frame_ctx_p=0xffffc200) at jerryscript/jerry-core/vm/vm.c:4171 #15 0x565e862d in vm_run (bytecode_header_p=0xf4f01ea0, this_binding_value=4124050707, lex_env_p=0xf5d00590, arg_list_p=0xffffc4a0, arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:4294 #16 0x5666bfd2 in ecma_op_function_call_simple (func_obj_p=0xf5f00700, this_arg_value=4124050707, arguments_list_p=0xffffc4a0, arguments_list_len=0) at jerryscript/jerry-core/ecma/operations/ecma-function-object.c:1050 #17 0x5666cfb1 in ecma_op_function_construct (func_obj_p=0xf5f00700, this_arg_value=4124050707, arguments_list_p=0xffffc4a1, arguments_list_len=0) at jerryscript/jerry-core/ecma/operations/ecma-function-object.c:1470 #18 0x5663336e in vm_super_call.lto_priv.481 (frame_ctx_p=0xffffc470) at jerryscript/jerry-core/vm/vm.c:516 #19 0x565e8021 in vm_execute (frame_ctx_p=0xffffc470) at jerryscript/jerry-core/vm/vm.c:4177 #20 0x565e862d in vm_run (bytecode_header_p=0xf6103d40, this_binding_value=4124050707, lex_env_p=0xf5d004f0, arg_list_p=0xffffc6f8, arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:4294 #21 0x5666bfd2 in ecma_op_function_call_simple (func_obj_p=0xf5f005b0, this_arg_value=4124050707, arguments_list_p=0xffffc6f8, arguments_list_len=0) at jerryscript/jerry-core/ecma/operations/ecma-function-object.c:1050 #22 0x5666cfb1 in ecma_op_function_construct (func_obj_p=0xf5f005b0, this_arg_value=4124050707, arguments_list_p=0xffffc6f9, arguments_list_len=0) at jerryscript/jerry-core/ecma/operations/ecma-function-object.c:1470 #23 0x566346d3 in opfunc_construct.lto_priv.479 (frame_ctx_p=0xffffc6c0) at jerryscript/jerry-core/vm/vm.c:787 #24 0x565e804f in vm_execute (frame_ctx_p=0xffffc6c0) at jerryscript/jerry-core/vm/vm.c:4192 #25 0x565e862d in vm_run (bytecode_header_p=0xf4d031d0, this_binding_value=4126149459, lex_env_p=0xf5d007b0, arg_list_p=0x0, arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:4294 #26 0x566329ae in vm_run_global (bytecode_p=0xf4d031d0) at jerryscript/jerry-core/vm/vm.c:286 #27 0x566a1cdb in jerry_run (func_val=4126148499) at jerryscript/jerry-core/api/jerry.c:593 #28 0x5669e33c in main (argc=2, argv=0xffffcb24) at jerryscript/jerry-main/main-unix.c:750 ``` <sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [grammarinator](https://github.com/renatahodovan/grammarinator). </sup>
Assertion ECMA_PROPERTY_GET_TYPE (property) == ECMA_PROPERTY_TYPE_NAMEDDATA || ECMA_PROPERTY_GET_TYPE (property) == ECMA_PROPERTY_TYPE_NAMEDACCESSOR || ECMA_PROPERTY_GET_TYPE (property) == ECMA_PROPERTY_TYPE_VIRTUAL in ecma_is_property_configurable
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3536/comments
0
2020-01-26T22:06:30Z
2020-02-03T14:13:00Z
https://github.com/jerryscript-project/jerryscript/issues/3536
555,295,047
3,536
[ "jerryscript-project", "jerryscript" ]
###### JerryScript revision e693854d ###### Build platform Linux-4.15.0-74-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 ```javascript var array = [$, Infinity] Reflect.preventExtensions(array); var $ = array.pop() ``` ###### Output ```text Script Error: TypeError: Invalid argument type. ICE: Assertion 'JERRY_CONTEXT (jmem_heap_allocated_size) == 0' failed at jerryscript/jerry-core/jmem/jmem-heap.c(jmem_heap_finalize):107. Error: ERR_FAILED_INTERNAL_ASSERTION ``` ###### Backtrace ```text 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 0x5657d1e7 in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-port/default/default-fatal.c:30 #4 0x56650558 in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:63 #5 0x56650599 in jerry_assert_fail (assertion=0x566f26c0 "JERRY_CONTEXT (jmem_heap_allocated_size) == 0", file=0x566f2660 "jerryscript/jerry-core/jmem/jmem-heap.c", function=0x566bdda0 <__func__.5614.lto_priv.134> "jmem_heap_finalize", line=107) at jerryscript/jerry-core/jrt/jrt-fatals.c:87 #6 0x5664f704 in jmem_heap_finalize () at jerryscript/jerry-core/jmem/jmem-heap.c:107 #7 0x5664f52a in jmem_finalize () at jerryscript/jerry-core/jmem/jmem-allocator.c:170 #8 0x566a0fc1 in jerry_cleanup () at jerryscript/jerry-core/api/jerry.c:252 #9 0x5669ec57 in main (argc=2, argv=0xffffcb24) at jerryscript/jerry-main/main-unix.c:974 ``` <sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [grammarinator](https://github.com/renatahodovan/grammarinator). </sup>
Assertion JERRY_CONTEXT (jmem_heap_allocated_size) == 0 in jmem_heap_finalize
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3534/comments
0
2020-01-23T18:48:30Z
2020-01-24T09:54:56Z
https://github.com/jerryscript-project/jerryscript/issues/3534
554,338,106
3,534
[ "jerryscript-project", "jerryscript" ]
###### JerryScript revision 608bc9e5 ###### Build platform Linux-4.15.0-74-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 ```javascript function dConstr () {} dConstr.prototype = [, ] for (var $ in new dConstr()); ``` ###### Output ```text ICE: Assertion 'array_index_name_pos == array_index_named_properties_count' failed at jerryscript/jerry-core/ecma/operations/ecma-objects.c(ecma_op_object_get_property_names):2269. Error: ERR_FAILED_INTERNAL_ASSERTION ``` ###### Backtrace ```text 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 0x5657d1a7 in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-port/default/default-fatal.c:30 #4 0x56650504 in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:63 #5 0x56650545 in jerry_assert_fail (assertion=0x566efaa0 "array_index_name_pos == array_index_named_properties_count", file=0x566eeee0 "jerryscript/jerry-core/ecma/operations/ecma-objects.c", function=0x566bcca0 <__func__.6756.lto_priv.623> "ecma_op_object_get_property_names", line=2269) at jerryscript/jerry-core/jrt/jrt-fatals.c:87 #6 0x5663c452 in ecma_op_object_get_property_names (obj_p=0xf5d00670, opts=6) at jerryscript/jerry-core/ecma/operations/ecma-objects.c:2269 #7 0x56579e33 in opfunc_for_in (left_value=4124051059, result_obj_p=0xffffc5f0) at jerryscript/jerry-core/vm/opcodes.c:270 #8 0x565e343b in vm_loop (frame_ctx_p=0xffffc6c0) at jerryscript/jerry-core/vm/vm.c:3394 #9 0x565e7f6e in vm_execute (frame_ctx_p=0xffffc6c0) at jerryscript/jerry-core/vm/vm.c:4165 #10 0x565e85ee in vm_run (bytecode_header_p=0xf5102b00, this_binding_value=4126149459, lex_env_p=0xf5d007b0, arg_list_p=0x0, arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:4294 #11 0x56632961 in vm_run_global (bytecode_p=0xf5102b00) at jerryscript/jerry-core/vm/vm.c:286 #12 0x566a1a3a in jerry_run (func_val=4126148595) at jerryscript/jerry-core/api/jerry.c:593 #13 0x5669e09b in main (argc=2, argv=0xffffcb24) at jerryscript/jerry-main/main-unix.c:750 ``` <sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [grammarinator](https://github.com/renatahodovan/grammarinator). </sup>
Assertion array_index_name_pos == array_index_named_properties_count in ecma_op_object_get_property_names
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3532/comments
0
2020-01-23T12:12:50Z
2020-01-23T16:21:36Z
https://github.com/jerryscript-project/jerryscript/issues/3532
554,119,863
3,532
[ "jerryscript-project", "jerryscript" ]
I was trying to use jerryscript on esp8266. But the way showing in ["/target/esp8266"](https://github.com/jerryscript-project/jerryscript/blob/master/targets/esp8266/readme.md) is different from ["getting start page"](https://github.com/jerryscript-project/jerryscript/blob/master/docs/00.GETTING-STARTED.md). And I don't know how to build an [API-Example-8](https://github.com/jerryscript-project/jerryscript/blob/master/docs/03.API-EXAMPLE.md#example-8-simple-javascript-shell) for esp8266. Is there anyway to build throw tools/build.py. And can I use AT-Comand after flash jerryscritp into esp8266?
Can I build a esp8266 version throw tools/build.py?
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3528/comments
1
2020-01-20T03:42:16Z
2020-01-20T06:41:33Z
https://github.com/jerryscript-project/jerryscript/issues/3528
552,048,747
3,528
[ "jerryscript-project", "jerryscript" ]
###### JerryScript revision 71d4e121 ###### Build platform Linux-4.15.0-72-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 ```javascript function $({ $: { [$.$] } }) {} ``` ###### Output ```text ICE: Assertion '(literal_p->status_flags & ~(LEXER_FLAG_SOURCE_PTR | LEXER_FLAG_LATE_INIT)) == 0' failed at jerryscript/jerry-core/parser/js/js-parser.c(parser_compute_indicies):166. Error: ERR_FAILED_INTERNAL_ASSERTION ``` ###### Backtrace ```text 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 0x5657d197 in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-port/default/default-fatal.c:30 #4 0x566504cd in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:58 #5 0x5665050e in jerry_assert_fail (assertion=0x566e9340 "(literal_p->status_flags & ~(LEXER_FLAG_SOURCE_PTR | LEXER_FLAG_LATE_INIT)) == 0", file=0x566e9260 "jerryscript/jerry-core/parser/js/js-parser.c", function=0x566c4960 <__func__.5597.lto_priv.41> "parser_compute_indicies", line=166) at jerryscript/jerry-core/jrt/jrt-fatals.c:82 #6 0x5660385f in parser_compute_indicies (context_p=0xffffc490, ident_end=0xffffbe20, const_literal_end=0xffffbde0) at jerryscript/jerry-core/parser/js/js-parser.c:166 #7 0x56605161 in parser_post_processing (context_p=0xffffc490) at jerryscript/jerry-core/parser/js/js-parser.c:949 #8 0x5660e6b9 in parser_parse_function (context_p=0xffffc490, status_flags=6) at jerryscript/jerry-core/parser/js/js-parser.c:2416 #9 0x565b0242 in parser_parse_function_statement.lto_priv.223 (context_p=0xffffc490) at jerryscript/jerry-core/parser/js/js-parser-statm.c:719 #10 0x565701e5 in parser_parse_statements (context_p=0xffffc490) at jerryscript/jerry-core/parser/js/js-parser-statm.c:2774 #11 0x5660bcfe in parser_parse_source (arg_list_p=0x0, arg_list_size=0, source_p=0x56734560 <buffer.lto_priv> "function g ( { [ \"y\" ] : { [ Symbol .toPrimitive ] = 5 } } ) { } \n ", source_size=67, parse_opts=0, error_location_p=0xffffc6a0) at jerryscript/jerry-core/parser/js/js-parser.c:2116 #12 0x5660f341 in parser_parse_script (arg_list_p=0x0, arg_list_size=0, source_p=0x56734560 <buffer.lto_priv> "function g ( { [ \"y\" ] : { [ Symbol .toPrimitive ] = 5 } } ) { } \n ", source_size=67, parse_opts=0, bytecode_data_p=0xffffc760) at jerryscript/jerry-core/parser/js/js-parser.c:2639 #13 0x566a134c in jerry_parse (resource_name_p=0xffffcd7d "/home/reni/.fuzzinator_31942//jerryscript/picireny/63327936987741173392446431556505935214.js", resource_name_length=92, source_p=0x56734560 <buffer.lto_priv> "function g ( { [ \"y\" ] : { [ Symbol .toPrimitive ] = 5 } } ) { } \n ", source_size=67, parse_opts=0) at jerryscript/jerry-core/api/jerry.c:445 #14 0x5669dfc4 in main (argc=2, argv=0xffffcb04) at jerryscript/jerry-main/main-unix.c:741 ``` <sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [grammarinator](https://github.com/renatahodovan/grammarinator). </sup>
Assertion (literal_p->status_flags & ~(LEXER_FLAG_SOURCE_PTR | LEXER_FLAG_LATE_INIT)) == 0 in parser_compute_indicies
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3527/comments
1
2020-01-18T09:43:57Z
2020-01-20T15:49:09Z
https://github.com/jerryscript-project/jerryscript/issues/3527
551,747,092
3,527
[ "jerryscript-project", "jerryscript" ]
Jerry version: Rev: 71d4e121 Build command: tools/build.py --profile=es2015-subset ---error-messages ON OS: Mac OS 10.14.2 **Code sample:** ``` class Base { constructor() { this.x = [0, 0]; } sampeFunc() { this.x[0]++; // crash here return this.x; } } class Extended extends Base { sampeFunc() { var s = super.sampeFunc(); return s; // ok if change to "return super.sampleFunc()" } } var s = new Extended(); s.sampeFunc(); // :( oops ``` **ER:** No crash shouldn't appear. **AR** Crash: _TypeError: Cannot read property '0' of undefined_ Comments: This issue can be related to [this issue](https://github.com/jerryscript-project/jerryscript/issues/2671) As far as I understand line "var s = super.sampleFunc()" should emit "CBC_EXT_SUPER_PROP_CALL". But it doesn't pass this condition "!LEXER_IS_BINARY_LVALUE_TOKEN (context_p->stack_top_uint8)" : js-parser-expr.c:1470
Storing result of "super" call in local var breaks "this" context.
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3526/comments
5
2020-01-17T13:15:59Z
2020-03-16T14:02:00Z
https://github.com/jerryscript-project/jerryscript/issues/3526
551,409,409
3,526
[ "jerryscript-project", "jerryscript" ]
###### JerryScript revision f3d49f65 ###### Build platform Linux-4.15.0-72-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 ```javascript var obj = { sort: Array.prototype.sort, $: 0 } obj.sort() ``` ###### Output ```text ICE: Assertion 'ECMA_STRING_IS_REF_EQUALS_TO_ONE (string_p)' failed at jerryscript/jerry-core/ecma/base/ecma-literal-storage.c(ecma_free_string_list):75. Error: ERR_FAILED_INTERNAL_ASSERTION ``` ###### Backtrace ```text 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 0x5657d197 in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-port/default/default-fatal.c:30 #4 0x56650330 in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:58 #5 0x56650371 in jerry_assert_fail (assertion=0x566fc360 "ECMA_STRING_IS_REF_EQUALS_TO_ONE (string_p)", file=0x566fc2e0 "jerryscript/jerry-core/ecma/base/ecma-literal-storage.c", function=0x566b8540 <__func__.5591.lto_priv.763> "ecma_free_string_list", line=75) at jerryscript/jerry-core/jrt/jrt-fatals.c:82 #6 0x56689ce8 in ecma_free_string_list (string_list_cp=4124050000) at jerryscript/jerry-core/ecma/base/ecma-literal-storage.c:75 #7 0x56689f1b in ecma_finalize_lit_storage () at jerryscript/jerry-core/ecma/base/ecma-literal-storage.c:121 #8 0x56688ad8 in ecma_finalize () at jerryscript/jerry-core/ecma/base/ecma-init-finalize.c:78 #9 0x566a0860 in jerry_cleanup () at jerryscript/jerry-core/api/jerry.c:236 #10 0x5669e799 in main (argc=2, argv=0xffffcb04) at jerryscript/jerry-main/main-unix.c:974 ``` <sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [grammarinator](https://github.com/renatahodovan/grammarinator). </sup>
Assertion ECMA_STRING_IS_REF_EQUALS_TO_ONE (string_p) in ecma_free_string_list
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3523/comments
0
2020-01-16T18:01:05Z
2020-01-17T10:36:40Z
https://github.com/jerryscript-project/jerryscript/issues/3523
550,966,601
3,523
[ "jerryscript-project", "jerryscript" ]
###### JerryScript revision 210b631b ###### Build platform Linux-4.15.0-72-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 ```javascript (function() { [""] = $ }) ``` ###### Output ```text ICE: Assertion '(opcode >= CBC_PRE_INCR && opcode <= CBC_POST_DECR) || (opcode == CBC_ASSIGN && (context_p->token.type == LEXER_ASSIGN || LEXER_IS_BINARY_LVALUE_TOKEN (context_p->token.type)))' failed at jerryscript/jerry-core/parser/js/js-parser-expr.c(parser_check_invalid_new_target):127. Error: ERR_FAILED_INTERNAL_ASSERTION ``` ###### Backtrace ```text 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 0x5657ce9d in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-port/default/default-fatal.c:30 #4 0x5665089b in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:58 #5 0x566508dc in jerry_assert_fail (assertion=0x566dc840 "(opcode >= CBC_PRE_INCR && opcode <= CBC_POST_DECR) || (opcode == CBC_ASSIGN && (context_p->token.type == LEXER_ASSIGN || LEXER_IS_BINARY_LVALUE_TOKEN (context_p->token.type)))", file=0x566dc680 "jerryscript/jerry-core/parser/js/js-parser-expr.c", function=0x566cbd20 <__func__.5589.lto_priv.38> "parser_check_invalid_new_target", line=127) at jerryscript/jerry-core/jrt/jrt-fatals.c:82 #6 0x5659af2e in parser_check_invalid_new_target (context_p=0xffffc4a0, opcode=CBC_ASSIGN) at jerryscript/jerry-core/parser/js/js-parser-expr.c:124 #7 0x565a3805 in parser_append_binary_single_assignment_token (context_p=0xffffc4a0, assign_ident_opcode=211 '\323') at jerryscript/jerry-core/parser/js/js-parser-expr.c:2211 #8 0x565a5367 in parser_pattern_form_assignment (context_p=0xffffc4a0, flags=PARSER_PATTERN_NO_OPTS, rhs_opcode=96, literal_index=65535, ident_line_counter=3) at jerryscript/jerry-core/parser/js/js-parser-expr.c:2527 #9 0x565a5eaf in parser_pattern_process_assignment (context_p=0xffffc4a0, flags=PARSER_PATTERN_NO_OPTS, rhs_opcode=96, literal_index=65535, end_type=LEXER_RIGHT_SQUARE) at jerryscript/jerry-core/parser/js/js-parser-expr.c:2701 #10 0x565a6121 in parser_parse_array_initializer (context_p=0xffffc4a0, flags=PARSER_PATTERN_NO_OPTS) at jerryscript/jerry-core/parser/js/js-parser-expr.c:2737 #11 0x565a0a6a in parser_parse_unary_expression (context_p=0xffffc4a0, grouping_level_p=0xffffb9f0) at jerryscript/jerry-core/parser/js/js-parser-expr.c:1581 #12 0x565a79e9 in parser_parse_expression (context_p=0xffffc4a0, options=2) at jerryscript/jerry-core/parser/js/js-parser-expr.c:3036 #13 0x565a7741 in parser_parse_expression_statement (context_p=0xffffc4a0, options=0) at jerryscript/jerry-core/parser/js/js-parser-expr.c:2996 #14 0x56571091 in parser_parse_statements (context_p=0xffffc4a0) at jerryscript/jerry-core/parser/js/js-parser-statm.c:3056 #15 0x5660e98d in parser_parse_function (context_p=0xffffc4a0, status_flags=14) at jerryscript/jerry-core/parser/js/js-parser.c:2402 #16 0x56595a6d in lexer_construct_function_object (context_p=0xffffc4a0, extra_status_flags=14) at jerryscript/jerry-core/parser/js/js-lexer.c:2492 #17 0x5659e329 in parser_parse_function_expression (context_p=0xffffc4a0, status_flags=14) at jerryscript/jerry-core/parser/js/js-parser-expr.c:1136 #18 0x565a07c2 in parser_parse_unary_expression (context_p=0xffffc4a0, grouping_level_p=0xffffbfc0) at jerryscript/jerry-core/parser/js/js-parser-expr.c:1558 #19 0x565a79e9 in parser_parse_expression (context_p=0xffffc4a0, options=2) at jerryscript/jerry-core/parser/js/js-parser-expr.c:3036 #20 0x565a73b7 in parser_parse_block_expression (context_p=0xffffc4a0, options=0) at jerryscript/jerry-core/parser/js/js-parser-expr.c:2975 #21 0x565710a7 in parser_parse_statements (context_p=0xffffc4a0) at jerryscript/jerry-core/parser/js/js-parser-statm.c:3060 #22 0x5660bfe0 in parser_parse_source (arg_list_p=0x0, arg_list_size=0, source_p=0x56733280 <buffer.lto_priv> "( function ( ) { new Promise ( isFinite .toString ) \n} ) ( ) ; \n( function ( ) { [ 'A' ] = [ ] \n} ) ( { } ) \n ", source_size=111, parse_opts=0, error_location_p=0xffffc6b0) at jerryscript/jerry-core/parser/js/js-parser.c:2103 #23 0x5660f623 in parser_parse_script (arg_list_p=0x0, arg_list_size=0, source_p=0x56733280 <buffer.lto_priv> "( function ( ) { new Promise ( isFinite .toString ) \n} ) ( ) ; \n( function ( ) { [ 'A' ] = [ ] \n} ) ( { } ) \n ", source_size=111, parse_opts=0, bytecode_data_p=0xffffc770) at jerryscript/jerry-core/parser/js/js-parser.c:2626 #24 0x566a1838 in jerry_parse (resource_name_p=0xffffcd7c "/home/reni/.fuzzinator_31942//jerryscript/picireny/299222989790379317439802882557105746447.js", resource_name_length=93, source_p=0x56733280 <buffer.lto_priv> "( function ( ) { new Promise ( isFinite .toString ) \n} ) ( ) ; \n( function ( ) { [ 'A' ] = [ ] \n} ) ( { } ) \n ", source_size=111, parse_opts=0) at jerryscript/jerry-core/api/jerry.c:445 #25 0x5669e575 in main (argc=2, argv=0xffffcb04) at jerryscript/jerry-main/main-unix.c:731 ``` <sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [grammarinator](https://github.com/renatahodovan/grammarinator). </sup>
Assertion (opcode >= CBC_PRE_INCR && opcode <= CBC_POST_DECR) || (opcode == CBC_ASSIGN && (context_p->token.type == LEXER_ASSIGN || LEXER_IS_BINARY_LVALUE_TOKEN (context_p->token.type))) in parser_check_invalid_new_target
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3519/comments
0
2020-01-14T21:17:40Z
2020-01-16T15:04:00Z
https://github.com/jerryscript-project/jerryscript/issues/3519
549,823,545
3,519
[ "jerryscript-project", "jerryscript" ]
###### JerryScript revision b6c2e6eb ###### Build platform Linux-4.15.0-72-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 ```javascript var array = []; array.length = 4294967295; var $ = array.slice() ``` ###### Output ```text ICE: Assertion 'object_p != NULL' failed at jerryscript/jerry-core/ecma/base/ecma-helpers-value.c(ecma_make_object_value):630. Error: ERR_FAILED_INTERNAL_ASSERTION ``` ###### Backtrace ```text 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 0x5657cd84 in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-port/default/default-fatal.c:30 #4 0x5664fd10 in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:58 #5 0x5664fd51 in jerry_assert_fail (assertion=0x566f8380 "object_p != NULL", file=0x566f7f20 "jerryscript/jerry-core/ecma/base/ecma-helpers-value.c", function=0x566b5ca0 <__func__.4359.lto_priv.87> "ecma_make_object_value", line=630) at jerryscript/jerry-core/jrt/jrt-fatals.c:82 #6 0x56681b27 in ecma_make_object_value (object_p=0x0) at jerryscript/jerry-core/ecma/base/ecma-helpers-value.c:630 #7 0x5665e717 in ecma_op_array_species_create (original_array_p=0xf5f01300, length=4294967295) at jerryscript/jerry-core/ecma/operations/ecma-array-object.c:707 #8 0x565f511b in ecma_builtin_array_prototype_object_slice (arg1=4126148401, arg2=72, obj_p=0xf5f01300, len=4294967295) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype.c:833 #9 0x565faafa in ecma_builtin_array_prototype_dispatch_routine (builtin_routine_id=86, this_arg=4126151427, arguments_list_p=0xffffc440, arguments_number=1) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype.c:2648 #10 0x566990cb in ecma_builtin_dispatch_routine (builtin_object_id=ECMA_BUILTIN_ID_ARRAY_PROTOTYPE, builtin_routine_id=86, this_arg_value=4126151427, arguments_list_p=0xffffc440, arguments_list_len=1) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.c:1020 #11 0x5669932c in ecma_builtin_dispatch_call (obj_p=0xf5f004c0, this_arg_value=4126151427, arguments_list_p=0xffffc6ec, arguments_list_len=1) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.c:1045 #12 0x5666b86c in ecma_op_function_call (func_obj_p=0xf5f004c0, this_arg_value=4126151427, arguments_list_p=0xffffc6ec, arguments_list_len=1) at jerryscript/jerry-core/ecma/operations/ecma-function-object.c:762 #13 0x56633955 in opfunc_call.lto_priv.466 (frame_ctx_p=0xffffc6b0) at jerryscript/jerry-core/vm/vm.c:699 #14 0x565e784b in vm_execute (frame_ctx_p=0xffffc6b0) at jerryscript/jerry-core/vm/vm.c:4117 #15 0x565e7e76 in vm_run (bytecode_header_p=0xf4f03780, this_binding_value=4126149459, lex_env_p=0xf5d007b0, arg_list_p=0x0, arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:4240 #16 0x5663227a in vm_run_global (bytecode_p=0xf4f03780) at jerryscript/jerry-core/vm/vm.c:286 #17 0x566a0c9f in jerry_run (func_val=4126148355) at jerryscript/jerry-core/api/jerry.c:595 #18 0x5669d3cc in main (argc=2, argv=0xffffcb04) at jerryscript/jerry-main/main-unix.c:740 ``` <sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [grammarinator](https://github.com/renatahodovan/grammarinator). </sup>
Assertion object_p != NULL in ecma_make_object_value
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3506/comments
0
2020-01-10T17:46:51Z
2020-01-14T14:35:50Z
https://github.com/jerryscript-project/jerryscript/issues/3506
548,209,712
3,506
[ "jerryscript-project", "jerryscript" ]
Hi , all I have noted many jerry APIs are marked as `release_value` needed for the returned value of those API, for example, [jerry_create_array](https://github.com/jerryscript-project/jerryscript/blob/master/jerry-core/api/jerry.c#L1372). And for some APIs, such as `jerry_create_undefined()`, that note is not declared in code, but in some documents, the sample code is showing the jerry_release_value() is needed for them. For example, the 'jerry_create_bool()' mentioned [here](https://github.com/jerryscript-project/jerryscript/blob/master/docs/06.REFERENCE-COUNTING.md). Just want to confirm, if we called jerry_create_undefined()/jerry_create_bool() by ourself, should we remember to call **jerry_release_value** to release it somewhere?
[question] jerry_release_value() for jerry_create_undefined()?
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3500/comments
4
2020-01-08T12:36:46Z
2020-01-09T02:25:29Z
https://github.com/jerryscript-project/jerryscript/issues/3500
546,834,471
3,500
[ "jerryscript-project", "jerryscript" ]
###### JerryScript revision It started to assert since 40d930d62c518361218e232d8600a9960472776b , but valid on ToT too. ###### Build platform platform independent ###### Build steps $ tools/build.py --debug --clean --error-messages=ON --logging=ON ###### Test case tests/jerry/fail/regression-test-issue-1871-1.js tests/jerry/fail/regression-test-issue-1871-2.js ###### Output ICE: Assertion 'lit_is_valid_cesu8_string (string_p, string_size)' failed at /home/oszi/jerryscript/jerry-core/ecma/base/ecma-helpers-string.c(ecma_new_ecma_string_from_utf8):378. Error: ERR_FAILED_INTERNAL_ASSERTION Aborted (core dumped) Unfortunately we didn't catch this assert previously, because it is an expected failing test and the test runner accepts crash/assert as normal fail.
ICE: Assertion 'lit_is_valid_cesu8_string (string_p, string_size)'
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3498/comments
1
2020-01-07T18:05:15Z
2020-01-14T14:11:59Z
https://github.com/jerryscript-project/jerryscript/issues/3498
546,428,336
3,498
[ "jerryscript-project", "jerryscript" ]
###### JerryScript revision fa2ddb24 ###### Build platform Linux-4.15.0-72-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 ```javascript var a = new Float32Array([$]) var $ = a.map(function () { $() }) ``` ###### Output ```text Script Error: ReferenceError: result is not defined ICE: Assertion 'JERRY_CONTEXT (jmem_heap_allocated_size) == 0' failed at jerryscript/jerry-core/jmem/jmem-heap.c(jmem_heap_finalize):107. Error: ERR_FAILED_INTERNAL_ASSERTION ``` ###### Backtrace ```text 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 0x5657cd57 in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-port/default/default-fatal.c:30 #4 0x5664f909 in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:58 #5 0x5664f94a in jerry_assert_fail (assertion=0x566efdc0 "JERRY_CONTEXT (jmem_heap_allocated_size) == 0", file=0x566efd60 "jerryscript/jerry-core/jmem/jmem-heap.c", function=0x566bb9e0 <__func__.5593.lto_priv.126> "jmem_heap_finalize", line=107) at jerryscript/jerry-core/jrt/jrt-fatals.c:82 #6 0x5664eada in jmem_heap_finalize () at jerryscript/jerry-core/jmem/jmem-heap.c:107 #7 0x5664e90a in jmem_finalize () at jerryscript/jerry-core/jmem/jmem-allocator.c:170 #8 0x5669fcc4 in jerry_cleanup () at jerryscript/jerry-core/api/jerry.c:252 #9 0x5669d92d in main (argc=2, argv=0xffffcb04) at jerryscript/jerry-main/main-unix.c:938 ``` <sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [grammarinator](https://github.com/renatahodovan/grammarinator). </sup>
Assertion JERRY_CONTEXT (jmem_heap_allocated_size) == 0 in jmem_heap_finalize
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3485/comments
1
2020-01-06T10:48:54Z
2020-01-07T14:14:33Z
https://github.com/jerryscript-project/jerryscript/issues/3485
545,663,745
3,485
[ "jerryscript-project", "jerryscript" ]
###### JerryScript revision e21e4a18 ###### Build platform Linux-4.15.0-72-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 ```javascript eval('Setting `o.bar` to'); ``` ###### Output ```text ICE: Assertion 'object_p->type_flags_refs >= ECMA_OBJECT_REF_ONE' failed at jerryscript/jerry-core/ecma/base/ecma-gc.c(ecma_deref_object):147. Error: ERR_FAILED_INTERNAL_ASSERTION ``` ###### Backtrace ```text 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 0x5657bd39 in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-port/default/default-fatal.c:30 #4 0x5664e309 in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:58 #5 0x5664e34a in jerry_assert_fail (assertion=0x566fe360 "object_p->type_flags_refs >= ECMA_OBJECT_REF_ONE", file=0x566fe300 "jerryscript/jerry-core/ecma/base/ecma-gc.c", function=0x566b4120 <__func__.6158.lto_priv.905> "ecma_deref_object", line=147) at jerryscript/jerry-core/jrt/jrt-fatals.c:82 #6 0x566aa71f in ecma_deref_object (object_p=0xf5f0f970) at jerryscript/jerry-core/ecma/base/ecma-gc.c:147 #7 0x566833c8 in ecma_free_value (value=4126210419) at jerryscript/jerry-core/ecma/base/ecma-helpers-value.c:1044 #8 0x566b0484 in ecma_collection_free (collection_p=0xf5d079f0) at jerryscript/jerry-core/ecma/base/ecma-helpers-collection.c:111 #9 0x5660b10b in parser_raise_error (context_p=0xffffbe40, error=PARSER_ERR_SEMICOLON_EXPECTED) at jerryscript/jerry-core/parser/js/js-parser.c:2570 #10 0x56572870 in parser_parse_statements (context_p=0xffffbe40) at jerryscript/jerry-core/parser/js/js-parser-statm.c:3152 #11 0x5660a577 in parser_parse_function (context_p=0xffffbe40, status_flags=14) at jerryscript/jerry-core/parser/js/js-parser.c:2390 #12 0x56595aaa in lexer_construct_function_object (context_p=0xffffbe40, extra_status_flags=14) at jerryscript/jerry-core/parser/js/js-lexer.c:2490 #13 0x5659e147 in parser_parse_function_expression (context_p=0xffffbe40, status_flags=14) at jerryscript/jerry-core/parser/js/js-parser-expr.c:1102 #14 0x565a0547 in parser_parse_unary_expression (context_p=0xffffbe40, grouping_level_p=0xffffb960) at jerryscript/jerry-core/parser/js/js-parser-expr.c:1508 #15 0x565a7712 in parser_parse_expression (context_p=0xffffbe40, options=2) at jerryscript/jerry-core/parser/js/js-parser-expr.c:2969 #16 0x565a70e0 in parser_parse_block_expression (context_p=0xffffbe40, options=0) at jerryscript/jerry-core/parser/js/js-parser-expr.c:2908 #17 0x56572055 in parser_parse_statements (context_p=0xffffbe40) at jerryscript/jerry-core/parser/js/js-parser-statm.c:3053 #18 0x56607bca in parser_parse_source (arg_list_p=0x0, arg_list_size=0, source_p=0xf294510c "(function () {var a0 = 5; var a1 = 5; var a2 = 5; var a3 = 5; var a4 = 5; var a5 = 5; var a6 = 5; var a7 = 5; var a8 = 5; var a9 = 5; var a10 = 5; var a11 = 5; var a12 = 5; var a13 = 5; var a14 = 5; v"..., source_size=5522, parse_opts=66, error_location_p=0xffffc050) at jerryscript/jerry-core/parser/js/js-parser.c:2091 #19 0x5660b20d in parser_parse_script (arg_list_p=0x0, arg_list_size=0, source_p=0xf294510c "(function () {var a0 = 5; var a1 = 5; var a2 = 5; var a3 = 5; var a4 = 5; var a5 = 5; var a6 = 5; var a7 = 5; var a8 = 5; var a9 = 5; var a10 = 5; var a11 = 5; var a12 = 5; var a13 = 5; var a14 = 5; v"..., source_size=5522, parse_opts=66, bytecode_data_p=0xffffc110) at jerryscript/jerry-core/parser/js/js-parser.c:2614 #20 0x5666934c in ecma_op_eval_chars_buffer (code_p=0xf294510c "(function () {var a0 = 5; var a1 = 5; var a2 = 5; var a3 = 5; var a4 = 5; var a5 = 5; var a6 = 5; var a7 = 5; var a8 = 5; var a9 = 5; var a10 = 5; var a11 = 5; var a12 = 5; var a13 = 5; var a14 = 5; v"..., code_buffer_size=5522, parse_opts=66) at jerryscript/jerry-core/ecma/operations/ecma-eval.c:104 #21 0x5666906e in ecma_op_eval (code_p=0xf2945100, parse_opts=2) at jerryscript/jerry-core/ecma/operations/ecma-eval.c:58 #22 0x565bb782 in ecma_builtin_global_object_eval (x=4069806337) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-global.c:111 #23 0x565bef47 in ecma_builtin_global_dispatch_routine (builtin_routine_id=80, this_arg=72, arguments_list_p=0xffffc440, arguments_number=1) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-global.c:1164 #24 0x56698d99 in ecma_builtin_dispatch_routine (builtin_object_id=ECMA_BUILTIN_ID_GLOBAL, builtin_routine_id=80, this_arg_value=72, arguments_list_p=0xffffc440, arguments_list_len=1) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.c:1020 #25 0x56698ffa in ecma_builtin_dispatch_call (obj_p=0xf5f03640, this_arg_value=72, arguments_list_p=0xffffc6e4, arguments_list_len=1) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.c:1045 #26 0x5666b54f in ecma_op_function_call (func_obj_p=0xf5f03640, this_arg_value=72, arguments_list_p=0xffffc6e4, arguments_list_len=1) at jerryscript/jerry-core/ecma/operations/ecma-function-object.c:762 #27 0x56631eac in opfunc_call.lto_priv.465 (frame_ctx_p=0xffffc6b0) at jerryscript/jerry-core/vm/vm.c:699 #28 0x565e562a in vm_execute (frame_ctx_p=0xffffc6b0) at jerryscript/jerry-core/vm/vm.c:4117 #29 0x565e5c55 in vm_run (bytecode_header_p=0xf4f03ec0, this_binding_value=4126149459, lex_env_p=0xf5d007b0, arg_list_p=0x0, arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:4240 #30 0x566307d1 in vm_run_global (bytecode_p=0xf4f03ec0) at jerryscript/jerry-core/vm/vm.c:286 #31 0x566a096d in jerry_run (func_val=4126148547) at jerryscript/jerry-core/api/jerry.c:595 #32 0x5669d09a in main (argc=2, argv=0xffffcb04) at jerryscript/jerry-main/main-unix.c:740 ``` <sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [grammarinator](https://github.com/renatahodovan/grammarinator). </sup>
Assertion object_p->type_flags_refs >= ECMA_OBJECT_REF_ONE in ecma_deref_object
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3483/comments
0
2020-01-04T13:59:56Z
2020-01-10T14:25:41Z
https://github.com/jerryscript-project/jerryscript/issues/3483
545,288,162
3,483
[ "jerryscript-project", "jerryscript" ]
###### JerryScript revision 518fcf2c ###### Build platform Linux-4.15.0-72-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 ```javascript class MyObservedArray extends Array { constructor() { super('"use strict"; var x = "\\411";') } [Symbol]() {} } new MyObservedArray().slice() ``` ###### Output ```text ICE: Assertion 'old_length < new_length' failed at jerryscript/jerry-core/ecma/operations/ecma-array-object.c(ecma_fast_array_extend):317. Error: ERR_FAILED_INTERNAL_ASSERTION ``` ###### Backtrace ```text 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 0x5657bd39 in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-port/default/default-fatal.c:30 #4 0x5664e317 in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:58 #5 0x5664e358 in jerry_assert_fail (assertion=0x566f1a00 "old_length < new_length", file=0x566f16e0 "jerryscript/jerry-core/ecma/operations/ecma-array-object.c", function=0x566b8d20 <__func__.5035.lto_priv.702> "ecma_fast_array_extend", line=317) at jerryscript/jerry-core/jrt/jrt-fatals.c:82 #6 0x5665cc17 in ecma_fast_array_extend (object_p=0xf5f03370, new_length=1) at jerryscript/jerry-core/ecma/operations/ecma-array-object.c:317 #7 0x565f2ed4 in ecma_builtin_array_prototype_object_slice (arg1=72, arg2=72, obj_p=0xf5f03460, len=1) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype.c:857 #8 0x565f8616 in ecma_builtin_array_prototype_dispatch_routine (builtin_routine_id=86, this_arg=4126159971, arguments_list_p=0xffffc420, arguments_number=0) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype.c:2625 #9 0x56698da7 in ecma_builtin_dispatch_routine (builtin_object_id=ECMA_BUILTIN_ID_ARRAY_PROTOTYPE, builtin_routine_id=86, this_arg_value=4126159971, arguments_list_p=0xffffc420, arguments_list_len=0) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.c:1020 #10 0x56699008 in ecma_builtin_dispatch_call (obj_p=0xf5f01120, this_arg_value=4126159971, arguments_list_p=0xffffc6ec, arguments_list_len=0) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.c:1045 #11 0x5666b55d in ecma_op_function_call (func_obj_p=0xf5f01120, this_arg_value=4126159971, arguments_list_p=0xffffc6ec, arguments_list_len=0) at jerryscript/jerry-core/ecma/operations/ecma-function-object.c:762 #12 0x56631eba in opfunc_call.lto_priv.465 (frame_ctx_p=0xffffc690) at jerryscript/jerry-core/vm/vm.c:699 #13 0x565e5638 in vm_execute (frame_ctx_p=0xffffc690) at jerryscript/jerry-core/vm/vm.c:4117 #14 0x565e5c63 in vm_run (bytecode_header_p=0xf4d03780, this_binding_value=4126149459, lex_env_p=0xf5d007b0, arg_list_p=0x0, arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:4240 #15 0x566307df in vm_run_global (bytecode_p=0xf4d03780) at jerryscript/jerry-core/vm/vm.c:286 #16 0x566a097b in jerry_run (func_val=4126152483) at jerryscript/jerry-core/api/jerry.c:595 #17 0x5669d0a8 in main (argc=2, argv=0xffffcb04) at jerryscript/jerry-main/main-unix.c:740 ``` <sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [grammarinator](https://github.com/renatahodovan/grammarinator). </sup>
Assertion old_length < new_length in ecma_fast_array_extend
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3479/comments
0
2019-12-27T21:42:31Z
2020-01-10T11:16:54Z
https://github.com/jerryscript-project/jerryscript/issues/3479
542,998,943
3,479
[ "jerryscript-project", "jerryscript" ]
###### JerryScript revision 518fcf2c ###### Build platform Linux-4.15.0-72-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 ```javascript Object.prototype["symbol"] = 0; Promise.race([]); ``` ###### Output ```text Script Error: TypeError: Invalid capability ICE: Assertion 'object_p->type_flags_refs >= ECMA_OBJECT_REF_ONE' failed at jerryscript/jerry-core/ecma/base/ecma-gc.c(ecma_deref_object):147. Error: ERR_FAILED_INTERNAL_ASSERTION ``` ###### Backtrace ```text 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 0x5657bd39 in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-port/default/default-fatal.c:30 #4 0x5664e317 in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:58 #5 0x5664e358 in jerry_assert_fail (assertion=0x566fe360 "object_p->type_flags_refs >= ECMA_OBJECT_REF_ONE", file=0x566fe300 "jerryscript/jerry-core/ecma/base/ecma-gc.c", function=0x566b4120 <__func__.6158.lto_priv.905> "ecma_deref_object", line=147) at jerryscript/jerry-core/jrt/jrt-fatals.c:82 #6 0x566aa72d in ecma_deref_object (object_p=0xf5f00850) at jerryscript/jerry-core/ecma/base/ecma-gc.c:147 #7 0x566971b5 in ecma_finalize_builtins () at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.c:523 #8 0x566891e0 in ecma_finalize () at jerryscript/jerry-core/ecma/base/ecma-init-finalize.c:66 #9 0x5669f9a7 in jerry_cleanup () at jerryscript/jerry-core/api/jerry.c:236 #10 0x5669d8c5 in main (argc=2, argv=0xffffcb04) at jerryscript/jerry-main/main-unix.c:938 ``` <sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [grammarinator](https://github.com/renatahodovan/grammarinator). </sup>
Assertion object_p->type_flags_refs >= ECMA_OBJECT_REF_ONE in ecma_deref_object
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3478/comments
0
2019-12-27T18:39:42Z
2020-01-03T13:18:43Z
https://github.com/jerryscript-project/jerryscript/issues/3478
542,957,032
3,478
[ "jerryscript-project", "jerryscript" ]
when execute this case on the other engines can be run success, but jerryscript throws exception:Script Error: ReferenceError expression like this: `var _ref; var args = [1]; function Root() { } function _p(arg1, arg2) { return arg1 ? arg1 : arg2; } //success var temp = (_ref = Object.getPrototypeOf(Root)).call({}); var constructor = _p(this,temp); // fail on jerryscript var constructor = _p(this, (_ref = Object.getPrototypeOf(Root)).call({}) );`
A question of Assignment
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3477/comments
2
2019-12-23T01:50:56Z
2020-01-17T10:37:11Z
https://github.com/jerryscript-project/jerryscript/issues/3477
541,535,989
3,477
[ "jerryscript-project", "jerryscript" ]
When executing this testcase on other engines, (like [quickjs](https://bellard.org/quickjs/), v8 and spiderMonkey) I get the expected output. Only jerryscript throws an exception. Unfortunately I didn't find clear description about it in ES5.1 or ES6. Is this an issue of jerryscript? ###### JerryScript revision [996bf76](https://github.com/jerryscript-project/jerryscript/commit/996bf76f5956c65342c1726d3f629fbea41320ab) ###### Test case ``` var NISLFuzzingFunc = function(name,){ print(arguments.length); }; NISLFuzzingFunc(1,2,3); ``` ###### Output ` Script Error: SyntaxError: Identifier expected. ` ###### Expected Output ` 3 `
A question of function parameter
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3473/comments
3
2019-12-20T08:08:56Z
2020-01-16T18:39:17Z
https://github.com/jerryscript-project/jerryscript/issues/3473
540,843,563
3,473
[ "jerryscript-project", "jerryscript" ]
Although using same functions through different ways(As shows in testcase1 and testcase2), they react differently. So suspect it is a bug. ###### version [996bf76](https://github.com/jerryscript-project/jerryscript/commit/996bf76f5956c65342c1726d3f629fbea41320ab) ###### command `jerryscript/build/bin/jerry testcase.js` ###### test case1 ``` var NISLFuzzingFunc = function() { var fun = new Function("return"); var res = fun(); print(res); }; NISLFuzzingFunc(); ``` ###### output1 ` Script Error: SyntaxError: Primary expression expected.` ###### test case2 ``` var NISLFuzzingFunc = function() { var fun = function(){ return }; var res = fun(); print(res); }; NISLFuzzingFunc(); ``` ###### output2 ` undefined`
A bug about return statement of function
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3467/comments
0
2019-12-19T13:41:00Z
2019-12-19T18:32:00Z
https://github.com/jerryscript-project/jerryscript/issues/3467
540,321,058
3,467
[ "jerryscript-project", "jerryscript" ]
According to ES5.1 and ES6, when `length` of `obj` is 0 and `initialValue`(the second parameter) is assigned to be `undefined`, the method below should return undefined. Only when `length` is 0 and `initialValue` is not present, the method should throw an TypeError exception. ###### version [996bf76](https://github.com/jerryscript-project/jerryscript/commit/996bf76f5956c65342c1726d3f629fbea41320ab) ###### command `jerryscript/build/bin/jerry testcase.js` ###### Test case ``` var NISLFuzzingFunc = function(){ var func = function(a,b){}; var obj = []; print(obj.length); return obj.reduceRight(func, undefined); }; var NISLCallingResult = NISLFuzzingFunc(); print(NISLCallingResult); ``` ###### Output ``` 0 TypeError: Initial value cannot be undefined. ``` ###### Expected output ``` 0 undefined ```
An issue of Array.prototype.reduceRight
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3463/comments
0
2019-12-19T13:01:39Z
2020-01-06T14:17:54Z
https://github.com/jerryscript-project/jerryscript/issues/3463
540,300,152
3,463
[ "jerryscript-project", "jerryscript" ]
###### JerryScript revision d0b4e7dd ###### Build platform Linux-4.15.0-72-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 ```javascript class MyOtherArray {} class MyNonArray extends Array { static [Symbol.species] () {} } (() => MyNonArray)().prototype.slice.call(new MyNonArray((0) === 1)) ``` ###### Output ```text ICE: Assertion 'ecma_op_object_is_fast_array (object_p)' failed at jerryscript/jerry-core/ecma/operations/ecma-array-object.c(ecma_fast_array_extend):313. Error: ERR_FAILED_INTERNAL_ASSERTION ``` ###### Backtrace ```text 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 0x5657b7cd in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-port/default/default-fatal.c:30 #4 0x5664976b in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:58 #5 0x566497ac in jerry_assert_fail (assertion=0x566ea3e0 "ecma_op_object_is_fast_array (object_p)", file=0x566ea280 "jerryscript/jerry-core/ecma/operations/ecma-array-object.c", function=0x566b24e0 <__func__.5014.lto_priv.98> "ecma_fast_array_extend", line=313) at jerryscript/jerry-core/jrt/jrt-fatals.c:82 #6 0x56656d9b in ecma_fast_array_extend (object_p=0xf5d00a10, new_length=1) at jerryscript/jerry-core/ecma/operations/ecma-array-object.c:313 #7 0x565f0265 in ecma_builtin_array_prototype_object_slice (arg1=72, arg2=72, obj_p=0xf5f01cf0, len=1) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype.c:857 #8 0x565f59a7 in ecma_builtin_array_prototype_dispatch_routine (builtin_routine_id=85, this_arg=4126153971, arguments_list_p=0xffffc1c0, arguments_number=0) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype.c:2625 #9 0x56692f8b in ecma_builtin_dispatch_routine (builtin_object_id=ECMA_BUILTIN_ID_ARRAY_PROTOTYPE, builtin_routine_id=85, this_arg_value=4126153971, arguments_list_p=0xffffc1c0, arguments_list_len=0) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.c:1020 #10 0x566931ec in ecma_builtin_dispatch_call (obj_p=0xf5f01150, this_arg_value=4126153971, arguments_list_p=0xffffc424, arguments_list_len=0) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.c:1045 #11 0x56665786 in ecma_op_function_call (func_obj_p=0xf5f01150, this_arg_value=4126153971, arguments_list_p=0xffffc424, arguments_list_len=0) at jerryscript/jerry-core/ecma/operations/ecma-function-object.c:773 #12 0x565b8ec8 in ecma_builtin_function_prototype_object_call (func_obj_p=0xf5f01150, arguments_list_p=0xffffc420, arguments_number=1) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-function-prototype.c:190 #13 0x565b9460 in ecma_builtin_function_prototype_dispatch_routine (builtin_routine_id=78, this_arg=4126150995, arguments_list_p=0xffffc420, arguments_number=1) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-function-prototype.c:337 #14 0x56692f8b in ecma_builtin_dispatch_routine (builtin_object_id=ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE, builtin_routine_id=78, this_arg_value=4126150995, arguments_list_p=0xffffc420, arguments_list_len=1) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.c:1020 #15 0x566931ec in ecma_builtin_dispatch_call (obj_p=0xf5f020e0, this_arg_value=4126150995, arguments_list_p=0xffffc6ec, arguments_list_len=1) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.c:1045 #16 0x56665786 in ecma_op_function_call (func_obj_p=0xf5f020e0, this_arg_value=4126150995, arguments_list_p=0xffffc6ec, arguments_list_len=1) at jerryscript/jerry-core/ecma/operations/ecma-function-object.c:773 #17 0x5662e71b in opfunc_call.lto_priv.461 (frame_ctx_p=0xffffc690) at jerryscript/jerry-core/vm/vm.c:699 #18 0x565e2a47 in vm_execute (frame_ctx_p=0xffffc690) at jerryscript/jerry-core/vm/vm.c:4076 #19 0x565e3063 in vm_run (bytecode_header_p=0xf4d03780, this_binding_value=4126149459, lex_env_p=0xf5d007b0, arg_list_p=0x0, arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:4199 #20 0x5662d02e in vm_run_global (bytecode_p=0xf4d03780) at jerryscript/jerry-core/vm/vm.c:286 #21 0x5669ab1f in jerry_run (func_val=4126146579) at jerryscript/jerry-core/api/jerry.c:595 #22 0x5669728c in main (argc=2, argv=0xffffcb14) at jerryscript/jerry-main/main-unix.c:740 ``` <sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [grammarinator](https://github.com/renatahodovan/grammarinator). </sup>
Assertion ecma_op_object_is_fast_array (object_p) in ecma_fast_array_extend
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3459/comments
1
2019-12-18T15:49:28Z
2020-01-06T09:30:11Z
https://github.com/jerryscript-project/jerryscript/issues/3459
539,764,587
3,459
[ "jerryscript-project", "jerryscript" ]
###### JerryScript revision d0b4e7dd ###### Build platform Linux-4.15.0-72-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 ```javascript class Animal {} class Dog extends Animal { static explain () { super.f = 8 } } Dog.explain() ``` ###### Output ```text ICE: Assertion 'byte_code_start_p[-1] == CBC_EXT_PUSH_SUPER || byte_code_start_p[-1] == CBC_EXT_PUSH_CONSTRUCTOR_SUPER_PROP' failed at jerryscript/jerry-core/vm/vm.c(vm_loop):1897. Error: ERR_FAILED_INTERNAL_ASSERTION ``` ###### Backtrace ```text 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 0x5657b7cd in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-port/default/default-fatal.c:30 #4 0x5664976b in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:58 #5 0x566497ac in jerry_assert_fail (assertion=0x566dafc0 "byte_code_start_p[-1] == CBC_EXT_PUSH_SUPER || byte_code_start_p[-1] == CBC_EXT_PUSH_CONSTRUCTOR_SUPER_PROP", file=0x566da600 "jerryscript/jerry-core/vm/vm.c", function=0x566bd0a0 <__func__.6453.lto_priv.454> "vm_loop", line=1897) at jerryscript/jerry-core/jrt/jrt-fatals.c:82 #6 0x565d63fa in vm_loop (frame_ctx_p=0xffffc480) at jerryscript/jerry-core/vm/vm.c:1896 #7 0x565e29e3 in vm_execute (frame_ctx_p=0xffffc480) at jerryscript/jerry-core/vm/vm.c:4070 #8 0x565e3063 in vm_run (bytecode_header_p=0xf5f00910, this_binding_value=4126148595, lex_env_p=0xf5d006d0, arg_list_p=0xffffc700, arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:4199 #9 0x56665ad6 in ecma_op_function_call (func_obj_p=0xf5f00790, this_arg_value=4126148595, arguments_list_p=0xffffc700, arguments_list_len=0) at jerryscript/jerry-core/ecma/operations/ecma-function-object.c:854 #10 0x5662e71b in opfunc_call.lto_priv.461 (frame_ctx_p=0xffffc6c0) at jerryscript/jerry-core/vm/vm.c:699 #11 0x565e2a47 in vm_execute (frame_ctx_p=0xffffc6c0) at jerryscript/jerry-core/vm/vm.c:4076 #12 0x565e3063 in vm_run (bytecode_header_p=0xf6301520, this_binding_value=4126149459, lex_env_p=0xf5d007b0, arg_list_p=0x0, arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:4199 #13 0x5662d02e in vm_run_global (bytecode_p=0xf6301520) at jerryscript/jerry-core/vm/vm.c:286 #14 0x5669ab1f in jerry_run (func_val=4126148787) at jerryscript/jerry-core/api/jerry.c:595 #15 0x5669728c in main (argc=2, argv=0xffffcb14) at jerryscript/jerry-main/main-unix.c:740 ``` <sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [grammarinator](https://github.com/renatahodovan/grammarinator). </sup>
Assertion byte_code_start_p[-1] == CBC_EXT_PUSH_SUPER || byte_code_start_p[-1] == CBC_EXT_PUSH_CONSTRUCTOR_SUPER_PROP in vm_loop
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3458/comments
0
2019-12-18T12:50:33Z
2019-12-19T11:38:38Z
https://github.com/jerryscript-project/jerryscript/issues/3458
539,661,505
3,458
[ "jerryscript-project", "jerryscript" ]
###### JerryScript revision d0b4e7dd ###### Build platform Linux-4.15.0-72-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 ```javascript [...RegExp.$.$] = String() ``` ###### Output ```text ICE: Assertion 'ecma_is_value_object (iterator)' failed at jerryscript/jerry-core/ecma/operations/ecma-iterator-object.c(ecma_op_iterator_next):246. Error: ERR_FAILED_INTERNAL_ASSERTION ``` ###### Backtrace ```text 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 0x5657b7cd in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-port/default/default-fatal.c:30 #4 0x5664976b in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:58 #5 0x566497ac in jerry_assert_fail (assertion=0x566ed7e0 "ecma_is_value_object (iterator)", file=0x566ed5c0 "jerryscript/jerry-core/ecma/operations/ecma-iterator-object.c", function=0x566b3760 <__func__.6274.lto_priv.639> "ecma_op_iterator_next", line=246) at jerryscript/jerry-core/jrt/jrt-fatals.c:82 #6 0x56667ca2 in ecma_op_iterator_next (iterator=2221, value=8) at jerryscript/jerry-core/ecma/operations/ecma-iterator-object.c:246 #7 0x566682d1 in ecma_op_iterator_step (iterator=2221) at jerryscript/jerry-core/ecma/operations/ecma-iterator-object.c:509 #8 0x565d6bda in vm_loop (frame_ctx_p=0xffffc6c0) at jerryscript/jerry-core/vm/vm.c:2007 #9 0x565e29e3 in vm_execute (frame_ctx_p=0xffffc6c0) at jerryscript/jerry-core/vm/vm.c:4070 #10 0x565e3063 in vm_run (bytecode_header_p=0xf4f01ea0, this_binding_value=4126149459, lex_env_p=0xf5d007b0, arg_list_p=0x0, arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:4199 #11 0x5662d02e in vm_run_global (bytecode_p=0xf4f01ea0) at jerryscript/jerry-core/vm/vm.c:286 #12 0x5669ab1f in jerry_run (func_val=4126148883) at jerryscript/jerry-core/api/jerry.c:595 #13 0x5669728c in main (argc=2, argv=0xffffcb14) at jerryscript/jerry-main/main-unix.c:740 ``` <sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [grammarinator](https://github.com/renatahodovan/grammarinator). </sup>
Assertion ecma_is_value_object (iterator) in ecma_op_iterator_next
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3455/comments
1
2019-12-17T20:43:15Z
2020-01-14T15:03:27Z
https://github.com/jerryscript-project/jerryscript/issues/3455
539,299,810
3,455
[ "jerryscript-project", "jerryscript" ]
###### JerryScript revision d0b4e7dd ###### Build platform Linux-4.15.0-72-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 ```javascript "use strict" var $ = function yield() {} ``` ###### Output ```text ICE: Assertion 'source_p != NULL' failed at jerryscript/jerry-core/parser/js/js-scanner-util.c(scanner_insert_info):200. Error: ERR_FAILED_INTERNAL_ASSERTION ``` ###### Backtrace ```text 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 0x5657b7cd in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-port/default/default-fatal.c:30 #4 0x5664976b in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:58 #5 0x566497ac in jerry_assert_fail (assertion=0x566e0a40 "source_p != NULL", file=0x566e08c0 "jerryscript/jerry-core/parser/js/js-scanner-util.c", function=0x566bc300 <__func__.5794.lto_priv.499> "scanner_insert_info", line=200) at jerryscript/jerry-core/jrt/jrt-fatals.c:82 #6 0x5660993e in scanner_insert_info (context_p=0xffffc4b0, source_p=0x0, size=13) at jerryscript/jerry-core/parser/js/js-scanner-util.c:200 #7 0x5660b639 in scanner_pop_literal_pool (context_p=0xffffc4b0, scanner_context_p=0xffffc2f0) at jerryscript/jerry-core/parser/js/js-scanner-util.c:619 #8 0x56621e20 in scanner_scan_all (context_p=0xffffc4b0, arg_list_p=0x0, arg_list_end_p=0x0, source_p=0x56729cc0 <buffer.lto_priv> "\"use strict\" \nvar f = function yield ( i ) { if ( i = 0 ) return yield ( i + 1 ) \n\nreturn 39 \n} ; \n ", source_end_p=0x56729d24 <buffer.lto_priv+100> "") at jerryscript/jerry-core/parser/js/js-scanner.c:3325 #9 0x56605036 in parser_parse_source (arg_list_p=0x0, arg_list_size=0, source_p=0x56729cc0 <buffer.lto_priv> "\"use strict\" \nvar f = function yield ( i ) { if ( i = 0 ) return yield ( i + 1 ) \n\nreturn 39 \n} ; \n ", source_size=100, parse_opts=0, error_location_p=0xffffc6c0) at jerryscript/jerry-core/parser/js/js-parser.c:1918 #10 0x566090ce in parser_parse_script (arg_list_p=0x0, arg_list_size=0, source_p=0x56729cc0 <buffer.lto_priv> "\"use strict\" \nvar f = function yield ( i ) { if ( i = 0 ) return yield ( i + 1 ) \n\nreturn 39 \n} ; \n ", source_size=100, parse_opts=0, bytecode_data_p=0xffffc780) at jerryscript/jerry-core/parser/js/js-parser.c:2527 #11 0x5669a4bf in jerry_parse (resource_name_p=0xffffcd88 "/home/reni/.fuzzinator_33766//jerryscript/picireny/87744282367244666083406669132424056753.js", resource_name_length=92, source_p=0x56729cc0 <buffer.lto_priv> "\"use strict\" \nvar f = function yield ( i ) { if ( i = 0 ) return yield ( i + 1 ) \n\nreturn 39 \n} ; \n ", source_size=100, parse_opts=0) at jerryscript/jerry-core/api/jerry.c:445 #12 0x56697243 in main (argc=2, argv=0xffffcb14) at jerryscript/jerry-main/main-unix.c:731 ``` <sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [grammarinator](https://github.com/renatahodovan/grammarinator). </sup>
Assertion source_p != NULL in scanner_insert_info
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3454/comments
0
2019-12-17T20:31:58Z
2019-12-19T14:50:10Z
https://github.com/jerryscript-project/jerryscript/issues/3454
539,294,769
3,454
[ "jerryscript-project", "jerryscript" ]
###### JerryScript revision df6995d0 ###### Build platform Linux-4.15.0-72-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 ```javascript Promise.race().then(function () { }, function ([ ]) { $ }) ``` ###### Output ```text ICE: Assertion 'JERRY_CONTEXT (jmem_heap_allocated_size) == 0' failed at jerryscript/jerry-core/jmem/jmem-heap.c(jmem_heap_finalize):107. Error: ERR_FAILED_INTERNAL_ASSERTION ``` ###### Backtrace ```text 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 0x5657b8fd in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-port/default/default-fatal.c:30 #4 0x566474a0 in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:58 #5 0x566474e1 in jerry_assert_fail (assertion=0x566e5d80 "JERRY_CONTEXT (jmem_heap_allocated_size) == 0", file=0x566e5d20 "jerryscript/jerry-core/jmem/jmem-heap.c", function=0x566b2860 <__func__.5555.lto_priv.133> "jmem_heap_finalize", line=107) at jerryscript/jerry-core/jrt/jrt-fatals.c:82 #6 0x56646667 in jmem_heap_finalize () at jerryscript/jerry-core/jmem/jmem-heap.c:107 #7 0x5664648d in jmem_finalize () at jerryscript/jerry-core/jmem/jmem-allocator.c:170 #8 0x5669724e in jerry_cleanup () at jerryscript/jerry-core/api/jerry.c:252 #9 0x56694ee4 in main (argc=2, argv=0xffffcb14) at jerryscript/jerry-main/main-unix.c:938 ``` <sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [grammarinator](https://github.com/renatahodovan/grammarinator). </sup>
Assertion JERRY_CONTEXT (jmem_heap_allocated_size) == 0 in jmem_heap_finalize
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3446/comments
1
2019-12-12T07:51:41Z
2019-12-12T10:31:07Z
https://github.com/jerryscript-project/jerryscript/issues/3446
536,812,606
3,446
[ "jerryscript-project", "jerryscript" ]
###### JerryScript revision f7382ce8 ###### Build platform Linux-4.15.0-72-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 ```javascript [...RegExp.prototype.compile] = ([]) ``` ###### Output ```text Script Error: TypeError: Iterator next() is not callable. ICE: Assertion 'JERRY_CONTEXT (jmem_heap_allocated_size) == 0' failed at jerryscript/jerry-core/jmem/jmem-heap.c(jmem_heap_finalize):107. Error: ERR_FAILED_INTERNAL_ASSERTION ``` ###### Backtrace ```text 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 0x5657b8fd in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-port/default/default-fatal.c:30 #4 0x5664747d in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:58 #5 0x566474be in jerry_assert_fail (assertion=0x566e5d60 "JERRY_CONTEXT (jmem_heap_allocated_size) == 0", file=0x566e5d00 "jerryscript/jerry-core/jmem/jmem-heap.c", function=0x566b2840 <__func__.5555.lto_priv.133> "jmem_heap_finalize", line=107) at jerryscript/jerry-core/jrt/jrt-fatals.c:82 #6 0x56646644 in jmem_heap_finalize () at jerryscript/jerry-core/jmem/jmem-heap.c:107 #7 0x5664646a in jmem_finalize () at jerryscript/jerry-core/jmem/jmem-allocator.c:170 #8 0x5669722b in jerry_cleanup () at jerryscript/jerry-core/api/jerry.c:252 #9 0x56694ec1 in main (argc=2, argv=0xffffcb14) at jerryscript/jerry-main/main-unix.c:938 ``` <sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [grammarinator](https://github.com/renatahodovan/grammarinator). </sup>
Assertion JERRY_CONTEXT (jmem_heap_allocated_size) == 0 in jmem_heap_finalize
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3437/comments
0
2019-12-10T22:33:23Z
2019-12-11T09:24:50Z
https://github.com/jerryscript-project/jerryscript/issues/3437
536,032,867
3,437
[ "jerryscript-project", "jerryscript" ]
###### JerryScript revision b8bc013f ###### Build platform Linux-4.15.0-72-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 ```javascript function g({ ["y"]: { get = 5 } }) {} function h ``` ###### Output ```text ICE: Assertion 'scope_stack_p >= context_p->scope_stack_p' failed at jerryscript/jerry-core/parser/js/js-parser-statm.c(parser_parse_function_statement):713. Error: ERR_FAILED_INTERNAL_ASSERTION ``` ###### Backtrace ```text 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 0x5657b698 in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-port/default/default-fatal.c:30 #4 0x56647006 in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:58 #5 0x56647047 in jerry_assert_fail (assertion=0x566d2600 "scope_stack_p >= context_p->scope_stack_p", file=0x566d2080 "jerryscript/jerry-core/parser/js/js-parser-statm.c", function=0x566c1860 <__func__.5627.lto_priv.237> "parser_parse_function_statement", line=713) at jerryscript/jerry-core/jrt/jrt-fatals.c:82 #6 0x565aecf9 in parser_parse_function_statement.lto_priv.225 (context_p=0xffffc4b0) at jerryscript/jerry-core/parser/js/js-parser-statm.c:713 #7 0x5657133b in parser_parse_statements (context_p=0xffffc4b0) at jerryscript/jerry-core/parser/js/js-parser-statm.c:2722 #8 0x56607000 in parser_parse_source (arg_list_p=0x0, arg_list_size=0, source_p=0x56725ac0 <buffer.lto_priv> "String ( ( function ( [ a ] , b , { c } ) { } ) .length === 3 ) ; \nfunction f ( [ a = \"x\" , b = \"y\" , c = \"z\" ] ) { String ( a === \"a\" ) ; \nString ( b === \"b\" ) ; \nString ( c === \"z\" ) ; \n} \nf ( \"ab\" "..., source_size=1084, parse_opts=0, error_location_p=0xffffc6c0) at jerryscript/jerry-core/parser/js/js-parser.c:2026 #9 0x5660a398 in parser_parse_script (arg_list_p=0x0, arg_list_size=0, source_p=0x56725ac0 <buffer.lto_priv> "String ( ( function ( [ a ] , b , { c } ) { } ) .length === 3 ) ; \nfunction f ( [ a = \"x\" , b = \"y\" , c = \"z\" ] ) { String ( a === \"a\" ) ; \nString ( b === \"b\" ) ; \nString ( c === \"z\" ) ; \n} \nf ( \"ab\" "..., source_size=1084, parse_opts=0, bytecode_data_p=0xffffc780) at jerryscript/jerry-core/parser/js/js-parser.c:2519 #10 0x56696783 in jerry_parse (resource_name_p=0xffffcd8d "/home/reni/.fuzzinator_42037//jerryscript/picireny/244016613766980252626867290749981980902.js", resource_name_length=93, source_p=0x56725ac0 <buffer.lto_priv> "String ( ( function ( [ a ] , b , { c } ) { } ) .length === 3 ) ; \nfunction f ( [ a = \"x\" , b = \"y\" , c = \"z\" ] ) { String ( a === \"a\" ) ; \nString ( b === \"b\" ) ; \nString ( c === \"z\" ) ; \n} \nf ( \"ab\" "..., source_size=1084, parse_opts=0) at jerryscript/jerry-core/api/jerry.c:445 #11 0x56693507 in main (argc=2, argv=0xffffcb14) at jerryscript/jerry-main/main-unix.c:731 ``` <sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [grammarinator](https://github.com/renatahodovan/grammarinator). </sup>
Assertion scope_stack_p >= context_p->scope_stack_p in parser_parse_function_statement
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3434/comments
1
2019-12-10T09:26:56Z
2020-01-13T14:14:30Z
https://github.com/jerryscript-project/jerryscript/issues/3434
535,599,984
3,434
[ "jerryscript-project", "jerryscript" ]
###### JerryScript revision b8bc013f ###### Build platform Linux-4.15.0-72-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 ```javascript try {} catch ([{} ``` ###### Output ```text ICE: Assertion 'context_p->stack_top_uint8 == SCAN_STACK_CATCH_STATEMENT' failed at jerryscript/jerry-core/parser/js/js-scanner.c(scanner_scan_primary_expression_end):1215. Error: ERR_FAILED_INTERNAL_ASSERTION ``` ###### Backtrace ```text 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 0x5657b698 in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-port/default/default-fatal.c:30 #4 0x56647006 in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:58 #5 0x56647047 in jerry_assert_fail (assertion=0x566defc0 "context_p->stack_top_uint8 == SCAN_STACK_CATCH_STATEMENT", file=0x566de7e0 "jerryscript/jerry-core/parser/js/js-scanner.c", function=0x566b8b60 <__func__.5255.lto_priv.495> "scanner_scan_primary_expression_end", line=1215) at jerryscript/jerry-core/jrt/jrt-fatals.c:82 #6 0x56618685 in scanner_scan_primary_expression_end (context_p=0xffffc4b0, scanner_context_p=0xffffc2f0, type=LEXER_RIGHT_BRACE, stack_top=SCAN_STACK_OBJECT_LITERAL) at jerryscript/jerry-core/parser/js/js-scanner.c:1215 #7 0x5661eb39 in scanner_scan_all (context_p=0xffffc4b0, arg_list_p=0x0, arg_list_end_p=0x0, source_p=0x56725ac0 <buffer.lto_priv> "function id_0 ( code ) { try { eval ( code ) ; \nString ( false ) ; \n} catch ( e ) { String ( e instanceof SyntaxError ) ; \n} \n} \nid_1 ( \"try {} catch() {}\" ) ; \nid_2 ( \"try {} catch([a] {}\" ) ; \nid_3 "..., source_end_p=0x56725e83 <buffer.lto_priv+963> "") at jerryscript/jerry-core/parser/js/js-scanner.c:2702 #8 0x566063ee in parser_parse_source (arg_list_p=0x0, arg_list_size=0, source_p=0x56725ac0 <buffer.lto_priv> "function id_0 ( code ) { try { eval ( code ) ; \nString ( false ) ; \n} catch ( e ) { String ( e instanceof SyntaxError ) ; \n} \n} \nid_1 ( \"try {} catch() {}\" ) ; \nid_2 ( \"try {} catch([a] {}\" ) ; \nid_3 "..., source_size=963, parse_opts=0, error_location_p=0xffffc6c0) at jerryscript/jerry-core/parser/js/js-parser.c:1914 #9 0x5660a398 in parser_parse_script (arg_list_p=0x0, arg_list_size=0, source_p=0x56725ac0 <buffer.lto_priv> "function id_0 ( code ) { try { eval ( code ) ; \nString ( false ) ; \n} catch ( e ) { String ( e instanceof SyntaxError ) ; \n} \n} \nid_1 ( \"try {} catch() {}\" ) ; \nid_2 ( \"try {} catch([a] {}\" ) ; \nid_3 "..., source_size=963, parse_opts=0, bytecode_data_p=0xffffc780) at jerryscript/jerry-core/parser/js/js-parser.c:2519 #10 0x56696783 in jerry_parse (resource_name_p=0xffffcd8d "/home/reni/.fuzzinator_42037//jerryscript/picireny/163535895612646929922597031973760816716.js", resource_name_length=93, source_p=0x56725ac0 <buffer.lto_priv> "function id_0 ( code ) { try { eval ( code ) ; \nString ( false ) ; \n} catch ( e ) { String ( e instanceof SyntaxError ) ; \n} \n} \nid_1 ( \"try {} catch() {}\" ) ; \nid_2 ( \"try {} catch([a] {}\" ) ; \nid_3 "..., source_size=963, parse_opts=0) at jerryscript/jerry-core/api/jerry.c:445 #11 0x56693507 in main (argc=2, argv=0xffffcb14) at jerryscript/jerry-main/main-unix.c:731 ``` <sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [grammarinator](https://github.com/renatahodovan/grammarinator). </sup>
Assertion context_p->stack_top_uint8 == SCAN_STACK_CATCH_STATEMENT in scanner_scan_primary_expression_end
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3433/comments
1
2019-12-10T09:24:54Z
2020-01-13T10:39:08Z
https://github.com/jerryscript-project/jerryscript/issues/3433
535,598,850
3,433
[ "jerryscript-project", "jerryscript" ]
Hi, I am running Jerryscript on a microcontroller and I was wondering if there is a way to step the execution of JS from C. For example lets say the Javascript is busy going around in a loop like while(1), could the C program dictate the speed of execution? Like, instead of ``` jerry_run(parsed_code); ``` we could have ``` jerry_load(parsed_code); while(1){ jerry_next_tick(); // Do other things here, like handle Bluetooth, I/O, sleep, etc. } ``` Alternatively if this is not impossible, is there a way to either have a yield call from JS or a pause one from C? Similar issue #1356 Thanks.
Tick/stepping of execution for embedded systems with no OS
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3432/comments
2
2019-12-09T13:30:45Z
2019-12-09T17:26:51Z
https://github.com/jerryscript-project/jerryscript/issues/3432
534,933,135
3,432
[ "jerryscript-project", "jerryscript" ]
###### JerryScript revision 5ceffd20 ###### Build platform Linux-4.15.0-72-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 ```javascript function g({["y"]: []}) {} g({xy: {}}) ``` ###### Output ```text Script Error: TypeError: Argument cannot be converted to an object. ICE: Assertion 'ECMA_STRING_IS_REF_EQUALS_TO_ONE (string_p)' failed at jerryscript/jerry-core/ecma/base/ecma-literal-storage.c(ecma_free_string_list):75. Error: ERR_FAILED_INTERNAL_ASSERTION ``` ###### Backtrace ```text 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 0x5657b65d in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-port/default/default-fatal.c:30 #4 0x566458f6 in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:58 #5 0x56645937 in jerry_assert_fail (assertion=0x566ed080 "ECMA_STRING_IS_REF_EQUALS_TO_ONE (string_p)", file=0x566ed000 "jerryscript/jerry-core/ecma/base/ecma-literal-storage.c", function=0x566aac80 <__func__.5508.lto_priv.748> "ecma_free_string_list", line=75) at jerryscript/jerry-core/jrt/jrt-fatals.c:82 #6 0x5668009c in ecma_free_string_list (string_list_cp=4124053104) at jerryscript/jerry-core/ecma/base/ecma-literal-storage.c:75 #7 0x566802cf in ecma_finalize_lit_storage () at jerryscript/jerry-core/ecma/base/ecma-literal-storage.c:121 #8 0x5667ee91 in ecma_finalize () at jerryscript/jerry-core/ecma/base/ecma-init-finalize.c:68 #9 0x56694b6d in jerry_cleanup () at jerryscript/jerry-core/api/jerry.c:236 #10 0x56692aa6 in main (argc=2, argv=0xffffcb14) at jerryscript/jerry-main/main-unix.c:938 ``` <sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [grammarinator](https://github.com/renatahodovan/grammarinator). </sup>
Assertion ECMA_STRING_IS_REF_EQUALS_TO_ONE (string_p) in ecma_free_string_list
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3431/comments
0
2019-12-08T17:11:44Z
2019-12-12T11:17:46Z
https://github.com/jerryscript-project/jerryscript/issues/3431
534,571,770
3,431
[ "jerryscript-project", "jerryscript" ]
###### JerryScript revision 1829d2df ###### Build platform Linux-4.15.0-72-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 ```javascript RegExp('{}'); let {t: []} = {t: []} ``` ###### Output ```text Script Error: SyntaxError: RegExp quantifier error: missing digits. ICE: Assertion 'object_p->type_flags_refs >= ECMA_OBJECT_REF_ONE' failed at jerryscript/jerry-core/ecma/base/ecma-gc.c(ecma_deref_object):146. Error: ERR_FAILED_INTERNAL_ASSERTION ``` ###### Backtrace ```text 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 0x5657b549 in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-port/default/default-fatal.c:30 #4 0x56644e58 in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:58 #5 0x56644e99 in jerry_assert_fail (assertion=0x566f03a0 "object_p->type_flags_refs >= ECMA_OBJECT_REF_ONE", file=0x566f0340 "jerryscript/jerry-core/ecma/base/ecma-gc.c", function=0x566a7820 <__func__.5826.lto_priv.895> "ecma_deref_object", line=146) at jerryscript/jerry-core/jrt/jrt-fatals.c:82 #6 0x5669e991 in ecma_deref_object (object_p=0xf5f00760) at jerryscript/jerry-core/ecma/base/ecma-gc.c:146 #7 0x56678990 in ecma_free_value (value=4126148451) at jerryscript/jerry-core/ecma/base/ecma-helpers-value.c:1044 #8 0x56696a95 in jerry_release_value (value=4126148451) at jerryscript/jerry-core/api/jerry.c:1366 #9 0x56691f60 in main (argc=2, argv=0xffffcb24) at jerryscript/jerry-main/main-unix.c:925 ``` <sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [grammarinator](https://github.com/renatahodovan/grammarinator). </sup>
Assertion object_p->type_flags_refs >= ECMA_OBJECT_REF_ONE in ecma_deref_object
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3422/comments
0
2019-12-05T09:50:40Z
2019-12-10T13:42:11Z
https://github.com/jerryscript-project/jerryscript/issues/3422
533,239,101
3,422
[ "jerryscript-project", "jerryscript" ]
###### JerryScript revision 1829d2df ###### Build platform Linux-4.15.0-72-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 ```javascript for (let [] of [[], []]); ``` ###### Output ```text ICE: Assertion 'ecma_get_lex_env_type (lex_env_p) == ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE' failed at jerryscript/jerry-core/ecma/base/ecma-helpers.c(ecma_clone_decl_lexical_environment):331. Error: ERR_FAILED_INTERNAL_ASSERTION ``` ###### Backtrace ```text 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 0x5657b549 in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-port/default/default-fatal.c:30 #4 0x56644e58 in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:58 #5 0x56644e99 in jerry_assert_fail (assertion=0x566eaa40 "ecma_get_lex_env_type (lex_env_p) == ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE", file=0x566ea600 "jerryscript/jerry-core/ecma/base/ecma-helpers.c", function=0x566a9720 <__func__.5665.lto_priv.763> "ecma_clone_decl_lexical_environment", line=331) at jerryscript/jerry-core/jrt/jrt-fatals.c:82 #6 0x56679a59 in ecma_clone_decl_lexical_environment (lex_env_p=0xf5d007b0, copy_values=false) at jerryscript/jerry-core/ecma/base/ecma-helpers.c:331 #7 0x565d20f6 in vm_loop (frame_ctx_p=0xffffc6d0) at jerryscript/jerry-core/vm/vm.c:1467 #8 0x565e0a23 in vm_execute (frame_ctx_p=0xffffc6d0) at jerryscript/jerry-core/vm/vm.c:4070 #9 0x565e10a3 in vm_run (bytecode_header_p=0xf6301580, this_binding_value=4126149459, lex_env_p=0xf5d007b0, arg_list_p=0x0, arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:4199 #10 0x56629c63 in vm_run_global (bytecode_p=0xf6301580) at jerryscript/jerry-core/vm/vm.c:286 #11 0x56695043 in jerry_run (func_val=4126148883) at jerryscript/jerry-core/api/jerry.c:595 #12 0x566917b0 in main (argc=2, argv=0xffffcb24) at jerryscript/jerry-main/main-unix.c:740 ``` <sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [grammarinator](https://github.com/renatahodovan/grammarinator). </sup>
Assertion ecma_get_lex_env_type (lex_env_p) == ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE in ecma_clone_decl_lexical_environment
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3421/comments
1
2019-12-05T09:29:23Z
2020-01-08T13:55:03Z
https://github.com/jerryscript-project/jerryscript/issues/3421
533,227,222
3,421
[ "jerryscript-project", "jerryscript" ]
###### JerryScript revision 1829d2df ###### Build platform Linux-4.15.0-72-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 ```javascript Array.from.call(String, $); function $() {} ``` ###### Output ```text Script Error: TypeError: Invalid argument type. ICE: Assertion 'JERRY_CONTEXT (jmem_heap_allocated_size) == 0' failed at jerryscript/jerry-core/jmem/jmem-heap.c(jmem_heap_finalize):107. Error: ERR_FAILED_INTERNAL_ASSERTION ``` ###### Backtrace ```text 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 0x5657b549 in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-port/default/default-fatal.c:30 #4 0x56644e58 in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:58 #5 0x56644e99 in jerry_assert_fail (assertion=0x566e1ec0 "JERRY_CONTEXT (jmem_heap_allocated_size) == 0", file=0x566e1e60 "jerryscript/jerry-core/jmem/jmem-heap.c", function=0x566aee40 <__func__.4952.lto_priv.116> "jmem_heap_finalize", line=107) at jerryscript/jerry-core/jrt/jrt-fatals.c:82 #6 0x5664401f in jmem_heap_finalize () at jerryscript/jerry-core/jmem/jmem-heap.c:107 #7 0x56643e45 in jmem_finalize () at jerryscript/jerry-core/jmem/jmem-allocator.c:170 #8 0x56694337 in jerry_cleanup () at jerryscript/jerry-core/api/jerry.c:252 #9 0x56691fcd in main (argc=2, argv=0xffffcb24) at jerryscript/jerry-main/main-unix.c:938 ``` <sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [grammarinator](https://github.com/renatahodovan/grammarinator). </sup>
Assertion JERRY_CONTEXT (jmem_heap_allocated_size) == 0 in jmem_heap_finalize
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3420/comments
0
2019-12-05T09:27:28Z
2019-12-05T19:24:38Z
https://github.com/jerryscript-project/jerryscript/issues/3420
533,226,231
3,420
[ "jerryscript-project", "jerryscript" ]
###### JerryScript revision 1829d2df ###### Build platform Linux-4.15.0-72-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 ```javascript Function('[]', 0)() ``` ###### Output ```text ASAN:DEADLYSIGNAL ================================================================= ==26017==ERROR: AddressSanitizer: SEGV on unknown address 0x56000030 (pc 0x566dfede bp 0xffdf9438 sp 0xffdf9400 T0) ==26017==The signal is caused by a READ memory access. #0 0x566dfedd in vm_construct_literal_object.lto_priv.458 jerryscript/jerry-core/vm/vm.c:397 #1 0x56685dd8 in vm_loop jerryscript/jerry-core/vm/vm.c:1195 #2 0x56696a22 in vm_execute jerryscript/jerry-core/vm/vm.c:4070 #3 0x566970a2 in vm_run jerryscript/jerry-core/vm/vm.c:4199 #4 0x567163ae in ecma_op_function_call jerryscript/jerry-core/ecma/operations/ecma-function-object.c:854 #5 0x566e134f in opfunc_call.lto_priv.454 jerryscript/jerry-core/vm/vm.c:699 #6 0x56696a86 in vm_execute jerryscript/jerry-core/vm/vm.c:4076 #7 0x566970a2 in vm_run jerryscript/jerry-core/vm/vm.c:4199 #8 0x566dfc62 in vm_run_global jerryscript/jerry-core/vm/vm.c:286 #9 0x5674b042 in jerry_run jerryscript/jerry-core/api/jerry.c:595 #10 0x567477af in main jerryscript/jerry-main/main-unix.c:740 #11 0xf774ce80 in __libc_start_main (/lib/i386-linux-gnu/libc.so.6+0x18e80) #12 0x56623380 (jerryscript/build_gcc_asan_es2015/bin/jerry+0x18380) AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: SEGV jerryscript/jerry-core/vm/vm.c:397 in vm_construct_literal_object.lto_priv.458 ==26017==ABORTING ``` ###### Backtrace ```text bt #0 0x56629ede in vm_construct_literal_object.lto_priv.458 (frame_ctx_p=0xffffc490, lit_value=1442840620) at jerryscript/jerry-core/vm/vm.c:397 #1 0x565cfdd9 in vm_loop (frame_ctx_p=0xffffc490) at jerryscript/jerry-core/vm/vm.c:1195 #2 0x565e0a23 in vm_execute (frame_ctx_p=0xffffc490) at jerryscript/jerry-core/vm/vm.c:4070 #3 0x565e10a3 in vm_run (bytecode_header_p=0xf5f00850, this_binding_value=4126149459, lex_env_p=0xf5d007b0, arg_list_p=0xffffc710, arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:4199 #4 0x566603af in ecma_op_function_call (func_obj_p=0xf5f00820, this_arg_value=72, arguments_list_p=0xffffc710, arguments_list_len=0) at jerryscript/jerry-core/ecma/operations/ecma-function-object.c:854 #5 0x5662b350 in opfunc_call.lto_priv.454 (frame_ctx_p=0xffffc6e0) at jerryscript/jerry-core/vm/vm.c:699 #6 0x565e0a87 in vm_execute (frame_ctx_p=0xffffc6e0) at jerryscript/jerry-core/vm/vm.c:4076 #7 0x565e10a3 in vm_run (bytecode_header_p=0xf6301520, this_binding_value=4126149459, lex_env_p=0xf5d007b0, arg_list_p=0x0, arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:4199 #8 0x56629c63 in vm_run_global (bytecode_p=0xf6301520) at jerryscript/jerry-core/vm/vm.c:286 #9 0x56695043 in jerry_run (func_val=4126148883) at jerryscript/jerry-core/api/jerry.c:595 #10 0x566917b0 in main (argc=2, argv=0xffffcb24) at jerryscript/jerry-main/main-unix.c:740 ``` <sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [grammarinator](https://github.com/renatahodovan/grammarinator). </sup>
SEGV in vm_construct_literal_object
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3419/comments
0
2019-12-05T09:22:48Z
2019-12-12T11:17:46Z
https://github.com/jerryscript-project/jerryscript/issues/3419
533,223,736
3,419
[ "jerryscript-project", "jerryscript" ]
###### JerryScript revision bfc495f0 ###### Build platform Linux-4.15.0-72-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 ```javascript var a; Promise.race([a]).then(function() {[] = []}); Promise.race().then(function() {}, function() {throw "'this' had incorrect value!"}) ``` ###### Output ```text ================================================================= ==11048==ERROR: AddressSanitizer: heap-use-after-free on address 0xf4800c90 at pc 0x5675733d bp 0xffc10958 sp 0xffc10948 READ of size 4 at 0xf4800c90 thread T0 #0 0x5675733c in ecma_free_string_list jerryscript/jerry-core/ecma/base/ecma-literal-storage.c:75 #1 0x567575a5 in ecma_finalize_lit_storage jerryscript/jerry-core/ecma/base/ecma-literal-storage.c:121 #2 0x56756167 in ecma_finalize jerryscript/jerry-core/ecma/base/ecma-init-finalize.c:68 #3 0x5676bd43 in jerry_cleanup jerryscript/jerry-core/api/jerry.c:236 #4 0x56769c7c in main jerryscript/jerry-main/main-unix.c:938 #5 0xf7751e80 in __libc_start_main (/lib/i386-linux-gnu/libc.so.6+0x18e80) #6 0x566453c0 (jerryscript/build_gcc_asan_es2015/bin/jerry+0x183c0) 0xf4800c90 is located 0 bytes inside of 39-byte region [0xf4800c90,0xf4800cb7) freed by thread T0 here: #0 0xf7a17b74 in __interceptor_free (/usr/lib32/libasan.so.4+0xe5b74) #1 0x5671c28f in jmem_heap_free_block_internal jerryscript/jerry-core/jmem/jmem-heap.c:476 #2 0x5671c63a in jmem_heap_free_block jerryscript/jerry-core/jmem/jmem-heap.c:685 #3 0x566b90fe in ecma_dealloc_string_buffer jerryscript/jerry-core/ecma/base/ecma-alloc.c:208 #4 0x56745fd0 in ecma_destroy_ecma_string jerryscript/jerry-core/ecma/base/ecma-helpers-string.c:911 #5 0x56745d7e in ecma_deref_ecma_string jerryscript/jerry-core/ecma/base/ecma-helpers-string.c:883 #6 0x56750540 in ecma_free_value jerryscript/jerry-core/ecma/base/ecma-helpers-value.c:1032 #7 0x56750737 in ecma_free_value_if_not_object jerryscript/jerry-core/ecma/base/ecma-helpers-value.c:1085 #8 0x56779b39 in ecma_gc_free_object jerryscript/jerry-core/ecma/base/ecma-gc.c:1027 #9 0x5677b3b4 in ecma_gc_run jerryscript/jerry-core/ecma/base/ecma-gc.c:1385 #10 0x56756162 in ecma_finalize jerryscript/jerry-core/ecma/base/ecma-init-finalize.c:67 #11 0x5676bd43 in jerry_cleanup jerryscript/jerry-core/api/jerry.c:236 #12 0x56769c7c in main jerryscript/jerry-main/main-unix.c:938 #13 0xf7751e80 in __libc_start_main (/lib/i386-linux-gnu/libc.so.6+0x18e80) previously allocated by thread T0 here: #0 0xf7a17f34 in malloc (/usr/lib32/libasan.so.4+0xe5f34) #1 0x5671bf47 in jmem_heap_alloc jerryscript/jerry-core/jmem/jmem-heap.c:254 #2 0x5671c025 in jmem_heap_gc_and_alloc_block jerryscript/jerry-core/jmem/jmem-heap.c:289 #3 0x5671c0b7 in jmem_heap_alloc_block jerryscript/jerry-core/jmem/jmem-heap.c:322 #4 0x566b90db in ecma_alloc_string_buffer jerryscript/jerry-core/ecma/base/ecma-alloc.c:194 #5 0x56742876 in ecma_new_ecma_string_from_utf8_buffer jerryscript/jerry-core/ecma/base/ecma-helpers-string.c:293 #6 0x56742876 in ecma_new_ecma_string_from_utf8 jerryscript/jerry-core/ecma/base/ecma-helpers-string.c:388 #7 0x5675761a in ecma_find_or_create_literal_string jerryscript/jerry-core/ecma/base/ecma-literal-storage.c:134 #8 0x566d88f8 in parser_post_processing jerryscript/jerry-core/parser/js/js-parser.c:1529 #9 0x566de175 in parser_parse_function jerryscript/jerry-core/parser/js/js-parser.c:2324 #10 0x5666de4d in lexer_construct_function_object jerryscript/jerry-core/parser/js/js-lexer.c:2191 #11 0x566758ac in parser_parse_function_expression jerryscript/jerry-core/parser/js/js-parser-expr.c:1085 #12 0x56677376 in parser_parse_unary_expression jerryscript/jerry-core/parser/js/js-parser-expr.c:1409 #13 0x5667e45c in parser_parse_expression jerryscript/jerry-core/parser/js/js-parser-expr.c:2844 #14 0x56678b9e in parser_process_unary_expression jerryscript/jerry-core/parser/js/js-parser-expr.c:1751 #15 0x5667e4b2 in parser_parse_expression jerryscript/jerry-core/parser/js/js-parser-expr.c:2853 #16 0x5667de2a in parser_parse_block_expression jerryscript/jerry-core/parser/js/js-parser-expr.c:2783 #17 0x56649f40 in parser_parse_statements jerryscript/jerry-core/parser/js/js-parser-statm.c:2963 #18 0x566db903 in parser_parse_source jerryscript/jerry-core/parser/js/js-parser.c:2026 #19 0x566dec9b in parser_parse_script jerryscript/jerry-core/parser/js/js-parser.c:2519 #20 0x5676c692 in jerry_parse jerryscript/jerry-core/api/jerry.c:445 #21 0x56769416 in main jerryscript/jerry-main/main-unix.c:731 #22 0xf7751e80 in __libc_start_main (/lib/i386-linux-gnu/libc.so.6+0x18e80) SUMMARY: AddressSanitizer: heap-use-after-free jerryscript/jerry-core/ecma/base/ecma-literal-storage.c:75 in ecma_free_string_list Shadow bytes around the buggy address: 0x3e900140: fa fa fd fd fd fd fd fa fa fa fd fd fd fd fd fa 0x3e900150: fa fa fd fd fd fd fd fa fa fa fd fd fd fd fd fa 0x3e900160: fa fa fd fd fd fd fd fa fa fa fd fd fd fd fd fa 0x3e900170: fa fa fd fd fd fd fd fa fa fa fd fd fd fd fd fa 0x3e900180: fa fa fd fd fd fd fd fa fa fa fd fd fd fd fd fa =>0x3e900190: fa fa[fd]fd fd fd fd fa fa fa fd fd fd fd fd fa 0x3e9001a0: fa fa fd fd fd fd fd fa fa fa fd fd fd fd fd fa 0x3e9001b0: fa fa fd fd fd fd fd fa fa fa fd fd fd fd fd fa 0x3e9001c0: fa fa fd fd fd fd fd fa fa fa fd fd fd fd fd fa 0x3e9001d0: fa fa fd fd fd fd fd fa fa fa fd fd fd fd fd fa 0x3e9001e0: fa fa fd fd fd fd fd fa fa fa fd fd fd fd fd fa Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb ==11048==ABORTING ``` <sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [grammarinator](https://github.com/renatahodovan/grammarinator). </sup>
heap-use-after-free in ecma_free_string_list
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3411/comments
0
2019-12-03T23:47:15Z
2019-12-04T11:51:53Z
https://github.com/jerryscript-project/jerryscript/issues/3411
532,344,045
3,411
[ "jerryscript-project", "jerryscript" ]
###### JerryScript revision bfc495f0 ###### Build platform Linux-4.15.0-72-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 ```javascript var a; Promise.race([a]).then(function() { [] = [] }); throw 0.1234; ``` ###### Output ```text Script Error: 0.1234 ================================================================= ==39705==ERROR: AddressSanitizer: heap-use-after-free on address 0xf5100f10 at pc 0x566d784e bp 0xff8fe3a8 sp 0xff8fe398 READ of size 4 at 0xf5100f10 thread T0 #0 0x566d784d in jmem_pools_collect_empty jerryscript/jerry-core/jmem/jmem-poolman.c:165 #1 0x566d73cd in jmem_pools_finalize jerryscript/jerry-core/jmem/jmem-poolman.c:44 #2 0x566d6993 in jmem_finalize jerryscript/jerry-core/jmem/jmem-allocator.c:161 #3 0x56700b3c in jerry_cleanup jerryscript/jerry-core/api/jerry.c:252 #4 0x566fe7d2 in main jerryscript/jerry-main/main-unix.c:938 #5 0xf772fe80 in __libc_start_main (/lib/i386-linux-gnu/libc.so.6+0x18e80) #6 0x565f5240 (jerryscript/build_gcc_asan_es2015/bin/jerry+0x18240) 0xf5100f10 is located 0 bytes inside of 8-byte region [0xf5100f10,0xf5100f18) freed by thread T0 here: #0 0xf79f5b74 in __interceptor_free (/usr/lib32/libasan.so.4+0xe5b74) #1 0x566d6ff1 in jmem_heap_free_block_internal jerryscript/jerry-core/jmem/jmem-heap.c:476 #2 0x566d7862 in jmem_pools_collect_empty jerryscript/jerry-core/jmem/jmem-poolman.c:168 #3 0x566d73cd in jmem_pools_finalize jerryscript/jerry-core/jmem/jmem-poolman.c:44 #4 0x566d6993 in jmem_finalize jerryscript/jerry-core/jmem/jmem-allocator.c:161 #5 0x56700b3c in jerry_cleanup jerryscript/jerry-core/api/jerry.c:252 #6 0x566fe7d2 in main jerryscript/jerry-main/main-unix.c:938 #7 0xf772fe80 in __libc_start_main (/lib/i386-linux-gnu/libc.so.6+0x18e80) previously allocated by thread T0 here: #0 0xf79f5f34 in malloc (/usr/lib32/libasan.so.4+0xe5f34) #1 0x566d6ca9 in jmem_heap_alloc jerryscript/jerry-core/jmem/jmem-heap.c:254 #2 0x566d6d87 in jmem_heap_gc_and_alloc_block jerryscript/jerry-core/jmem/jmem-heap.c:289 #3 0x566d6df7 in jmem_heap_alloc_block_internal jerryscript/jerry-core/jmem/jmem-heap.c:307 #4 0x566d7557 in jmem_pools_alloc jerryscript/jerry-core/jmem/jmem-poolman.c:85 #5 0x5666b5cd in ecma_alloc_number jerryscript/jerry-core/ecma/base/ecma-alloc.c:57 #6 0x56720d56 in ecma_create_float_number jerryscript/jerry-core/ecma/base/ecma-helpers-value.c:456 #7 0x56722028 in ecma_copy_value jerryscript/jerry-core/ecma/base/ecma-helpers-value.c:807 #8 0x567222a5 in ecma_fast_copy_value jerryscript/jerry-core/ecma/base/ecma-helpers-value.c:850 #9 0x5665a368 in vm_loop jerryscript/jerry-core/vm/vm.c:1195 #10 0x5666af26 in vm_execute jerryscript/jerry-core/vm/vm.c:4067 #11 0x5666b5a6 in vm_run jerryscript/jerry-core/vm/vm.c:4196 #12 0x566b5119 in vm_run_global jerryscript/jerry-core/vm/vm.c:286 #13 0x56701848 in jerry_run jerryscript/jerry-core/api/jerry.c:595 #14 0x566fdfb5 in main jerryscript/jerry-main/main-unix.c:740 #15 0xf772fe80 in __libc_start_main (/lib/i386-linux-gnu/libc.so.6+0x18e80) SUMMARY: AddressSanitizer: heap-use-after-free jerryscript/jerry-core/jmem/jmem-poolman.c:165 in jmem_pools_collect_empty Shadow bytes around the buggy address: 0x3ea20190: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x3ea201a0: fa fa fa fa fa fa fd fd fa fa fd fd fa fa 00 00 0x3ea201b0: fa fa 00 00 fa fa fd fd fa fa fd fd fa fa fd fd 0x3ea201c0: fa fa fd fd fa fa fd fd fa fa fd fd fa fa fd fd 0x3ea201d0: fa fa fd fd fa fa fd fa fa fa fd fa fa fa fd fa =>0x3ea201e0: fa fa[fd]fa fa fa 00 00 fa fa 00 00 fa fa fd fa 0x3ea201f0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x3ea20200: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x3ea20210: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x3ea20220: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x3ea20230: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb ==39705==ABORTING ``` <sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [grammarinator](https://github.com/renatahodovan/grammarinator). </sup>
heap-use-after-free in jmem_pools_collect_empty
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3410/comments
0
2019-12-03T16:12:48Z
2019-12-04T13:12:07Z
https://github.com/jerryscript-project/jerryscript/issues/3410
532,096,638
3,410
[ "jerryscript-project", "jerryscript" ]
###### JerryScript revision 9634ca55 ###### Build platform Linux-4.15.0-72-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 ```javascript var a = Promise.resolve('a'); var b = Promise.reject('b'); Promise.race([a, b]).then(function(x) { var [a, b] = [1, 2]; }, function(x) {}); Promise.race([b, a]).then(function(x) {}, function(x) {}); Promise.race([, b, a]).then(function(x) {}, function(x) {}); Promise.race(a).then(function(x) {}, function(x) { String(i.name === "TypeError"); }); ``` ###### Output ```text ================================================================= ==22106==ERROR: AddressSanitizer: heap-use-after-free on address 0xf5302fb0 at pc 0x567351e8 bp 0xff85afe8 sp 0xff85afd8 READ of size 2 at 0xf5302fb0 thread T0 #0 0x567351e7 in ecma_deref_object jerryscript/jerry-core/ecma/base/ecma-gc.c:146 #1 0x5674d29a in ecma_free_value jerryscript/jerry-core/ecma/base/ecma-helpers-value.c:1044 #2 0x566e4e37 in ecma_process_promise_reaction_job jerryscript/jerry-core/ecma/operations/ecma-jobqueue.c:210 #3 0x566e587a in ecma_process_all_enqueued_jobs jerryscript/jerry-core/ecma/operations/ecma-jobqueue.c:343 #4 0x5672b97a in jerry_run_all_enqueued_jobs jerryscript/jerry-core/api/jerry.c:632 #5 0x5672876d in main jerryscript/jerry-main/main-unix.c:927 #6 0xf773ae80 in __libc_start_main (/lib/i386-linux-gnu/libc.so.6+0x18e80) #7 0x5661f240 (jerryscript/build_gcc_asan_es2015/bin/jerry+0x18240) 0xf5302fb0 is located 0 bytes inside of 24-byte region [0xf5302fb0,0xf5302fc8) freed by thread T0 here: #0 0xf7a00b74 in __interceptor_free (/usr/lib32/libasan.so.4+0xe5b74) #1 0x56700ff1 in jmem_heap_free_block_internal jerryscript/jerry-core/jmem/jmem-heap.c:476 #2 0x5670139c in jmem_heap_free_block jerryscript/jerry-core/jmem/jmem-heap.c:685 #3 0x56695673 in ecma_dealloc_extended_object jerryscript/jerry-core/ecma/base/ecma-alloc.c:123 #4 0x56739308 in ecma_gc_free_object jerryscript/jerry-core/ecma/base/ecma-gc.c:1258 #5 0x56739f0a in ecma_gc_run jerryscript/jerry-core/ecma/base/ecma-gc.c:1385 #6 0x5673a17b in ecma_free_unused_memory jerryscript/jerry-core/ecma/base/ecma-gc.c:1431 #7 0x56700d79 in jmem_heap_gc_and_alloc_block jerryscript/jerry-core/jmem/jmem-heap.c:286 #8 0x56700e19 in jmem_heap_alloc_block jerryscript/jerry-core/jmem/jmem-heap.c:322 #9 0x56695650 in ecma_alloc_extended_object jerryscript/jerry-core/ecma/base/ecma-alloc.c:109 #10 0x5674d65c in ecma_create_object jerryscript/jerry-core/ecma/base/ecma-helpers.c:82 #11 0x5670b7da in ecma_builtin_make_function_object_for_routine jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.c:559 #12 0x5670c71b in ecma_builtin_try_to_instantiate_property jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.c:822 #13 0x566eb9e8 in ecma_op_object_find_own jerryscript/jerry-core/ecma/operations/ecma-objects.c:598 #14 0x566ec1b2 in ecma_op_object_get jerryscript/jerry-core/ecma/operations/ecma-objects.c:812 #15 0x566ec5be in ecma_op_object_get_by_symbol_id jerryscript/jerry-core/ecma/operations/ecma-objects.c:963 #16 0x566ec63e in ecma_op_get_method_by_id jerryscript/jerry-core/ecma/operations/ecma-objects.c:1000 #17 0x566ec71d in ecma_op_get_method_by_symbol_id jerryscript/jerry-core/ecma/operations/ecma-objects.c:1046 #18 0x566e3ba3 in ecma_op_get_iterator jerryscript/jerry-core/ecma/operations/ecma-iterator-object.c:190 #19 0x56688a81 in vm_loop jerryscript/jerry-core/vm/vm.c:1933 #20 0x56694f26 in vm_execute jerryscript/jerry-core/vm/vm.c:4067 #21 0x566955a6 in vm_run jerryscript/jerry-core/vm/vm.c:4196 #22 0x566e1aa9 in ecma_op_function_call jerryscript/jerry-core/ecma/operations/ecma-function-object.c:854 #23 0x566e4bc4 in ecma_process_promise_reaction_job jerryscript/jerry-core/ecma/operations/ecma-jobqueue.c:170 #24 0x566e587a in ecma_process_all_enqueued_jobs jerryscript/jerry-core/ecma/operations/ecma-jobqueue.c:343 #25 0x5672b97a in jerry_run_all_enqueued_jobs jerryscript/jerry-core/api/jerry.c:632 #26 0x5672876d in main jerryscript/jerry-main/main-unix.c:927 #27 0xf773ae80 in __libc_start_main (/lib/i386-linux-gnu/libc.so.6+0x18e80) previously allocated by thread T0 here: #0 0xf7a00f34 in malloc (/usr/lib32/libasan.so.4+0xe5f34) #1 0x56700ca9 in jmem_heap_alloc jerryscript/jerry-core/jmem/jmem-heap.c:254 #2 0x56700d87 in jmem_heap_gc_and_alloc_block jerryscript/jerry-core/jmem/jmem-heap.c:289 #3 0x56700e19 in jmem_heap_alloc_block jerryscript/jerry-core/jmem/jmem-heap.c:322 #4 0x56695650 in ecma_alloc_extended_object jerryscript/jerry-core/ecma/base/ecma-alloc.c:109 #5 0x5674d65c in ecma_create_object jerryscript/jerry-core/ecma/base/ecma-helpers.c:82 #6 0x56724fe8 in ecma_new_standard_error jerryscript/jerry-core/ecma/operations/ecma-exceptions.c:137 #7 0x567251db in ecma_new_standard_error_with_message jerryscript/jerry-core/ecma/operations/ecma-exceptions.c:203 #8 0x56725783 in ecma_raise_standard_error_with_format jerryscript/jerry-core/ecma/operations/ecma-exceptions.c:333 #9 0x5663cd3a in ecma_op_resolve_reference_value jerryscript/jerry-core/ecma/operations/ecma-reference.c:188 #10 0x56684615 in vm_loop jerryscript/jerry-core/vm/vm.c:1205 #11 0x56694f26 in vm_execute jerryscript/jerry-core/vm/vm.c:4067 #12 0x566955a6 in vm_run jerryscript/jerry-core/vm/vm.c:4196 #13 0x566e1aa9 in ecma_op_function_call jerryscript/jerry-core/ecma/operations/ecma-function-object.c:854 #14 0x566e4bc4 in ecma_process_promise_reaction_job jerryscript/jerry-core/ecma/operations/ecma-jobqueue.c:170 #15 0x566e587a in ecma_process_all_enqueued_jobs jerryscript/jerry-core/ecma/operations/ecma-jobqueue.c:343 #16 0x5672b97a in jerry_run_all_enqueued_jobs jerryscript/jerry-core/api/jerry.c:632 #17 0x5672876d in main jerryscript/jerry-main/main-unix.c:927 #18 0xf773ae80 in __libc_start_main (/lib/i386-linux-gnu/libc.so.6+0x18e80) SUMMARY: AddressSanitizer: heap-use-after-free jerryscript/jerry-core/ecma/base/ecma-gc.c:146 in ecma_deref_object Shadow bytes around the buggy address: 0x3ea605a0: fa fa fd fd fd fd fa fa fd fd fd fd fa fa fd fd 0x3ea605b0: fd fa fa fa fd fd fd fa fa fa fd fd fd fa fa fa 0x3ea605c0: fd fd fd fa fa fa fd fd fd fa fa fa fd fd fd fa 0x3ea605d0: fa fa 00 00 00 fa fa fa 00 00 00 00 fa fa 00 00 0x3ea605e0: 00 fa fa fa fd fd fd fd fa fa fd fd fd fd fa fa =>0x3ea605f0: fd fd fd fa fa fa[fd]fd fd fa fa fa 00 00 00 fa 0x3ea60600: fa fa fd fd fd fd fa fa 00 00 00 fa fa fa fd fd 0x3ea60610: fd fd fa fa fd fd fd fd fa fa fd fd fd fd fa fa 0x3ea60620: fd fd fd fd fa fa fd fd fd fd fa fa fd fd fd fd 0x3ea60630: fa fa fd fd fd fd fa fa fd fd fd fd fa fa fd fd 0x3ea60640: fd fd fa fa fd fd fd fd fa fa fd fd fd fd fa fa Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb ==22106==ABORTING ``` <sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [grammarinator](https://github.com/renatahodovan/grammarinator). </sup>
heap-use-after-free in ecma_deref_object
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3409/comments
0
2019-12-03T12:04:02Z
2019-12-04T11:51:53Z
https://github.com/jerryscript-project/jerryscript/issues/3409
531,936,933
3,409
[ "jerryscript-project", "jerryscript" ]
###### JerryScript revision 9634ca55 ###### Build platform Linux-4.15.0-72-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 ```javascript var array = [0, 0, obj, 0, 0]; array.copyWithin(NaN, 67, 0); var obj ``` ###### Output ```text ================================================================= ==44744==ERROR: AddressSanitizer: heap-buffer-overflow on address 0xf5302250 at pc 0x5666a479 bp 0xff7ff778 sp 0xff7ff768 READ of size 4 at 0xf5302250 thread T0 #0 0x5666a478 in ecma_builtin_array_prototype_object_copy_within jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype.c:2365 #1 0x5666aff4 in ecma_builtin_array_prototype_dispatch_routine jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype.c:2661 #2 0x566d029c in ecma_builtin_dispatch_routine jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.c:1020 #3 0x566d04fd in ecma_builtin_dispatch_call jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.c:1045 #4 0x566a4759 in ecma_op_function_call jerryscript/jerry-core/ecma/operations/ecma-function-object.c:773 #5 0x56644cd6 in opfunc_call jerryscript/jerry-core/vm/vm.c:699 #6 0x56657f8a in vm_execute jerryscript/jerry-core/vm/vm.c:4073 #7 0x566585a6 in vm_run jerryscript/jerry-core/vm/vm.c:4196 #8 0x566a2119 in vm_run_global jerryscript/jerry-core/vm/vm.c:286 #9 0x566ee848 in jerry_run jerryscript/jerry-core/api/jerry.c:595 #10 0x566eafb5 in main jerryscript/jerry-main/main-unix.c:740 #11 0xf7703e80 in __libc_start_main (/lib/i386-linux-gnu/libc.so.6+0x18e80) #12 0x565e2240 (jerryscript/build_gcc_asan_es2015/bin/jerry+0x18240) 0xf5302250 is located 0 bytes to the right of 32-byte region [0xf5302230,0xf5302250) allocated by thread T0 here: #0 0xf79c9f34 in malloc (/usr/lib32/libasan.so.4+0xe5f34) #1 0x566c3ca9 in jmem_heap_alloc jerryscript/jerry-core/jmem/jmem-heap.c:254 #2 0x566c3d87 in jmem_heap_gc_and_alloc_block jerryscript/jerry-core/jmem/jmem-heap.c:289 #3 0x566c3e19 in jmem_heap_alloc_block jerryscript/jerry-core/jmem/jmem-heap.c:322 #4 0x566dbd55 in ecma_fast_array_extend jerryscript/jerry-core/ecma/operations/ecma-array-object.c:327 #5 0x565eda22 in opfunc_append_array jerryscript/jerry-core/vm/opcodes.c:489 #6 0x5664c92d in vm_loop jerryscript/jerry-core/vm/vm.c:2110 #7 0x56657f26 in vm_execute jerryscript/jerry-core/vm/vm.c:4067 #8 0x566585a6 in vm_run jerryscript/jerry-core/vm/vm.c:4196 #9 0x566a2119 in vm_run_global jerryscript/jerry-core/vm/vm.c:286 #10 0x566ee848 in jerry_run jerryscript/jerry-core/api/jerry.c:595 #11 0x566eafb5 in main jerryscript/jerry-main/main-unix.c:740 #12 0xf7703e80 in __libc_start_main (/lib/i386-linux-gnu/libc.so.6+0x18e80) SUMMARY: AddressSanitizer: heap-buffer-overflow jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype.c:2365 in ecma_builtin_array_prototype_object_copy_within Shadow bytes around the buggy address: 0x3ea603f0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x3ea60400: fa fa fa fa fa fa fa fa fa fa fd fd fd fd fa fa 0x3ea60410: fd fd fd fa fa fa fd fd fd fa fa fa fd fd fd fa 0x3ea60420: fa fa fd fd fd fa fa fa fd fd fd fd fa fa fd fd 0x3ea60430: fd fa fa fa fd fd fd fa fa fa fd fd fd fa fa fa =>0x3ea60440: fd fd fd fa fa fa 00 00 00 00[fa]fa 00 00 00 fa 0x3ea60450: fa fa fd fd fd fd fa fa fd fd fd fd fa fa fa fa 0x3ea60460: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x3ea60470: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x3ea60480: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x3ea60490: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb ==44744==ABORTING ``` <sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [grammarinator](https://github.com/renatahodovan/grammarinator). </sup>
heap-buffer-overflow in ecma_builtin_array_prototype_object_copy_within
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3408/comments
0
2019-12-03T11:57:38Z
2019-12-06T12:33:42Z
https://github.com/jerryscript-project/jerryscript/issues/3408
531,933,644
3,408
[ "jerryscript-project", "jerryscript" ]
###### JerryScript revision 51efba40 ###### 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 ```javascript function f($, [ [b, [c] = [], {} = { $: eval() }] ] = [[]], c) {} f() ``` ###### Output ```text ICE: Assertion 'ECMA_PROPERTY_VALUE_PTR (property_p)->value == ECMA_VALUE_UNINITIALIZED' failed at jerryscript/jerry-core/vm/vm.c(vm_loop):1452. Error: ERR_FAILED_INTERNAL_ASSERTION ``` ###### Backtrace ```text 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 0x5657b5c9 in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-port/default/default-fatal.c:30 #4 0x566458b6 in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:58 #5 0x566458f7 in jerry_assert_fail (assertion=0x566d3480 "ECMA_PROPERTY_VALUE_PTR (property_p)->value == ECMA_VALUE_UNINITIALIZED", file=0x566d2c80 "jerryscript/jerry-core/vm/vm.c", function=0x566b5940 <__func__.6413.lto_priv.446> "vm_loop", line=1452) at jerryscript/jerry-core/jrt/jrt-fatals.c:82 #6 0x565d469b in vm_loop (frame_ctx_p=0xffffc460) at jerryscript/jerry-core/vm/vm.c:1452 #7 0x565e3290 in vm_execute (frame_ctx_p=0xffffc460) at jerryscript/jerry-core/vm/vm.c:4079 #8 0x565e3910 in vm_run (bytecode_header_p=0xf4f03ec0, this_binding_value=4126149459, lex_env_p=0xf5d004d0, arg_list_p=0xffffc700, arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:4208 #9 0x5665ef06 in ecma_op_function_call (func_obj_p=0xf5f00850, this_arg_value=72, arguments_list_p=0xffffc700, arguments_list_len=0) at jerryscript/jerry-core/ecma/operations/ecma-function-object.c:854 #10 0x565cfe1f in opfunc_call (frame_ctx_p=0xffffc6d0) at jerryscript/jerry-core/vm/vm.c:699 #11 0x565e32f4 in vm_execute (frame_ctx_p=0xffffc6d0) at jerryscript/jerry-core/vm/vm.c:4085 #12 0x565e3910 in vm_run (bytecode_header_p=0xf5300e50, this_binding_value=4126149459, lex_env_p=0xf5d007b0, arg_list_p=0x0, arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:4208 #13 0x5662cea4 in vm_run_global (bytecode_p=0xf5300e50) at jerryscript/jerry-core/vm/vm.c:286 #14 0x56693b06 in jerry_run (func_val=4126148739) at jerryscript/jerry-core/api/jerry.c:595 #15 0x56690273 in main (argc=2, argv=0xffffcb14) at jerryscript/jerry-main/main-unix.c:740 ``` <sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [grammarinator](https://github.com/renatahodovan/grammarinator). </sup>
Assertion ECMA_PROPERTY_VALUE_PTR (property_p)->value == ECMA_VALUE_UNINITIALIZED in vm_loop
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3398/comments
1
2019-12-01T16:39:35Z
2020-01-13T14:14:00Z
https://github.com/jerryscript-project/jerryscript/issues/3398
530,758,565
3,398
[ "jerryscript-project", "jerryscript" ]
###### JerryScript revision 51efba40 ###### 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 ```javascript $++ [ ] ``` ###### Output ```text ICE: Assertion 'context.status_flags & PARSER_SCANNING_SUCCESSFUL' failed at jerryscript/jerry-core/parser/js/js-parser.c(parser_parse_source):2058. Error: ERR_FAILED_INTERNAL_ASSERTION ``` ###### Backtrace ```text 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 0x5657b5c9 in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-port/default/default-fatal.c:30 #4 0x566458b6 in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:58 #5 0x566458f7 in jerry_assert_fail (assertion=0x566d9360 "context.status_flags & PARSER_SCANNING_SUCCESSFUL", file=0x566d8600 "jerryscript/jerry-core/parser/js/js-parser.c", function=0x566b49e0 <__func__.5708.lto_priv.494> "parser_parse_source", line=2058) at jerryscript/jerry-core/jrt/jrt-fatals.c:82 #6 0x56607715 in parser_parse_source (arg_list_p=0x0, arg_list_size=0, source_p=0x567208a0 <buffer.lto_priv> "$\t++\t\r[ ]=\t{\t$:\t$}\t", source_size=19, parse_opts=0, error_location_p=0xffffc6c0) at jerryscript/jerry-core/parser/js/js-parser.c:2058 #7 0x5660a4f5 in parser_parse_script (arg_list_p=0x0, arg_list_size=0, source_p=0x567208a0 <buffer.lto_priv> "$\t++\t\r[ ]=\t{\t$:\t$}\t", source_size=19, parse_opts=0, bytecode_data_p=0xffffc780) at jerryscript/jerry-core/parser/js/js-parser.c:2521 #8 0x566934a6 in jerry_parse (resource_name_p=0xffffcd8d "/home/reni/.fuzzinator_42041//jerryscript/picireny/171637076200634188359570414344420972072.js", resource_name_length=93, source_p=0x567208a0 <buffer.lto_priv> "$\t++\t\r[ ]=\t{\t$:\t$}\t", source_size=19, parse_opts=0) at jerryscript/jerry-core/api/jerry.c:445 #9 0x5669022a in main (argc=2, argv=0xffffcb14) at jerryscript/jerry-main/main-unix.c:731 ``` <sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [grammarinator](https://github.com/renatahodovan/grammarinator). </sup>
Assertion context.status_flags & PARSER_SCANNING_SUCCESSFUL in parser_parse_source
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3397/comments
1
2019-12-01T09:33:48Z
2019-12-06T12:53:35Z
https://github.com/jerryscript-project/jerryscript/issues/3397
530,701,625
3,397
[ "jerryscript-project", "jerryscript" ]
###### JerryScript revision 51efba40 ###### 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 ```javascript function i($, b = (eval("var x"))) { function x() {} eval() } i() ``` ###### Output ```text ICE: Assertion 'ecma_find_named_property (frame_ctx_p->lex_env_p, name_p) == NULL' failed at jerryscript/jerry-core/vm/vm.c(vm_init_loop):996. Error: ERR_FAILED_INTERNAL_ASSERTION ``` ###### Backtrace ```text 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 0x5657b5c9 in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-port/default/default-fatal.c:30 #4 0x566458b6 in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:58 #5 0x566458f7 in jerry_assert_fail (assertion=0x566d2e40 "ecma_find_named_property (frame_ctx_p->lex_env_p, name_p) == NULL", file=0x566d2c80 "jerryscript/jerry-core/vm/vm.c", function=0x566b5900 <__func__.6352.lto_priv.448> "vm_init_loop", line=996) at jerryscript/jerry-core/jrt/jrt-fatals.c:82 #6 0x565d108d in vm_init_loop (frame_ctx_p=0xffffc470) at jerryscript/jerry-core/vm/vm.c:996 #7 0x565d42f8 in vm_loop (frame_ctx_p=0xffffc470) at jerryscript/jerry-core/vm/vm.c:1435 #8 0x565e3290 in vm_execute (frame_ctx_p=0xffffc470) at jerryscript/jerry-core/vm/vm.c:4079 #9 0x565e3910 in vm_run (bytecode_header_p=0xf4f031d0, this_binding_value=4126149459, lex_env_p=0xf5d00570, arg_list_p=0xffffc700, arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:4208 #10 0x5665ef06 in ecma_op_function_call (func_obj_p=0xf5f00820, this_arg_value=72, arguments_list_p=0xffffc700, arguments_list_len=0) at jerryscript/jerry-core/ecma/operations/ecma-function-object.c:854 #11 0x565cfe1f in opfunc_call (frame_ctx_p=0xffffc6d0) at jerryscript/jerry-core/vm/vm.c:699 #12 0x565e32f4 in vm_execute (frame_ctx_p=0xffffc6d0) at jerryscript/jerry-core/vm/vm.c:4085 #13 0x565e3910 in vm_run (bytecode_header_p=0xf5300e10, this_binding_value=4126149459, lex_env_p=0xf5d007b0, arg_list_p=0x0, arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:4208 #14 0x5662cea4 in vm_run_global (bytecode_p=0xf5300e10) at jerryscript/jerry-core/vm/vm.c:286 #15 0x56693b06 in jerry_run (func_val=4126148691) at jerryscript/jerry-core/api/jerry.c:595 #16 0x56690273 in main (argc=2, argv=0xffffcb14) at jerryscript/jerry-main/main-unix.c:740 ``` <sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [grammarinator](https://github.com/renatahodovan/grammarinator). </sup>
Assertion ecma_find_named_property (frame_ctx_p->lex_env_p, name_p) == NULL in vm_init_loop
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3396/comments
0
2019-12-01T09:30:51Z
2020-04-24T14:55:15Z
https://github.com/jerryscript-project/jerryscript/issues/3396
530,701,339
3,396
[ "jerryscript-project", "jerryscript" ]
###### JerryScript revision 51efba40 ###### 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 ```javascript for (var [] of [[], []]) String.prototype.split(RegExp.prototype) ``` ###### Output ```text Script Error: TypeError: Incompatible type ICE: Assertion 'object_p->type_flags_refs >= ECMA_OBJECT_REF_ONE' failed at jerryscript/jerry-core/ecma/base/ecma-gc.c(ecma_deref_object):146. Error: ERR_FAILED_INTERNAL_ASSERTION ``` ###### Backtrace ```text 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 0x5657b5c9 in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-port/default/default-fatal.c:30 #4 0x566458b6 in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:58 #5 0x566458f7 in jerry_assert_fail (assertion=0x566eeb80 "object_p->type_flags_refs >= ECMA_OBJECT_REF_ONE", file=0x566eeb20 "jerryscript/jerry-core/ecma/base/ecma-gc.c", function=0x566a6380 <__func__.5827.lto_priv.889> "ecma_deref_object", line=146) at jerryscript/jerry-core/jrt/jrt-fatals.c:82 #6 0x5669d4dd in ecma_deref_object (object_p=0xf5f01630) at jerryscript/jerry-core/ecma/base/ecma-gc.c:146 #7 0x56677490 in ecma_free_value (value=4126152243) at jerryscript/jerry-core/ecma/base/ecma-helpers-value.c:1044 #8 0x56695558 in jerry_release_value (value=4126152243) at jerryscript/jerry-core/api/jerry.c:1366 #9 0x56690a23 in main (argc=2, argv=0xffffcb14) at jerryscript/jerry-main/main-unix.c:925 ``` <sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [grammarinator](https://github.com/renatahodovan/grammarinator). </sup>
Assertion object_p->type_flags_refs >= ECMA_OBJECT_REF_ONE in ecma_deref_object
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3395/comments
0
2019-12-01T00:00:53Z
2019-12-04T13:13:44Z
https://github.com/jerryscript-project/jerryscript/issues/3395
530,645,693
3,395
[ "jerryscript-project", "jerryscript" ]
###### JerryScript revision 51efba40 ###### 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 ```javascript class Animal { } class Dog extends Animal { static explain() { super.explain(...[]) } } Dog.explain() ``` ###### Output ```text ICE: Assertion 'CBC_CALL <= next_call_opcode && next_call_opcode <= CBC_CALL2_PROP_BLOCK' failed at jerryscript/jerry-core/vm/vm.c(vm_loop):1865. Error: ERR_FAILED_INTERNAL_ASSERTION ``` ###### Backtrace ```text 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 0x5657b5c9 in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-port/default/default-fatal.c:30 #4 0x566458b6 in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:58 #5 0x566458f7 in jerry_assert_fail (assertion=0x566d3900 "CBC_CALL <= next_call_opcode && next_call_opcode <= CBC_CALL2_PROP_BLOCK", file=0x566d2c80 "jerryscript/jerry-core/vm/vm.c", function=0x566b5940 <__func__.6413.lto_priv.446> "vm_loop", line=1865) at jerryscript/jerry-core/jrt/jrt-fatals.c:82 #6 0x565d672f in vm_loop (frame_ctx_p=0xffffc210) at jerryscript/jerry-core/vm/vm.c:1865 #7 0x565e3290 in vm_execute (frame_ctx_p=0xffffc210) at jerryscript/jerry-core/vm/vm.c:4079 #8 0x565e3910 in vm_run (bytecode_header_p=0xf5300a10, this_binding_value=4126150995, lex_env_p=0xf5d001f0, arg_list_p=0xffffc4a8, arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:4208 #9 0x5665ef06 in ecma_op_function_call (func_obj_p=0xf5f011e0, this_arg_value=4126150995, arguments_list_p=0xffffc4a8, arguments_list_len=0) at jerryscript/jerry-core/ecma/operations/ecma-function-object.c:854 #10 0x565cfe1f in opfunc_call (frame_ctx_p=0xffffc470) at jerryscript/jerry-core/vm/vm.c:699 #11 0x565e32f4 in vm_execute (frame_ctx_p=0xffffc470) at jerryscript/jerry-core/vm/vm.c:4085 #12 0x565e3910 in vm_run (bytecode_header_p=0xf5300950, this_binding_value=4126150995, lex_env_p=0xf5d001b0, arg_list_p=0xffffc708, arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:4208 #13 0x5665ef06 in ecma_op_function_call (func_obj_p=0xf5f00fd0, this_arg_value=4126150995, arguments_list_p=0xffffc708, arguments_list_len=0) at jerryscript/jerry-core/ecma/operations/ecma-function-object.c:854 #14 0x565cfe1f in opfunc_call (frame_ctx_p=0xffffc6c0) at jerryscript/jerry-core/vm/vm.c:699 #15 0x565e32f4 in vm_execute (frame_ctx_p=0xffffc6c0) at jerryscript/jerry-core/vm/vm.c:4085 #16 0x565e3910 in vm_run (bytecode_header_p=0xf4d03e40, this_binding_value=4126149459, lex_env_p=0xf5d007b0, arg_list_p=0x0, arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:4208 #17 0x5662cea4 in vm_run_global (bytecode_p=0xf4d03e40) at jerryscript/jerry-core/vm/vm.c:286 #18 0x56693b06 in jerry_run (func_val=4126152291) at jerryscript/jerry-core/api/jerry.c:595 #19 0x56690273 in main (argc=2, argv=0xffffcb14) at jerryscript/jerry-main/main-unix.c:740 ``` <sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [grammarinator](https://github.com/renatahodovan/grammarinator). </sup>
Assertion CBC_CALL <= next_call_opcode && next_call_opcode <= CBC_CALL2_PROP_BLOCK in vm_loop
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3394/comments
0
2019-11-30T23:47:08Z
2019-12-04T13:13:01Z
https://github.com/jerryscript-project/jerryscript/issues/3394
530,644,584
3,394
[ "jerryscript-project", "jerryscript" ]
Strict mode functions are not allowed to access property `arguments`. However, when running this testcase blow, the output is `[object Object] `. ###### JerryScript revision [996bf76](https://github.com/jerryscript-project/jerryscript/commit/996bf76f5956c65342c1726d3f629fbea41320ab) ###### Build platform Ubuntu 16.04.6 LTS (Linux 4.15.0-55-generic x86_64) ###### Build steps python tools/build.py --clean --debug --logging=on --line-info=on --error-messages=on --cpointer-32bit=on --mem-heap=1572864 --profile=es2015-subset ###### Test case ``` var NISLFuzzingFunc = function() { print(Object.getOwnPropertyDescriptor(new Function("'use strict';"), "arguments")); }; NISLFuzzingFunc(); ``` ###### Execution steps build/bin/jerry testcase.js ###### Output [object Object] ###### Expected behavior undefined
A question about getting arguments' descriptor of strict mode functions
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3393/comments
3
2019-11-30T08:38:34Z
2020-01-23T14:53:38Z
https://github.com/jerryscript-project/jerryscript/issues/3393
530,550,994
3,393
[ "jerryscript-project", "jerryscript" ]
###### JerryScript revision 0bc42a3f ###### 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 ```javascript var replace = RegExp.prototype[Symbol.replace]; class Regexplike { exec() { return {} } } re = new Regexplike(); replace.call(re, "1"); ``` ###### Output ```text Script Error: ReferenceError: id_4 is not defined ICE: Assertion 'JERRY_CONTEXT (jmem_heap_allocated_size) == 0' failed at jerryscript/jerry-core/jmem/jmem-heap.c(jmem_heap_finalize):107. Error: ERR_FAILED_INTERNAL_ASSERTION ``` ###### Backtrace ```text 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 0x5657b5c9 in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-port/default/default-fatal.c:30 #4 0x566458c0 in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:58 #5 0x56645901 in jerry_assert_fail (assertion=0x566e0cc0 "JERRY_CONTEXT (jmem_heap_allocated_size) == 0", file=0x566e0c60 "jerryscript/jerry-core/jmem/jmem-heap.c", function=0x566ad9e0 <__func__.4953.lto_priv.112> "jmem_heap_finalize", line=107) at jerryscript/jerry-core/jrt/jrt-fatals.c:82 #6 0x56644a87 in jmem_heap_finalize () at jerryscript/jerry-core/jmem/jmem-heap.c:107 #7 0x566448ad in jmem_finalize () at jerryscript/jerry-core/jmem/jmem-allocator.c:170 #8 0x56692e04 in jerry_cleanup () at jerryscript/jerry-core/api/jerry.c:252 #9 0x56690a9a in main (argc=2, argv=0xffffcb14) at jerryscript/jerry-main/main-unix.c:938 ``` <sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [grammarinator](https://github.com/renatahodovan/grammarinator). </sup>
Assertion JERRY_CONTEXT (jmem_heap_allocated_size) == 0 in jmem_heap_finalize
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3392/comments
0
2019-11-29T22:21:37Z
2019-12-03T08:34:54Z
https://github.com/jerryscript-project/jerryscript/issues/3392
530,499,320
3,392
[ "jerryscript-project", "jerryscript" ]
###### JerryScript revision 0bc42a3f ###### 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 ```javascript var a = Promise.resolve( 'a' ); var b = Promise.reject( 'b' ); Promise.race( [ a , b ] ).then ( function ( x ) { var a , b ; [ a , b ] = [ 1 , 2 ]; String( a === 1 ); } , function ( x ) { } ); Promise.race( [ b , a ] ).then ( function ( x ) { String ( false ) ;}, function ( x ) { } ); Promise.race( [ , b , a ] ).then ( function ( x ) { String ( x === undefined ) ; }, function ( x ) { String ( false ); } ); Promise.race( a ).then ( function ( x ) { String ( false ); }, function ( x ) { String ( x.name === "TypeError" ); } ); ``` ###### Output ```text ================================================================= ==23700==ERROR: AddressSanitizer: heap-use-after-free on address 0xf54037c0 at pc 0x567804af bp 0xffef5108 sp 0xffef50f8 READ of size 2 at 0xf54037c0 thread T0 #0 0x567804ae in ecma_deref_object jerryscript/jerry-core/ecma/base/ecma-gc.c:146 #1 0x5675a499 in ecma_free_value jerryscript/jerry-core/ecma/base/ecma-helpers-value.c:1044 #2 0x5674529d in ecma_process_promise_reaction_job jerryscript/jerry-core/ecma/operations/ecma-jobqueue.c:210 #3 0x56745ce0 in ecma_process_all_enqueued_jobs jerryscript/jerry-core/ecma/operations/ecma-jobqueue.c:343 #4 0x56776c41 in jerry_run_all_enqueued_jobs jerryscript/jerry-core/api/jerry.c:632 #5 0x56773a34 in main jerryscript/jerry-main/main-unix.c:927 #6 0xf77b5e80 in __libc_start_main (/lib/i386-linux-gnu/libc.so.6+0x18e80) #7 0x56650310 (jerryscript/build_gcc_asan_es2015/bin/jerry+0x18310) 0xf54037c0 is located 0 bytes inside of 24-byte region [0xf54037c0,0xf54037d8) freed by thread T0 here: #0 0xf7a7bb74 in __interceptor_free (/usr/lib32/libasan.so.4+0xe5b74) #1 0x56727f05 in jmem_heap_free_block_internal jerryscript/jerry-core/jmem/jmem-heap.c:476 #2 0x567282b0 in jmem_heap_free_block jerryscript/jerry-core/jmem/jmem-heap.c:685 #3 0x566c69dc in ecma_dealloc_extended_object jerryscript/jerry-core/ecma/base/ecma-alloc.c:123 #4 0x567845cf in ecma_gc_free_object jerryscript/jerry-core/ecma/base/ecma-gc.c:1258 #5 0x567851d1 in ecma_gc_run jerryscript/jerry-core/ecma/base/ecma-gc.c:1385 #6 0x56785442 in ecma_free_unused_memory jerryscript/jerry-core/ecma/base/ecma-gc.c:1431 #7 0x56727c8d in jmem_heap_gc_and_alloc_block jerryscript/jerry-core/jmem/jmem-heap.c:286 #8 0x56727d2d in jmem_heap_alloc_block jerryscript/jerry-core/jmem/jmem-heap.c:322 #9 0x566c69b9 in ecma_alloc_extended_object jerryscript/jerry-core/ecma/base/ecma-alloc.c:109 #10 0x5675a85b in ecma_create_object jerryscript/jerry-core/ecma/base/ecma-helpers.c:82 #11 0x56743e82 in ecma_op_create_iterator_object jerryscript/jerry-core/ecma/operations/ecma-iterator-object.c:145 #12 0x566d88bf in ecma_builtin_array_iterators_helper jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype.c:2422 #13 0x566d8b2c in ecma_builtin_array_prototype_dispatch_routine jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype.c:2492 #14 0x5676f805 in ecma_builtin_dispatch_routine jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.c:1020 #15 0x5676fa66 in ecma_builtin_dispatch_call jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.c:1045 #16 0x56741bbf in ecma_op_function_call jerryscript/jerry-core/ecma/operations/ecma-function-object.c:773 #17 0x56744094 in ecma_op_get_iterator jerryscript/jerry-core/ecma/operations/ecma-iterator-object.c:207 #18 0x566b9bcc in vm_loop jerryscript/jerry-core/vm/vm.c:1933 #19 0x566c628f in vm_execute jerryscript/jerry-core/vm/vm.c:4079 #20 0x566c690f in vm_run jerryscript/jerry-core/vm/vm.c:4208 #21 0x56741f0f in ecma_op_function_call jerryscript/jerry-core/ecma/operations/ecma-function-object.c:854 #22 0x5674502a in ecma_process_promise_reaction_job jerryscript/jerry-core/ecma/operations/ecma-jobqueue.c:170 #23 0x56745ce0 in ecma_process_all_enqueued_jobs jerryscript/jerry-core/ecma/operations/ecma-jobqueue.c:343 #24 0x56776c41 in jerry_run_all_enqueued_jobs jerryscript/jerry-core/api/jerry.c:632 #25 0x56773a34 in main jerryscript/jerry-main/main-unix.c:927 #26 0xf77b5e80 in __libc_start_main (/lib/i386-linux-gnu/libc.so.6+0x18e80) previously allocated by thread T0 here: #0 0xf7a7bf34 in malloc (/usr/lib32/libasan.so.4+0xe5f34) #1 0x56727bbd in jmem_heap_alloc jerryscript/jerry-core/jmem/jmem-heap.c:254 #2 0x56727c9b in jmem_heap_gc_and_alloc_block jerryscript/jerry-core/jmem/jmem-heap.c:289 #3 0x56727d2d in jmem_heap_alloc_block jerryscript/jerry-core/jmem/jmem-heap.c:322 #4 0x566c69b9 in ecma_alloc_extended_object jerryscript/jerry-core/ecma/base/ecma-alloc.c:109 #5 0x5675a85b in ecma_create_object jerryscript/jerry-core/ecma/base/ecma-helpers.c:82 #6 0x5673f98d in ecma_new_standard_error jerryscript/jerry-core/ecma/operations/ecma-exceptions.c:137 #7 0x5673fb80 in ecma_new_standard_error_with_message jerryscript/jerry-core/ecma/operations/ecma-exceptions.c:203 #8 0x5673fc53 in ecma_raise_standard_error jerryscript/jerry-core/ecma/operations/ecma-exceptions.c:233 #9 0x567402de in ecma_raise_type_error jerryscript/jerry-core/ecma/operations/ecma-exceptions.c:408 #10 0x566aad4f in ecma_builtin_promise_reject_abrupt jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-promise.c:129 #11 0x566ac3a6 in ecma_builtin_promise_race_or_all jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-promise.c:596 #12 0x566ac47e in ecma_builtin_promise_race jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-promise.c:633 #13 0x566aaa76 in ecma_builtin_promise_dispatch_routine jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-promise.inc.h:42 #14 0x5676f805 in ecma_builtin_dispatch_routine jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.c:1020 #15 0x5676fa66 in ecma_builtin_dispatch_call jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.c:1045 #16 0x56741bbf in ecma_op_function_call jerryscript/jerry-core/ecma/operations/ecma-function-object.c:773 #17 0x566b2e1e in opfunc_call jerryscript/jerry-core/vm/vm.c:699 #18 0x566c62f3 in vm_execute jerryscript/jerry-core/vm/vm.c:4085 #19 0x566c690f in vm_run jerryscript/jerry-core/vm/vm.c:4208 #20 0x5670fead in vm_run_global jerryscript/jerry-core/vm/vm.c:286 #21 0x56776b0f in jerry_run jerryscript/jerry-core/api/jerry.c:595 #22 0x5677327c in main jerryscript/jerry-main/main-unix.c:740 #23 0xf77b5e80 in __libc_start_main (/lib/i386-linux-gnu/libc.so.6+0x18e80) SUMMARY: AddressSanitizer: heap-use-after-free jerryscript/jerry-core/ecma/base/ecma-gc.c:146 in ecma_deref_object Shadow bytes around the buggy address: 0x3ea806a0: fd fa fa fa fd fd fd fa fa fa fd fd fd fa fa fa 0x3ea806b0: fd fd fd fa fa fa fd fd fd fa fa fa fd fd fd fa 0x3ea806c0: fa fa fd fd fd fa fa fa fd fd fd fd fa fa fd fd 0x3ea806d0: fd fd fa fa fd fd fd fa fa fa fd fd fd fa fa fa 0x3ea806e0: fd fd fd fa fa fa fd fd fd fd fa fa fd fd fd fd =>0x3ea806f0: fa fa fd fd fd fa fa fa[fd]fd fd fa fa fa 00 00 0x3ea80700: 00 fa fa fa 00 00 00 fa fa fa fd fd fd fa fa fa 0x3ea80710: fd fd fd fa fa fa fd fd fd fa fa fa fd fd fd fa 0x3ea80720: fa fa fd fd fd fa fa fa fd fd fd fa fa fa fd fd 0x3ea80730: fd fa fa fa fd fd fd fa fa fa fd fd fd fd fa fa 0x3ea80740: fd fd fd fd fa fa fa fa fa fa fa fa fa fa fa fa Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb ==23700==ABORTING ``` <sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [grammarinator](https://github.com/renatahodovan/grammarinator). </sup>
heap-use-after-free in ecma_deref_object
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3390/comments
0
2019-11-29T19:50:55Z
2019-12-03T08:34:39Z
https://github.com/jerryscript-project/jerryscript/issues/3390
530,473,568
3,390
[ "jerryscript-project", "jerryscript" ]
###### JerryScript revision 0bc42a3f ###### 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 ```javascript var replace = RegExp.prototype[ Symbol.replace ]; o = { global : true , exec : ( ) => { return { get 0 ( ) { return { toString : ( ) => { return "" } } } } } } Object.defineProperty ( o, 'lastIndex', { get : ( ) => { return Infinity } , set : ( ) => { } } ) replace.call( o ) ``` ###### Output ```text ICE: Assertion 'index < UINT32_MAX - 1' failed at jerryscript/jerry-core/ecma/base/ecma-helpers-string.c(ecma_op_advance_string_index):2819. Error: ERR_FAILED_INTERNAL_ASSERTION ``` ###### Backtrace ```text 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 0x5657b5c9 in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-port/default/default-fatal.c:30 #4 0x566458c0 in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:58 #5 0x56645901 in jerry_assert_fail (assertion=0x566e8500 "index < UINT32_MAX - 1", file=0x566e6da0 "jerryscript/jerry-core/ecma/base/ecma-helpers-string.c", function=0x566a7a00 <__func__.4428.lto_priv.782> "ecma_op_advance_string_index", line=2819) at jerryscript/jerry-core/jrt/jrt-fatals.c:82 #6 0x56674878 in ecma_op_advance_string_index (str_p=0x100d, index=4294967295, is_unicode=false) at jerryscript/jerry-core/ecma/base/ecma-helpers-string.c:2819 #7 0x5663e8a2 in ecma_regexp_replace_helper (this_arg=4124055507, string_arg=4109, replace_arg=4941) at jerryscript/jerry-core/ecma/operations/ecma-regexp-object.c:1997 #8 0x565cbaab in ecma_builtin_regexp_prototype_symbol_replace (this_arg=4124055507, string_arg=4109, replace_arg=4941) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-regexp-prototype.c:617 #9 0x565c9f47 in ecma_builtin_regexp_prototype_dispatch_routine (builtin_routine_id=84, this_arg_value=4124055507, arguments_list=0xffffc1c0, arguments_number=2) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-regexp-prototype.inc.h:58 #10 0x5668c806 in ecma_builtin_dispatch_routine (builtin_object_id=ECMA_BUILTIN_ID_REGEXP_PROTOTYPE, builtin_routine_id=84, this_arg_value=4124055507, arguments_list_p=0xffffc1c0, arguments_list_len=2) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.c:1020 #11 0x5668ca67 in ecma_builtin_dispatch_call (obj_p=0xf5f01c30, this_arg_value=4124055507, arguments_list_p=0xffffc6fc, arguments_list_len=2) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.c:1045 #12 0x5665ebc0 in ecma_op_function_call (func_obj_p=0xf5f01c30, this_arg_value=4124055507, arguments_list_p=0xffffc6fc, arguments_list_len=2) at jerryscript/jerry-core/ecma/operations/ecma-function-object.c:773 #13 0x565b7a6d in ecma_builtin_function_prototype_object_call (func_obj_p=0xf5f01c30, arguments_list_p=0xffffc6f8, arguments_number=3) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-function-prototype.c:190 #14 0x565b8005 in ecma_builtin_function_prototype_dispatch_routine (builtin_routine_id=78, this_arg=4126153779, arguments_list_p=0xffffc6f8, arguments_number=3) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-function-prototype.c:337 #15 0x5668c806 in ecma_builtin_dispatch_routine (builtin_object_id=ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE, builtin_routine_id=78, this_arg_value=4126153779, arguments_list_p=0xffffc6f8, arguments_list_len=3) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.c:1020 #16 0x5668ca67 in ecma_builtin_dispatch_call (obj_p=0xf5f01bd0, this_arg_value=4126153779, arguments_list_p=0xffffc6f8, arguments_list_len=3) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.c:1045 #17 0x5665ebc0 in ecma_op_function_call (func_obj_p=0xf5f01bd0, this_arg_value=4126153779, arguments_list_p=0xffffc6f8, arguments_list_len=3) at jerryscript/jerry-core/ecma/operations/ecma-function-object.c:773 #18 0x565cfe1f in opfunc_call (frame_ctx_p=0xffffc6b0) at jerryscript/jerry-core/vm/vm.c:699 #19 0x565e32f4 in vm_execute (frame_ctx_p=0xffffc6b0) at jerryscript/jerry-core/vm/vm.c:4085 #20 0x565e3910 in vm_run (bytecode_header_p=0xf4703280, this_binding_value=4126149459, lex_env_p=0xf5d007b0, arg_list_p=0x0, arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:4208 #21 0x5662ceae in vm_run_global (bytecode_p=0xf4703280) at jerryscript/jerry-core/vm/vm.c:286 #22 0x56693b10 in jerry_run (func_val=4126154403) at jerryscript/jerry-core/api/jerry.c:595 #23 0x5669027d in main (argc=2, argv=0xffffcb14) at jerryscript/jerry-main/main-unix.c:740 ``` <sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [grammarinator](https://github.com/renatahodovan/grammarinator). </sup>
Assertion index < UINT32_MAX - 1 in ecma_op_advance_string_index
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3389/comments
0
2019-11-29T19:42:11Z
2019-12-04T10:14:26Z
https://github.com/jerryscript-project/jerryscript/issues/3389
530,471,826
3,389
[ "jerryscript-project", "jerryscript" ]
###### JerryScript revision 0bc42a3f ###### 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 ```javascript Date.parse("Thu Apr 10 1997") ``` ###### Output ```text ================================================================= ==4373==ERROR: AddressSanitizer: heap-buffer-overflow on address 0xf540095b at pc 0x566a543f bp 0xffbc90f8 sp 0xffbc90e8 READ of size 1 at 0xf540095b thread T0 #0 0x566a543e in ecma_date_parse_year.lto_priv.393 jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-date.c:117 #1 0x56661f1d in ecma_builtin_date_parse_toString_formats jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-date.c:506 #2 0x56662497 in ecma_builtin_date_parse.lto_priv.453 jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-date.c:644 #3 0x566a50ab in ecma_builtin_date_dispatch_routine jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-date.inc.h:33 #4 0x567072b4 in ecma_builtin_dispatch_routine jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.c:1020 #5 0x56707515 in ecma_builtin_dispatch_call jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.c:1045 #6 0x566db7d1 in ecma_op_function_call jerryscript/jerry-core/ecma/operations/ecma-function-object.c:773 #7 0x5667bd00 in opfunc_call jerryscript/jerry-core/vm/vm.c:699 #8 0x5668f1d5 in vm_execute jerryscript/jerry-core/vm/vm.c:4085 #9 0x5668f7f1 in vm_run jerryscript/jerry-core/vm/vm.c:4208 #10 0x566d9191 in vm_run_global jerryscript/jerry-core/vm/vm.c:286 #11 0x56725817 in jerry_run jerryscript/jerry-core/api/jerry.c:595 #12 0x56721fcd in main jerryscript/jerry-main/main-unix.c:740 #13 0xf77a8e80 in __libc_start_main (/lib/i386-linux-gnu/libc.so.6+0x18e80) #14 0x56619200 (jerryscript/build_gcc_asan_es2015/bin/jerry+0x18200) 0xf540095b is located 0 bytes to the right of 27-byte region [0xf5400940,0xf540095b) allocated by thread T0 here: #0 0xf7a6ef34 in malloc (/usr/lib32/libasan.so.4+0xe5f34) #1 0x566facc1 in jmem_heap_alloc jerryscript/jerry-core/jmem/jmem-heap.c:254 #2 0x566fad9f in jmem_heap_gc_and_alloc_block jerryscript/jerry-core/jmem/jmem-heap.c:289 #3 0x566fae31 in jmem_heap_alloc_block jerryscript/jerry-core/jmem/jmem-heap.c:322 #4 0x5668f960 in ecma_alloc_string_buffer jerryscript/jerry-core/ecma/base/ecma-alloc.c:194 #5 0x56739463 in ecma_new_ecma_string_from_utf8_buffer jerryscript/jerry-core/ecma/base/ecma-helpers-string.c:293 #6 0x56739463 in ecma_new_ecma_string_from_utf8 jerryscript/jerry-core/ecma/base/ecma-helpers-string.c:388 #7 0x5674e207 in ecma_find_or_create_literal_string jerryscript/jerry-core/ecma/base/ecma-literal-storage.c:134 #8 0x566b0411 in parser_post_processing jerryscript/jerry-core/parser/js/js-parser.c:1529 #9 0x566b3958 in parser_parse_source jerryscript/jerry-core/parser/js/js-parser.c:2054 #10 0x566b67da in parser_parse_script jerryscript/jerry-core/parser/js/js-parser.c:2521 #11 0x567251b7 in jerry_parse jerryscript/jerry-core/api/jerry.c:445 #12 0x56721f84 in main jerryscript/jerry-main/main-unix.c:731 #13 0xf77a8e80 in __libc_start_main (/lib/i386-linux-gnu/libc.so.6+0x18e80) SUMMARY: AddressSanitizer: heap-buffer-overflow jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-date.c:117 in ecma_date_parse_year.lto_priv.393 Shadow bytes around the buggy address: 0x3ea800d0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x3ea800e0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x3ea800f0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x3ea80100: fa fa fa fa fa fa fa fa fa fa 00 00 00 fa fa fa 0x3ea80110: 00 00 00 fa fa fa 00 00 00 fa fa fa 00 00 00 fa =>0x3ea80120: fa fa 00 00 00 fa fa fa 00 00 00[03]fa fa 00 00 0x3ea80130: 00 fa fa fa 00 00 00 fa fa fa 00 00 00 fa fa fa 0x3ea80140: 00 00 00 fa fa fa 00 00 01 fa fa fa 00 00 00 fa 0x3ea80150: fa fa 00 00 00 fa fa fa 00 00 00 fa fa fa 00 00 0x3ea80160: 00 fa fa fa 00 00 02 fa fa fa 00 00 00 00 fa fa 0x3ea80170: 00 00 00 fa fa fa fa fa fa fa fa fa fa fa fa fa Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb ==4373==ABORTING ``` <sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [grammarinator](https://github.com/renatahodovan/grammarinator). </sup>
heap-buffer-overflow in ecma_date_parse_year
https://api.github.com/repos/jerryscript-project/jerryscript/issues/3388/comments
0
2019-11-29T19:20:40Z
2019-12-03T12:42:39Z
https://github.com/jerryscript-project/jerryscript/issues/3388
530,467,484
3,388