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"
] | ###### Jerry version:
```
Checked revision: 6fe4d06
Build command: ./tools/build.py --clean --debug --profile=es2015-subset --compile-flag=-m32 --system-allocator=on --jerry-libc=off --error-messages=on
```
###### OS:
```
Ubuntu 16.04.2 LTS
```
###### Test case:
```javascript
function $ ( ) { function $ ( ) { switch ( $ ? $ : \u018E ) {} } }
```
###### Backtrace:
```
ICE: Assertion 'JERRY_CONTEXT (jmem_heap_allocated_size) == 0' failed at jerryscript//jerry-core/jmem/jmem-heap.c(jmem_heap_finalize):184.
Error: ERR_FAILED_INTERNAL_ASSERTION
```
<sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [Grammarinator](https://github.com/renatahodovan/grammarinator)</sup>
| in jmem_heap_finalize | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1946/comments | 0 | 2017-08-01T13:32:00Z | 2017-08-01T13:33:14Z | https://github.com/jerryscript-project/jerryscript/issues/1946 | 247,070,264 | 1,946 |
[
"jerryscript-project",
"jerryscript"
] | ###### Jerry version:
```
Checked revision: 6fe4d06
Build command: ./tools/build.py --clean --debug --profile=es2015-subset --compile-flag=-m32 --system-allocator=on --jerry-libc=off --error-messages=on
```
###### OS:
```
Ubuntu 16.04.2 LTS
```
###### Test case:
```javascript
function $ ( ) { function $ ( ) { switch ( $ ? $ : \u018E ) {} } }
```
###### Backtrace:
```
ICE: Assertion 'JERRY_CONTEXT (jmem_heap_allocated_size) == 0' failed at jerryscript//jerry-core/jmem/jmem-heap.c(jmem_heap_finalize):184.
Error: ERR_FAILED_INTERNAL_ASSERTION
```
<sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [Grammarinator](https://github.com/renatahodovan/grammarinator)</sup>
| in jmem_heap_finalize | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1945/comments | 0 | 2017-08-01T13:31:58Z | 2017-08-01T13:33:06Z | https://github.com/jerryscript-project/jerryscript/issues/1945 | 247,070,256 | 1,945 |
[
"jerryscript-project",
"jerryscript"
] | ###### Jerry version:
```
Checked revision: 6fe4d06
Build command: ./tools/build.py --clean --debug --profile=es2015-subset --compile-flag=-m32 --system-allocator=on --jerry-libc=off --error-messages=on
```
###### OS:
```
Ubuntu 16.04.2 LTS
```
###### Test case:
```javascript
function $ ( ) { function $ ( ) { switch ( $ ? $ : \u018E ) {} } }
```
###### Backtrace:
```
ICE: Assertion 'JERRY_CONTEXT (jmem_heap_allocated_size) == 0' failed at jerryscript//jerry-core/jmem/jmem-heap.c(jmem_heap_finalize):184.
Error: ERR_FAILED_INTERNAL_ASSERTION
```
<sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [Grammarinator](https://github.com/renatahodovan/grammarinator)</sup>
| in jmem_heap_finalize | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1944/comments | 0 | 2017-08-01T13:31:57Z | 2017-08-01T13:32:58Z | https://github.com/jerryscript-project/jerryscript/issues/1944 | 247,070,253 | 1,944 |
[
"jerryscript-project",
"jerryscript"
] | ###### Jerry version:
```
Checked revision: 6fe4d06
Build command: ./tools/build.py --clean --debug --profile=es2015-subset --compile-flag=-m32 --system-allocator=on --jerry-libc=off --error-messages=on
```
###### OS:
```
Ubuntu 16.04.2 LTS
```
###### Test case:
```javascript
function $ ( ) { function $ ( ) { switch ( $ ? $ : \u018E ) {} } }
```
###### Backtrace:
```
ICE: Assertion 'JERRY_CONTEXT (jmem_heap_allocated_size) == 0' failed at jerryscript//jerry-core/jmem/jmem-heap.c(jmem_heap_finalize):184.
Error: ERR_FAILED_INTERNAL_ASSERTION
```
<sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [Grammarinator](https://github.com/renatahodovan/grammarinator)</sup>
| in jmem_heap_finalize | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1943/comments | 0 | 2017-08-01T13:31:57Z | 2017-08-01T13:32:50Z | https://github.com/jerryscript-project/jerryscript/issues/1943 | 247,070,248 | 1,943 |
[
"jerryscript-project",
"jerryscript"
] | ###### Jerry version:
```
Checked revision: 1526bcc
Build command: ./tools/build.py --clean --debug --profile=es2015-subset --compile-flag=-m32 --system-allocator=on --jerry-libc=off --error-messages=on
```
###### OS:
```
macOS Sierra (10.12.5)
```
###### Test case:
```javascript
Object.defineProperties(constructor.isExtensible, {a: Object.getOwnPropertyDescriptor(Uint8ClampedArray, "length")})
new Int32Array(new ArrayBuffer(), undefined, Date.now())
```
###### Backtrace:
```
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):43.
Error: ERR_FAILED_INTERNAL_ASSERTION
bt
* thread #1: tid = 0x19fc2d, 0xa1659496 libsystem_kernel.dylib`__pthread_kill + 10, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
* frame #0: 0xa1659496 libsystem_kernel.dylib`__pthread_kill + 10
frame #1: 0xa173fc63 libsystem_pthread.dylib`pthread_kill + 90
frame #2: 0xa15b9a34 libsystem_c.dylib`abort + 141
frame #3: 0x000e7df7 jerry`jerry_port_fatal(code=ERR_FAILED_INTERNAL_ASSERTION) + 55 at default-fatal.c:71
frame #4: 0x00019b9b jerry`jerry_fatal(code=ERR_FAILED_INTERNAL_ASSERTION) + 219 at jrt-fatals.c:58
frame #5: 0x00007b52 jerry`jerry_assert_fail(assertion="ECMA_STRING_IS_REF_EQUALS_TO_ONE (string_p)", file="jerryscript/jerry-core/ecma/base/ecma-literal-storage.c", function="ecma_free_string_list", line=43) + 114 at jrt-fatals.c:82
frame #6: 0x0003a155 jerry`ecma_free_string_list(string_list_p=0x00400cc0) + 421 at ecma-literal-storage.c:43
frame #7: 0x00039f93 jerry`ecma_finalize_lit_storage + 35 at ecma-literal-storage.c:60
frame #8: 0x00004aaa jerry`ecma_finalize + 58 at ecma-init-finalize.c:65
frame #9: 0x00004a16 jerry`jerry_cleanup + 198 at jerry.c:178
frame #10: 0x00002fbf jerry`main(argc=3, argv=0xbffffa78) + 4239 at main-unix.c:796
frame #11: 0xa152a395 libdyld.dylib`start + 1
```
<sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/)</sup>
| Assertion 'ECMA_STRING_IS_REF_EQUALS_TO_ONE (string_p)' failed in ecma_free_string_list | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1936/comments | 1 | 2017-07-21T22:19:36Z | 2019-01-02T10:00:31Z | https://github.com/jerryscript-project/jerryscript/issues/1936 | 244,796,690 | 1,936 |
[
"jerryscript-project",
"jerryscript"
] | run latest `jerry` with following test case, will encounter `Script Error: TypeError`, with `node` no error occur.
jerry is build by
```bash
python tools/build.py
```
git header
```
d75710c `replace_str_curr_p` must be inspected before dereferencing (#1926)
ce1d555 Fix regression after #1927
```
test case
```js
var devNum = 38;
var devQueue = [];
for (var i = 0; i < devNum; i++) {
devQueue.push(i);
}
for (var j = 0; j < devNum; j++) {
print(devQueue[0], devQueue.length);
devQueue.shift();
devQueue.unshift(1);
devQueue.shift();
}
```
| build-in array shift/unshift error | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1934/comments | 2 | 2017-07-21T01:24:59Z | 2017-08-02T06:19:49Z | https://github.com/jerryscript-project/jerryscript/issues/1934 | 244,539,562 | 1,934 |
[
"jerryscript-project",
"jerryscript"
] | Hi,
I have a question.
Please tell me where is problem on JScode via Jerryscript.
I try to build JScode on JerryScript.
But this error(?) occurs and JScode doesn't run.
> start
> ret1 = 0x20003c07
> ret2 = 0x20003c2f
I think `ret2` is byte code address. But it doesn't teach me where is problem on JScode.
(Its JScode can run my environment. Only JScode. not use JerryScript)
I want to know where is problem of my JScode on JerryScript.
Thank you for being patient with my English. | check JScode error on JerryScript | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1929/comments | 11 | 2017-07-19T09:09:42Z | 2017-07-24T02:00:44Z | https://github.com/jerryscript-project/jerryscript/issues/1929 | 243,972,566 | 1,929 |
[
"jerryscript-project",
"jerryscript"
] | ###### Jerry version:
```
Checked revision: 3d744c9
Build command: ./tools/build.py --clean --debug --compile-flag=-fsanitize=address --profile=es2015-subset --compile-flag=-m32 --compile-flag=-fno-omit-frame-pointer --compile-flag=-fno-common --compile-flag=-g --jerry-libc=off --static-link=off --strip=off --system-allocator=on --linker-flag=-fuse-ld=gold --error-messages=on
```
###### OS:
```
Ubuntu 16.04.2 LTS
```
###### Test case:
```javascript
throw $ = {name: function () {}}
```
###### Backtrace:
```
Script Error: [object 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):43.
Error: ERR_FAILED_INTERNAL_ASSERTION
bt
#0 0xf7fd8be9 in __kernel_vsyscall ()
#1 0xf7897ea9 in raise () from /lib/i386-linux-gnu/libc.so.6
#2 0xf7899407 in abort () from /lib/i386-linux-gnu/libc.so.6
#3 0x08054cf9 in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-port/default/default-fatal.c:71
#4 0x0809c7f9 in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:58
#5 0x0809c82c in jerry_assert_fail (assertion=0x8138960 "ECMA_STRING_IS_REF_EQUALS_TO_ONE (string_p)", file=0x81388e0 "jerryscript/jerry-core/ecma/base/ecma-literal-storage.c", function=0x812df20 <__func__.3753.lto_priv.233> "ecma_free_string_list", line=43) at jerryscript/jerry-core/jrt/jrt-fatals.c:82
#6 0x080647e8 in ecma_free_string_list (string_list_p=0xf61006d0) at jerryscript/jerry-core/ecma/base/ecma-literal-storage.c:43
#7 0x080648c9 in ecma_finalize_lit_storage () at jerryscript/jerry-core/ecma/base/ecma-literal-storage.c:60
#8 0x080f2899 in ecma_finalize () at jerryscript/jerry-core/ecma/base/ecma-init-finalize.c:65
#9 0x08115657 in jerry_cleanup () at jerryscript/jerry-core/api/jerry.c:178
#10 0x08113a4b in main (argc=3, argv=0xffffc3b4) at jerryscript/jerry-main/main-unix.c:795
```
<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)' failed in ecma_free_string_list | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1918/comments | 0 | 2017-07-13T09:28:47Z | 2017-07-18T22:19:03Z | https://github.com/jerryscript-project/jerryscript/issues/1918 | 242,639,937 | 1,918 |
[
"jerryscript-project",
"jerryscript"
] | ###### Jerry version:
```
Checked revision: 3d744c9
Build command: ./tools/build.py --clean --debug --compile-flag=-fsanitize=address --profile=es2015-subset --compile-flag=-m32 --compile-flag=-fno-omit-frame-pointer --compile-flag=-fno-common --compile-flag=-g --jerry-libc=off --static-link=off --strip=off --system-allocator=on --linker-flag=-fuse-ld=gold --error-messages=on
```
###### OS:
```
Ubuntu 16.04.2 LTS
```
###### Test case:
```javascript
'foobar'.replace(/(ob)/g, '$0')
```
###### Backtrace:
```
=================================================================
==24066==ERROR: AddressSanitizer: heap-buffer-overflow on address 0xf4d01fba at pc 0x080d0caa bp 0xff891968 sp 0xff891958
READ of size 1 at 0xf4d01fba thread T0
#0 0x80d0ca9 in ecma_builtin_string_prototype_object_replace_get_string jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-string-prototype.c:912
#1 0x80d14f0 in ecma_builtin_string_prototype_object_replace_loop jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-string-prototype.c:1085
#2 0x80d1d22 in ecma_builtin_string_prototype_object_replace_main jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-string-prototype.c:1195
#3 0x80d21f9 in ecma_builtin_string_prototype_object_replace.lto_priv.580 jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-string-prototype.c:1290
#4 0x80d8528 in ecma_builtin_string_prototype_dispatch_routine jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-string-prototype.inc.h:54
#5 0x80ee188 in ecma_builtin_dispatch_routine jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.inc.h:55
#6 0x80ee93c in ecma_builtin_dispatch_call jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.c:844
#7 0x80bc538 in ecma_op_function_call jerryscript/jerry-core/ecma/operations/ecma-function-object.c:458
#8 0x8081f95 in opfunc_call.lto_priv.253 jerryscript/jerry-core/vm/vm.c:411
#9 0x8069876 in vm_execute jerryscript/jerry-core/vm/vm.c:2746
#10 0x8069e07 in vm_run jerryscript/jerry-core/vm/vm.c:2826
#11 0x80bc75b in ecma_op_function_call jerryscript/jerry-core/ecma/operations/ecma-function-object.c:521
#12 0x8081f95 in opfunc_call.lto_priv.253 jerryscript/jerry-core/vm/vm.c:411
#13 0x8069876 in vm_execute jerryscript/jerry-core/vm/vm.c:2746
#14 0x8069e07 in vm_run jerryscript/jerry-core/vm/vm.c:2826
#15 0x80bc75b in ecma_op_function_call jerryscript/jerry-core/ecma/operations/ecma-function-object.c:521
#16 0x8081f95 in opfunc_call.lto_priv.253 jerryscript/jerry-core/vm/vm.c:411
#17 0x8069876 in vm_execute jerryscript/jerry-core/vm/vm.c:2746
#18 0x8069e07 in vm_run jerryscript/jerry-core/vm/vm.c:2826
#19 0x808163e in vm_run_global jerryscript/jerry-core/vm/vm.c:231
#20 0x8115ee6 in jerry_run jerryscript/jerry-core/api/jerry.c:409
#21 0x81136e5 in main jerryscript/jerry-main/main-unix.c:694
#22 0xf6fb4636 in __libc_start_main (/lib/i386-linux-gnu/libc.so.6+0x18636)
#23 0x8048e90 (jerryscript/build/bin/jerry+0x8048e90)
0xf4d01fba is located 0 bytes to the right of 10-byte region [0xf4d01fb0,0xf4d01fba)
allocated by thread T0 here:
#0 0xf7205dee in malloc (/usr/lib32/libasan.so.2+0x96dee)
#1 0x80ab1a8 in jmem_heap_alloc_block_internal jerryscript/jerry-core/jmem/jmem-heap.c:326
#2 0x80ab260 in jmem_heap_gc_and_alloc_block.lto_priv.399 jerryscript/jerry-core/jmem/jmem-heap.c:362
#3 0x809bfa1 in jmem_heap_alloc_block jerryscript/jerry-core/jmem/jmem-heap.c:408
#4 0x810d1fa in ecma_alloc_string_buffer jerryscript/jerry-core/ecma/base/ecma-alloc.c:184
#5 0x80f96f6 in ecma_new_ecma_string_from_utf8 jerryscript/jerry-core/ecma/base/ecma-helpers-string.c:190
#6 0x806492c in ecma_find_or_create_literal_string jerryscript/jerry-core/ecma/base/ecma-literal-storage.c:73
#7 0x8090a26 in parser_post_processing jerryscript/jerry-core/parser/js/js-parser.c:1872
#8 0x8092fd8 in parser_parse_function jerryscript/jerry-core/parser/js/js-parser.c:2356
#9 0x8085177 in lexer_construct_function_object jerryscript/jerry-core/parser/js/js-lexer.c:1648
#10 0x8088b41 in parser_parse_function_statement.lto_priv.284 jerryscript/jerry-core/parser/js/js-parser-statm.c:442
#11 0x8078879 in parser_parse_statements jerryscript/jerry-core/parser/js/js-parser-statm.c:1797
#12 0x80914aa in parser_parse_source jerryscript/jerry-core/parser/js/js-parser.c:2042
#13 0x80937bf in parser_parse_script jerryscript/jerry-core/parser/js/js-parser.c:2496
#14 0x8115c0e in jerry_parse jerryscript/jerry-core/api/jerry.c:310
#15 0x8115d5c in jerry_parse_named_resource jerryscript/jerry-core/api/jerry.c:365
#16 0x811369c in main jerryscript/jerry-main/main-unix.c:685
#17 0xf6fb4636 in __libc_start_main (/lib/i386-linux-gnu/libc.so.6+0x18636)
SUMMARY: AddressSanitizer: heap-buffer-overflow jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-string-prototype.c:912 ecma_builtin_string_prototype_object_replace_get_string
Shadow bytes around the buggy address:
0x3e9a03a0: fa fa 00 04 fa fa 00 00 fa fa 00 04 fa fa fd fd
0x3e9a03b0: fa fa 00 fa fa fa 00 06 fa fa 00 00 fa fa 00 05
0x3e9a03c0: fa fa fd fd fa fa fd fd fa fa fd fd fa fa 00 00
0x3e9a03d0: fa fa 00 05 fa fa 00 00 fa fa 00 00 fa fa 00 00
0x3e9a03e0: fa fa 00 03 fa fa 00 04 fa fa 00 03 fa fa 00 00
=>0x3e9a03f0: fa fa 00 04 fa fa 00[02]fa fa 00 04 fa fa 00 00
0x3e9a0400: fa fa fd fd fa fa fd fd fa fa fd fd fa fa 00 03
0x3e9a0410: fa fa 00 fa fa fa 00 fa fa fa 00 00 fa fa 00 fa
0x3e9a0420: fa fa 00 fa fa fa 00 fa fa fa 00 00 fa fa 00 03
0x3e9a0430: fa fa fd fd fa fa 00 01 fa fa 00 06 fa fa 00 00
0x3e9a0440: fa fa fd fd fa fa fd fd fa fa fd fa fa fa fd fd
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
Heap right redzone: fb
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack partial redzone: f4
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
==24066==ABORTING
```
<sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/)</sup>
| heap-buffer-overflow in ecma_builtin_string_prototype_object_replace_get_string | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1917/comments | 0 | 2017-07-13T09:24:45Z | 2017-07-20T08:26:51Z | https://github.com/jerryscript-project/jerryscript/issues/1917 | 242,638,820 | 1,917 |
[
"jerryscript-project",
"jerryscript"
] | It seems that there is the issue in the following example function stated in https://github.com/jerryscript-project/jerryscript/blob/master/docs/03.API-EXAMPLE.md#step-5-description-of-jerryscript-value-descriptors.
```c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "jerryscript.h"
static void
print_value ( const jerry_value_t value)
{
(snip)
/* String value */
else if (jerry_value_is_string (value))
{
/* Determining required buffer size */
jerry_size_t req_sz = jerry_get_string_size (value);
jerry_char_t str_buf_p[req_sz];
jerry_string_to_char_buffer (value, str_buf_p, req_sz);
str_buf_p[req_sz] = '\0';
(snip)
```
Should the size of str_bug_p be not **req_sz** but **req_sz+1**? Otherwise, the stack area is thought to become corrupted. | Issue in 03.API-EXAMPLE.md | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1916/comments | 3 | 2017-07-13T08:55:12Z | 2017-07-17T13:16:44Z | https://github.com/jerryscript-project/jerryscript/issues/1916 | 242,630,554 | 1,916 |
[
"jerryscript-project",
"jerryscript"
] | @zherczeg @janjongboom
Is there any chance of creating a test system, which would test jerryscript on mbedos5? Perhaps make a directory into jerryscript/targets/mbedos5, which would contain the test files or would create a completely new repo for that. | Test system for mbedos5 | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1913/comments | 5 | 2017-07-10T10:11:15Z | 2019-10-25T19:05:13Z | https://github.com/jerryscript-project/jerryscript/issues/1913 | 241,663,367 | 1,913 |
[
"jerryscript-project",
"jerryscript"
] | Hi,
I want to build Jerryscript for NuttX and NUCLEO-F411RE board.
I followed the instructions exactly in the https://github.com/jerryscript-project/jerryscript/tree/master/targets/nuttx-stm32f4 except for step 3.
When I followed ‘step 3. Configure NuttX’ in the document, I typed
`.configure.sh nucleo-f4x1re/f411-nsh`
instead of
`.configure.sh stm32f4discovery/usbnsh`
because I use NUCLEO-F411RE board.
I built Jerryscript and flashed successfully, and the nsh prompt appears on the terminal.
Then, I commanded “jerry” on the nsh shell, the shell prints
```
nsh> jerry
nsh: jerry: command not found
nsh> ?
help usage: help [-v] [<cmd>]
[ cmp free mh sh usleep
? dirname help mv sleep xd
basename dd hexdump mw test
break echo kill pwd time
cat exec ls rm true
cd exit mb rmdir uname
cp false mkdir set unset
Builtin Apps:
jerry
```
Why the jerry command is not working on the shell?
Thanks in advance.
| The problem of building Jerryscript for NuttX | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1905/comments | 5 | 2017-07-03T09:18:54Z | 2017-07-27T07:48:04Z | https://github.com/jerryscript-project/jerryscript/issues/1905 | 240,113,356 | 1,905 |
[
"jerryscript-project",
"jerryscript"
] | Currently nuttx-stm32f4 port uses only handler module from jerry-ext. (#1816)
tizenrt-artik05x port also want to use only handler.
However, it seems there is no cmake and build.py option.
I have no choice but including all jerry-ext modules, or not.
If so, I want to add build interfaces for both of cmake and build.py for selecting a set of modules from jerry-ext.
For build.py, what about using comma separated string? ( e.g., jerry-ext=arg,handler )
I don't want to introduce another parameter name. We may use same parameter name ( `jerry-ext`), and provides `arg,handler` as default value in order to respect history and other ports.
For cmake, I'd like to use jerryscript cmakefile convention for selecting a set of values. Could anyone give a suggestion? I can't find example in jerryscript cmakefiles. | Build options for selecting a set of modules from jerry-ext | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1903/comments | 8 | 2017-07-03T00:29:25Z | 2017-07-05T14:51:59Z | https://github.com/jerryscript-project/jerryscript/issues/1903 | 240,044,600 | 1,903 |
[
"jerryscript-project",
"jerryscript"
] | ```shell
Traceback (most recent call last):
File "tools/generate_pins.py", line 247, in <module>
main()
File "tools/generate_pins.py", line 237, in main
pins = enumerate_pins(pins_file, ['./tools'] + list(includes), defines)
File "tools/generate_pins.py", line 158, in enumerate_pins
return visitor.visit(parsed_ast)
File "tools/generate_pins.py", line 107, in visit
value = value or self.visit(child_node)
File "tools/generate_pins.py", line 107, in visit
value = value or self.visit(child_node)
File "tools/generate_pins.py", line 103, in visit
value = self.visit_typedecl(node)
File "tools/generate_pins.py", line 134, in visit_typedecl
pins[pin.name] = evaluator.eval(expr.strip())
File "/usr/local/lib/python2.7/site-packages/simpleeval.py", line 274, in eval
return self._eval(ast.parse(expr.strip()).body[0].value)
File "/usr/local/lib/python2.7/site-packages/simpleeval.py", line 285, in _eval
return handler(node)
File "/usr/local/lib/python2.7/site-packages/simpleeval.py", line 378, in _eval_name
raise NameNotDefined(node.id, self.expr)
simpleeval.NameNotDefined: 'LPC_GPIO0_BASE' is not defined for expression 'LPC_GPIO0_BASE'
```
The empty `cmsis.h` in `targets/mbedos5/tools` comments the defination for `LPC_GPIO0_BASE` out.
Tried to delete this empty `cmsis.h` and add `targets/mbedos5/mbed-os/cmsis` into the include directories in generate_pins.py, `LPC_GPIO0_BASE` can then be evaluated though but the way of defining `PinName` for NXP makes the script impossible to evaluate the enum constant in preprocess phase.
```cpp
typedef enum {
// LPC Pin Names
P0_0 = LPC_GPIO0_BASE,
P0_1, P0_2, P0_3, P0_4, P0_5, P0_6, P0_7, P0_8, P0_9, P0_10, P0_11, P0_12, P0_13, P0_14, P0_15, P0_16, P0_17, P0_18, P0_19, P0_20, P0_21, P0_22, P0_23, P0_24, P0_25, P0_26, P0_27, P0_28, P0_29, P0_30, P0_31,
P1_0, P1_1, P1_2, P1_3, P1_4, P1_5, P1_6, P1_7, P1_8, P1_9, P1_10, P1_11, P1_12, P1_13, P1_14, P1_15, P1_16, P1_17, P1_18, P1_19, P1_20, P1_21, P1_22, P1_23, P1_24, P1_25, P1_26, P1_27, P1_28, P1_29, P1_30, P1_31,
P2_0, P2_1, P2_2, P2_3, P2_4, P2_5, P2_6, P2_7, P2_8, P2_9, P2_10, P2_11, P2_12, P2_13, P2_14, P2_15, P2_16, P2_17, P2_18, P2_19, P2_20, P2_21, P2_22, P2_23, P2_24, P2_25, P2_26, P2_27, P2_28, P2_29, P2_30, P2_31,
P3_0, P3_1, P3_2, P3_3, P3_4, P3_5, P3_6, P3_7, P3_8, P3_9, P3_10, P3_11, P3_12, P3_13, P3_14, P3_15, P3_16, P3_17, P3_18, P3_19, P3_20, P3_21, P3_22, P3_23, P3_24, P3_25, P3_26, P3_27, P3_28, P3_29, P3_30, P3_31,
P4_0, P4_1, P4_2, P4_3, P4_4, P4_5, P4_6, P4_7, P4_8, P4_9, P4_10, P4_11, P4_12, P4_13, P4_14, P4_15, P4_16, P4_17, P4_18, P4_19, P4_20, P4_21, P4_22, P4_23, P4_24, P4_25, P4_26, P4_27, P4_28, P4_29, P4_30, P4_31,
// mbed DIP Pin Names
p5 = P0_9,
p6 = P0_8,
p7 = P0_7
...
}PinName;
```
I think a real but simple compilation is needed to properly generate the pins.
| mbedos5, generate_pins.py doesn't work for NXP targets | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1900/comments | 6 | 2017-06-30T13:03:57Z | 2018-11-20T13:53:20Z | https://github.com/jerryscript-project/jerryscript/issues/1900 | 239,772,985 | 1,900 |
[
"jerryscript-project",
"jerryscript"
] | https://github.com/jerryscript-project/jerryscript/blob/master/jerry-core/jrt/jrt.h#L28-L40 has some `__attribute__` statement which are outside of `#ifdef __GNU_C__`, so they may fail on compilers that don't support such hints. | __attribute__ statements made unconditionally | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1890/comments | 5 | 2017-06-14T13:01:32Z | 2019-01-11T13:50:56Z | https://github.com/jerryscript-project/jerryscript/issues/1890 | 235,871,295 | 1,890 |
[
"jerryscript-project",
"jerryscript"
] | We are now developing the app using jerryscript on mbed OS 5 with GCC ARM Embedded, but, we are suffering from the issue that **math.h in the compiler package** conflicts with **jerry-libm/include/math.h**.
Originally, when building the program on mbed OS 5, "**-mfpu=vfpv3**" and "**-mfloat-abi=hard**" are specified as compilation option and hardware support for floating point operation should be actually available on our platform. Thus, it seems that we can exclude **jerry-libm** from the build target.
Am I correct? Is there any impact if we exclude **jerry-libm**? If you could give your opinion, please let me know.
Thanks. | Conflict of math.h | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1888/comments | 3 | 2017-06-12T07:17:34Z | 2017-06-16T00:24:38Z | https://github.com/jerryscript-project/jerryscript/issues/1888 | 235,143,427 | 1,888 |
[
"jerryscript-project",
"jerryscript"
] | I'd like to be able to get code coverage data out of the JerryScript VM, for the .js that is being run.
We're using lcov+gcov to generate reports for the C code coverage of the unit tests of our JerryScript bindings.
Ideally, the JerryScript tooling would emit coverage data files that lcov can pick up and add those into one report together with the C code coverage data. I've no idea how feasible this is... :) I suspect that the debugger hooks are in part what we'd need to accomplish this. | Code coverage tooling | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1887/comments | 7 | 2017-06-09T12:38:58Z | 2017-08-02T07:55:28Z | https://github.com/jerryscript-project/jerryscript/issues/1887 | 234,814,277 | 1,887 |
[
"jerryscript-project",
"jerryscript"
] | The messages with `Error` objects that `arg.h` functions throw when the validation failed are very generic and can be made more helpful.
Improvement suggestions of things to include the error message:
- the index of the value that failed to be validated
- the (stringified) value that failed to be validated
- in case of a type error: the actual type of the value that failed the type check
Q:
- Easiest would be to use `sprintf()` => OK to refactor jerry-libc-printf.c to add this? OTOH, `sprintf()` would drag in quite a bit of code... Alternatively, we could use `strcat()` and probably get quite far.
- This would obviously increase the code size footprint a bit. Is it necessary to have a build-time config `#define` to enable/disable these richer messages? Is it OK to piggy-back on `JERRY_ENABLE_ERROR_MESSAGES`? | arg.h: improve error messages | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1886/comments | 2 | 2017-06-09T09:43:07Z | 2019-11-06T10:48:06Z | https://github.com/jerryscript-project/jerryscript/issues/1886 | 234,775,360 | 1,886 |
[
"jerryscript-project",
"jerryscript"
] | Hi,
I'm working on a project which need a Javascript engine as a replacement of configuration file.
Since the SRAM on my board is really limited, while there are still a some ROM, I am wondering if I could port only the vm part to my firmware and cut out the parser part. In this way, I could cut down the ROM space of parser part and save the SRAM that was used to save bytecode.
So, it's basically two questions:
1. Is it possible to port VM only?
2. Is it possible to store bytecode as a const?
| Is it possible to store the JS program in bytecode as a const in ROM? | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1884/comments | 6 | 2017-06-07T23:20:54Z | 2017-06-13T18:59:15Z | https://github.com/jerryscript-project/jerryscript/issues/1884 | 234,369,872 | 1,884 |
[
"jerryscript-project",
"jerryscript"
] | ###### Jerry version:
```
Checked revision: 905cd70
Build command: ./tools/build.py --clean --debug --compile-flag=-fsanitize=address --profile=es2015-subset --compile-flag=-m32 --compile-flag=-fno-omit-frame-pointer --compile-flag=-fno-common --compile-flag=-g --jerry-libc=off --static-link=off --strip=off --system-allocator=on --linker-flag=-fuse-ld=gold --error-messages=on
```
###### OS:
```
Ubuntu 16.04.2 LTS
```
###### Test case:
```javascript
new Promise(isFinite.toString).catch(Promise.prototype.then)
```
###### Backtrace:
```
ICE: Assertion 'ecma_get_value_type_field (value) == ECMA_TYPE_OBJECT' failed at jerryscript/jerry-core/ecma/base/ecma-helpers-value.c(ecma_get_object_from_value):586.
Error: ERR_FAILED_INTERNAL_ASSERTION
bt
#0 0xf7fd8be9 in __kernel_vsyscall ()
#1 0xf7898ea9 in raise () from /lib/i386-linux-gnu/libc.so.6
#2 0xf789a407 in abort () from /lib/i386-linux-gnu/libc.so.6
#3 0x08054cf9 in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-port/default/default-fatal.c:71
#4 0x0809c789 in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:58
#5 0x0809c7bc in jerry_assert_fail (assertion=0x815c9a0 "ecma_get_value_type_field (value) == ECMA_TYPE_OBJECT", file=0x815c5c0 "jerryscript/jerry-core/ecma/base/ecma-helpers-value.c", function=0x811d2a0 <__func__.3327.lto_priv.733> "ecma_get_object_from_value", line=586) at jerryscript/jerry-core/jrt/jrt-fatals.c:82
#6 0x081108ee in ecma_get_object_from_value (value=72) at jerryscript/jerry-core/ecma/base/ecma-helpers-value.c:586
#7 0x080b5448 in ecma_promise_then (promise=72, on_fulfilled=4132452435, on_rejected=72) at jerryscript/jerry-core/ecma/operations/ecma-promise-object.c:746
#8 0x080c9643 in ecma_builtin_promise_prototype_then (this_arg=72, on_fulfilled=4132452435, on_rejected=72) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-promise-prototype.c:51
#9 0x080c95a7 in ecma_builtin_promise_prototype_dispatch_routine (builtin_routine_id=58, this_arg_value=72, arguments_list=0xf6102074, arguments_number=1) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-promise-prototype.inc.h:31
#10 0x080ee76f in ecma_builtin_dispatch_routine (builtin_object_id=ECMA_BUILTIN_ID_PROMISE_PROTOTYPE, builtin_routine_id=58, this_arg_value=72, arguments_list=0xf6102074, arguments_number=1) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.inc.h:467
#11 0x080ee9c2 in ecma_builtin_dispatch_call (obj_p=0xf6503760, this_arg_value=72, arguments_list_p=0xf6102074, arguments_list_len=1) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.c:844
#12 0x080bc409 in ecma_op_function_call (func_obj_p=0xf6503760, this_arg_value=72, arguments_list_p=0xf6102074, arguments_list_len=1) at jerryscript/jerry-core/ecma/operations/ecma-function-object.c:458
#13 0x080b7a8e in ecma_process_promise_reaction_job.lto_priv.427 (obj_p=0xf6102070) at jerryscript/jerry-core/ecma/operations/ecma-jobqueue.c:170
#14 0x080ab957 in ecma_process_all_enqueued_jobs () at jerryscript/jerry-core/ecma/operations/ecma-jobqueue.c:339
#15 0x08116f6e in jerry_run_all_enqueued_jobs () at jerryscript/jerry-core/api/jerry.c:463
#16 0x08114007 in main (argc=3, argv=0xffffc3d4) at jerryscript/jerry-main/main-unix.c:778
```
<sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/)</sup>
| Assertion 'ecma_get_value_type_field (value) == ECMA_TYPE_OBJECT' failed in ecma_get_object_from_value | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1881/comments | 1 | 2017-06-06T12:10:54Z | 2019-01-02T10:00:31Z | https://github.com/jerryscript-project/jerryscript/issues/1881 | 233,871,117 | 1,881 |
[
"jerryscript-project",
"jerryscript"
] | ###### Jerry version:
```
Checked revision: a9e7dd7
Build command: ./tools/build.py --clean --debug
```
###### OS:
```
Ubuntu 16.04.2 LTS
```
###### Test case:
```javascript
if (function() {
while ({a: a,
get a() {}
})
continue;
})
var a;
```
###### Backtrace:
```
Script Error: SyntaxError
ICE: Assertion 'JERRY_CONTEXT (jmem_heap_allocated_size) == 0' failed at jerryscript/jerry-core/jmem/jmem-heap.c(jmem_heap_finalize):184.
Error: ERR_FAILED_INTERNAL_ASSERTION
bt
#0 0x000000000046ee82 in syscall_2 () at jerryscript/jerry-libc/target/posix/jerry-asm.S:59
#1 0x0000000000402760 in raise (sig=6) at jerryscript/jerry-libc/target/posix/jerry-libc-target.c:95
#2 0x0000000000402732 in abort () at jerryscript/jerry-libc/target/posix/jerry-libc-target.c:81
#3 0x0000000000403b8e in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-port/default/default-fatal.c:71
#4 0x000000000042c99d in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:58
#5 0x000000000042c9ed in jerry_assert_fail (assertion=0x476540 "JERRY_CONTEXT (jmem_heap_allocated_size) == 0", file=0x4764b0 "jerryscript/jerry-core/jmem/jmem-heap.c", function=0x485aa0 <__func__.3082.lto_priv.272> "jmem_heap_finalize", line=184) at jerryscript/jerry-core/jrt/jrt-fatals.c:82
#6 0x000000000042bd9c in jmem_heap_finalize () at jerryscript/jerry-core/jmem/jmem-heap.c:184
#7 0x000000000042c6a9 in jmem_finalize () at jerryscript/jerry-core/jmem/jmem-allocator.c:51
#8 0x000000000046a659 in jerry_cleanup () at jerryscript/jerry-core/api/jerry.c:195
#9 0x000000000046e34c in main (argc=3, argv=0x7fffffffd178) at jerryscript/jerry-main/main-unix.c:787
```
<sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [Grammarinator](https://github.com/renatahodovan/grammarinator)</sup>
| Assertion 'JERRY_CONTEXT (jmem_heap_allocated_size) == 0' failed in jmem_heap_finalize | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1873/comments | 3 | 2017-06-01T12:19:31Z | 2017-06-30T08:29:19Z | https://github.com/jerryscript-project/jerryscript/issues/1873 | 232,860,587 | 1,873 |
[
"jerryscript-project",
"jerryscript"
] | ###### Jerry version:
```
Checked revision: a9e7dd7
Build command: ./tools/build.py --clean --debug
```
###### OS:
```
Ubuntu 16.04.2 LTS
```
###### Test case:
```javascript
// in hex:
\xf0\x90\xae\xa9\xe0\xad\x9f
```
[Download test case](https://github.com/jerryscript-project/jerryscript/files/1044365/test.txt)
###### Backtrace:
```
ICE: Assertion '(c & LIT_UTF8_3_BYTE_MASK) == LIT_UTF8_3_BYTE_MARKER' failed at jerryscript/jerry-core/lit/lit-strings.c(lit_read_code_unit_from_utf8):425.
Error: ERR_FAILED_INTERNAL_ASSERTION
bt
#0 0xf7fd8be9 in __kernel_vsyscall ()
#1 0xf7898ea9 in raise () from /lib/i386-linux-gnu/libc.so.6
#2 0xf789a407 in abort () from /lib/i386-linux-gnu/libc.so.6
#3 0x08054cf9 in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-port/default/default-fatal.c:71
#4 0x0809c786 in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:58
#5 0x0809c7b9 in jerry_assert_fail (assertion=0x8144040 "(c & LIT_UTF8_3_BYTE_MASK) == LIT_UTF8_3_BYTE_MARKER", file=0x8143d00 "jerryscript/jerry-core/lit/lit-strings.c", function=0x812c300 <__func__.2027.lto_priv.350> "lit_read_code_unit_from_utf8", line=425) at jerryscript/jerry-core/jrt/jrt-fatals.c:82
#6 0x0809faed in lit_read_code_unit_from_utf8 (buf_p=0x8180b80 <buffer.lto_priv> "𐮩ୟ", code_point=0xffffbd40) at jerryscript/jerry-core/lit/lit-strings.c:425
#7 0x0809ffed in lit_utf8_peek_next (buf_p=0x8180b80 <buffer.lto_priv> "𐮩ୟ") at jerryscript/jerry-core/lit/lit-strings.c:500
#8 0x0809d8e0 in lit_char_is_identifier_start (src_p=0x8180b80 <buffer.lto_priv> "𐮩ୟ") at jerryscript/jerry-core/lit/lit-char-helpers.c:229
#9 0x0809a229 in lexer_next_token (context_p=0xffffbe60) at jerryscript/jerry-core/parser/js/js-lexer.c:988
#10 0x08091425 in parser_parse_source (source_p=0x8180b80 <buffer.lto_priv> "𐮩ୟ", size=7, strict_mode=0, error_location_p=0xffffc030) at jerryscript/jerry-core/parser/js/js-parser.c:2040
#11 0x0809374d in parser_parse_script (source_p=0x8180b80 <buffer.lto_priv> "𐮩ୟ", size=7, is_strict=false, bytecode_data_p=0xffffc0e0) at jerryscript/jerry-core/parser/js/js-parser.c:2496
#12 0x08116b8b in jerry_parse (source_p=0x8180b80 <buffer.lto_priv> "𐮩ୟ", source_size=7, is_strict=false) at jerryscript/jerry-core/api/jerry.c:326
#13 0x08116cd9 in jerry_parse_named_resource (name_p=0xffffc669 "/home/reni/data/.fuzzinator/jerry/test-3479-139991477544776.js", name_length=62, source_p=0x8180b80 <buffer.lto_priv> "𐮩ୟ", source_size=7, is_strict=false) at jerryscript/jerry-core/api/jerry.c:381
#14 0x08113c97 in main (argc=3, argv=0xffffc3a4) at jerryscript/jerry-main/main-unix.c:682
```
<sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [Grammarinator](https://github.com/renatahodovan/grammarinator)</sup>
| Assertion '(c & LIT_UTF8_3_BYTE_MASK) == LIT_UTF8_3_BYTE_MARKER' failed in lit_read_code_unit_from_utf8 | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1871/comments | 11 | 2017-06-01T10:10:37Z | 2017-07-06T06:10:53Z | https://github.com/jerryscript-project/jerryscript/issues/1871 | 232,829,949 | 1,871 |
[
"jerryscript-project",
"jerryscript"
] | Currently, JerryScript supports selected APIs in TypedArray. For example, [TypedArray.prototype.set(array, offset)`](https://www.ecma-international.org/ecma-262/6.0/index.html#sec-%typedarray%.prototype.set-array-offset) is not supported.
```
// h.js
var buffer = new ArrayBuffer(8);
var uint8 = new Uint8Array(buffer);
uint8.set([1,2,3], 3);
print(uint8); // console.log for node
```
```
$ node h.js
Uint8Array { '0': 0, '1': 0, '2': 0, '3': 1, '4': 2, '5': 3, '6': 0, '7': 0 }
$ jsc h.js
[object Uint8Array]
$ jerry h.js
Script Error: TypeError
```
Is there a plan to implement remaining APIs? | TypedArray.prototype.set(array, offset) | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1870/comments | 4 | 2017-06-01T07:55:50Z | 2017-08-18T08:09:09Z | https://github.com/jerryscript-project/jerryscript/issues/1870 | 232,794,689 | 1,870 |
[
"jerryscript-project",
"jerryscript"
] | Within the function skip_spaces, js-lexer.c:218 – a buffer over-read occurs when looking for the bytes 0xe2 0x80 0xa9, paragraph separator, by attempting a read ahead. There is an assert on line 217 that would prevent this in debug mode. Is the idea to let bugs into release builds? Or is there an over-sight I’m not seeing? | Heap Buffer Over-read in skip_space | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1867/comments | 2 | 2017-05-30T15:39:23Z | 2017-08-01T07:24:16Z | https://github.com/jerryscript-project/jerryscript/issues/1867 | 232,295,273 | 1,867 |
[
"jerryscript-project",
"jerryscript"
] | **Jerry version:**
```
Checked revision: 708b155
Build command: ./tools/build.py
```
**OS:**
```
Ubuntu 14.04.3 LTS (x86_64)
```
**Test:**
```
$ node
> (1.255).toFixed(2)
'1.25'
$ jsc
>>> (1.255).toFixed(2)
1.25
$ jerry
jerry> (1.255).toFixed(2)
1.26
```
Is it a bug that does not meet the [toFix ECMA Specification](https://www.ecma-international.org/ecma-262/6.0/index.html#sec-number.prototype.tofixed)? When I take a quick look in v8 code, dtoa works differently for `toFixed`, do we need to provide similar implementation for `toFixed`?
FYI, I got similar different behavior in `toPrecision`, too. | Different behavior from toFixed | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1864/comments | 2 | 2017-05-30T07:28:22Z | 2017-05-30T08:56:13Z | https://github.com/jerryscript-project/jerryscript/issues/1864 | 232,164,688 | 1,864 |
[
"jerryscript-project",
"jerryscript"
] | ###### Jerry version:
```
Checked revision: b51b682
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 --jerry-libc=off --static-link=off --strip=off --system-allocator=on --linker-flag=-fuse-ld=gold --error-messages=on
```
###### OS:
```
Ubuntu 16.04.2 LTS
```
###### Test case:
```javascript
{ ( $
&& $ != $ instanceof [ $ , /[\]\/ ]
? $ : $
```
###### Backtrace:
```
=================================================================
==9711==ERROR: AddressSanitizer: heap-buffer-overflow on address 0xf51009e5 at pc 0x080a056d bp 0xffe77c28 sp 0xffe77c18
READ of size 1 at 0xf51009e5 thread T0
#0 0x80a056c in lit_utf8_string_hash_combine jerryscript/jerry-core/lit/lit-strings.c:572
#1 0x80a056c in lit_utf8_string_calc_hash jerryscript/jerry-core/lit/lit-strings.c:590
#2 0x80fa3b2 in ecma_new_ecma_string_from_utf8_converted_to_cesu8 jerryscript/jerry-core/ecma/base/ecma-helpers-string.c:327
#3 0x8085c3f in lexer_construct_regexp_object jerryscript/jerry-core/parser/js/js-lexer.c:1833
#4 0x806200c in parser_parse_unary_expression.lto_priv.177 jerryscript/jerry-core/parser/js/js-parser-expr.c:647
#5 0x80522c3 in parser_parse_expression jerryscript/jerry-core/parser/js/js-parser-expr.c:1363
#6 0x80604cf in parser_parse_array_literal jerryscript/jerry-core/parser/js/js-parser-expr.c:237
#7 0x8061ff7 in parser_parse_unary_expression.lto_priv.177 jerryscript/jerry-core/parser/js/js-parser-expr.c:641
#8 0x80522c3 in parser_parse_expression jerryscript/jerry-core/parser/js/js-parser-expr.c:1363
#9 0x807908c in parser_parse_statements jerryscript/jerry-core/parser/js/js-parser-statm.c:1981
#10 0x8091426 in parser_parse_source jerryscript/jerry-core/parser/js/js-parser.c:2042
#11 0x809373b in parser_parse_script jerryscript/jerry-core/parser/js/js-parser.c:2496
#12 0x8116b76 in jerry_parse jerryscript/jerry-core/api/jerry.c:326
#13 0x8116cc4 in jerry_parse_named_resource jerryscript/jerry-core/api/jerry.c:381
#14 0x8113c82 in main jerryscript/jerry-main/main-unix.c:682
#15 0xf7017636 in __libc_start_main (/lib/i386-linux-gnu/libc.so.6+0x18636)
#16 0x8048e90 (jerryscript/build/bin/jerry+0x8048e90)
0xf51009e5 is located 0 bytes to the right of 21-byte region [0xf51009d0,0xf51009e5)
allocated by thread T0 here:
#0 0xf7268dee in malloc (/usr/lib32/libasan.so.2+0x96dee)
#1 0x80ab088 in jmem_heap_alloc_block_internal jerryscript/jerry-core/jmem/jmem-heap.c:326
#2 0x80ab140 in jmem_heap_gc_and_alloc_block.lto_priv.397 jerryscript/jerry-core/jmem/jmem-heap.c:362
#3 0x809bf1d in jmem_heap_alloc_block jerryscript/jerry-core/jmem/jmem-heap.c:408
#4 0x810d2f7 in ecma_alloc_string_buffer jerryscript/jerry-core/ecma/base/ecma-alloc.c:184
#5 0x80f9ea3 in ecma_new_ecma_string_from_utf8_converted_to_cesu8 jerryscript/jerry-core/ecma/base/ecma-helpers-string.c:278
#6 0x8085c3f in lexer_construct_regexp_object jerryscript/jerry-core/parser/js/js-lexer.c:1833
#7 0x806200c in parser_parse_unary_expression.lto_priv.177 jerryscript/jerry-core/parser/js/js-parser-expr.c:647
#8 0x80522c3 in parser_parse_expression jerryscript/jerry-core/parser/js/js-parser-expr.c:1363
#9 0x80604cf in parser_parse_array_literal jerryscript/jerry-core/parser/js/js-parser-expr.c:237
#10 0x8061ff7 in parser_parse_unary_expression.lto_priv.177 jerryscript/jerry-core/parser/js/js-parser-expr.c:641
#11 0x80522c3 in parser_parse_expression jerryscript/jerry-core/parser/js/js-parser-expr.c:1363
#12 0x807908c in parser_parse_statements jerryscript/jerry-core/parser/js/js-parser-statm.c:1981
#13 0x8091426 in parser_parse_source jerryscript/jerry-core/parser/js/js-parser.c:2042
#14 0x809373b in parser_parse_script jerryscript/jerry-core/parser/js/js-parser.c:2496
#15 0x8116b76 in jerry_parse jerryscript/jerry-core/api/jerry.c:326
#16 0x8116cc4 in jerry_parse_named_resource jerryscript/jerry-core/api/jerry.c:381
#17 0x8113c82 in main jerryscript/jerry-main/main-unix.c:682
#18 0xf7017636 in __libc_start_main (/lib/i386-linux-gnu/libc.so.6+0x18636)
SUMMARY: AddressSanitizer: heap-buffer-overflow jerryscript/jerry-core/lit/lit-strings.c:572 lit_utf8_string_hash_combine
Shadow bytes around the buggy address:
0x3ea200e0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x3ea200f0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x3ea20100: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x3ea20110: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x3ea20120: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
=>0x3ea20130: fa fa fa fa fa fa fa fa fa fa 00 00[05]fa fa fa
0x3ea20140: 00 00 00 fa fa fa 00 00 00 fa fa fa 00 00 00 fa
0x3ea20150: fa fa 00 00 00 fa fa fa 00 00 00 fa fa fa 00 00
0x3ea20160: 00 fa fa fa 00 00 00 fa fa fa 00 00 00 fa fa fa
0x3ea20170: 00 00 00 fa fa fa 00 00 00 00 fa fa 00 00 00 fa
0x3ea20180: 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
Heap right redzone: fb
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack partial redzone: f4
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
==9711==ABORTING
```
<sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [Grammarinator](https://github.com/renatahodovan/grammarinator)</sup>
| heap-buffer-overflow in lit_utf8_string_hash_combine | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1861/comments | 2 | 2017-05-28T23:39:02Z | 2017-07-12T07:46:59Z | https://github.com/jerryscript-project/jerryscript/issues/1861 | 231,902,804 | 1,861 |
[
"jerryscript-project",
"jerryscript"
] | The following test fails at `jerry_has_property ()`:
```c
#include "config.h"
#include "jerryscript.h"
#include "test-common.h"
int
main (void)
{
TEST_INIT ();
jerry_init (JERRY_INIT_EMPTY);
jerry_value_t object = jerry_create_object ();
jerry_value_t prop_name = jerry_create_string_from_utf8 ((jerry_char_t *) "something");
TEST_ASSERT (!jerry_has_property (object, prop_name));
TEST_ASSERT (!jerry_has_own_property (object, prop_name));
jerry_release_value (object);
jerry_release_value (prop_name);
jerry_cleanup ();
return 0;
} /* main */
```
Why would any prototype in `object`'s prototype chain have the property `"something"`?
Either way, I think it'd be good to cover those two APIs with a test. | jerry_has_property () returns true even on a newly created object | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1859/comments | 2 | 2017-05-27T08:44:01Z | 2017-05-29T13:54:33Z | https://github.com/jerryscript-project/jerryscript/issues/1859 | 231,787,079 | 1,859 |
[
"jerryscript-project",
"jerryscript"
] | Right now we have our own print implementation (#1853). Needs to be replaced by the one from jerry-ext. | target: mbedos5: Move print to jerryx_handler_print | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1857/comments | 1 | 2017-05-26T09:23:49Z | 2017-06-17T10:24:40Z | https://github.com/jerryscript-project/jerryscript/issues/1857 | 231,572,118 | 1,857 |
[
"jerryscript-project",
"jerryscript"
] | Jerry version:
```
Checked revision: e84109f
Build command: ./tools/build.py --clean
```
OS:
```
Ubuntu 14.04.3 LTS
```
Test case:
```
1 / (0 * (-1))
```
Result:
```
$ node
> 1 / (0 * (-1))
-Infinity
$ jsc
>>> 1 / (0 * (-1))
-Infinity
$ jerry
jerry> 1 / (0 * (-1))
Infinity
``` | Divide by negative zero does not keep sign. | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1855/comments | 1 | 2017-05-26T07:52:32Z | 2017-06-01T07:57:09Z | https://github.com/jerryscript-project/jerryscript/issues/1855 | 231,552,226 | 1,855 |
[
"jerryscript-project",
"jerryscript"
] | When building the `jerry-all-in.c` and then compiling it using the ESP32 toolchain, the linker gives the following error:
```text
/opt/Espressif/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/5.2.0/../../../../xtensa-esp32-elf/bin/ld: /home/simon/Projects/esp32/build/nibbl.elf section `.dram0.bss' will not fit in region `dram0_0_seg'
/opt/Espressif/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/5.2.0/../../../../xtensa-esp32-elf/bin/ld: region `dram0_0_seg' overflowed by 231096 bytes
collect2: error: ld returned 1 exit status
/opt/Espressif/esp-idf/make/project.mk:322: recipe for target '/home/simon/Projects/esp32/build/nibbl.elf' failed
```
Below are the build settings (these are based on the [esp8266 target](https://github.com/LaszloLango/jerryscript/blob/esp-revival/targets/esp8266/Makefile.esp8266#L66) for JerryScript):
```sh
tools/build.py --all-in-one=ON \
--jerry-port-default=ON \
--mem-stats=OFF \
--mem-heap=20 \
--jerry-libc=OFF \
--jerry-libm=ON \
--jerry-cmdline=OFF \
--lto=OFF
```
Any ideas? | Overflow issue when linking all-in-one on ESP32 | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1854/comments | 6 | 2017-05-25T19:02:45Z | 2017-05-26T23:51:30Z | https://github.com/jerryscript-project/jerryscript/issues/1854 | 231,428,903 | 1,854 |
[
"jerryscript-project",
"jerryscript"
] | There was a commit on December 13 (#1468) - authored by @janjongboom. It has deleted the main.cpp from the targets/mbedos5/source library by saying that
> main.cpp is auto-generated and should not be included in this repository
But now, if you want to build the mbedos5, there is not an auto-generated main.cpp, but there is an error message:
```[ERROR] ./BUILD/DISCO_F407VG/GCC_ARM/mbed-os/platform/retarget.o: In function `__wrap_main':
retarget.cpp:(.text.__wrap_main+0xa): undefined reference to `main'
collect2: error: ld returned 1 exit status```
| mbedos5 target build error | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1852/comments | 2 | 2017-05-25T10:23:35Z | 2017-05-25T11:55:15Z | https://github.com/jerryscript-project/jerryscript/issues/1852 | 231,300,585 | 1,852 |
[
"jerryscript-project",
"jerryscript"
] | Our current design, where a context handler is given during `jerry_init_with_user_context ()` via an init/deinit pair of function pointers and the pointer is later retrieved via `jerry_get_user_context ()` is unsafe, because for two different contexts you can have two different pairs A and B of function pointers passed to `jerry_init_with_user_context ()` but there is nothing to prevent a call to `jerry_get_user_context ()` from the wrong environment - that is, from an environment where the returned pointer is assumed to be a pointer to a structure B when in fact the context was initialized with the init/deinit pair for A.
The answer is to store the init/deinit pair in a global static structure, a pointer to which can serve as a runtime type id for the `void *` stored on the context. Then, if two different pointers are identified by two different such type IDs, requesting one of the pointers by type ID will return the correct one. | Context data retrieval is unsafe | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1845/comments | 4 | 2017-05-22T13:15:47Z | 2017-05-24T12:10:22Z | https://github.com/jerryscript-project/jerryscript/issues/1845 | 230,392,178 | 1,845 |
[
"jerryscript-project",
"jerryscript"
] | Zephyr.js has a nice macro to declare `const jerry_value_t`s. It leverages the `__attribute__ ((__cleanup__(...)))` feature to automatically call `jerry_release_value()` on the value when the variable goes out of scope:
https://github.com/01org/zephyr.js/blob/ecf2fba29de4dafbd1c8e5b6b3ece636ac237213/src/zjs_util.h#L185
Example use:
```
... {
ZVAL global = jerry_get_global_object();
...
// no need to call jerry_release_value(global);
// it will be released automatically by the cleanup function.
}
```
The advantages are quite obvious I think. The disadvantage is that it needs to be supported by the compiler. FWIW, GCC and clang support it.
Does it make sense to add a similar utility to `jerry-ext`? | Macros to automatically call `jerry_release_value`? | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1836/comments | 2 | 2017-05-19T08:06:14Z | 2017-06-17T10:25:47Z | https://github.com/jerryscript-project/jerryscript/issues/1836 | 229,900,472 | 1,836 |
[
"jerryscript-project",
"jerryscript"
] | As per Gilles'/@barbibulle 's request on the mailing list:
>> Do you have any expectations of the interface? Which abilities are urgent in your application? Those feedbacks will help us design the API.
>
> what I'd expect from the public interface is to be able to:
> 1/ get to the underlying memory buffer of an ArrayBuffer and TypedArray, using something equivalent to what's in ecma-arraybuffer-object.h and:
> * ecma_arraybuffer_get_buffer (ecma_object_t *obj_p);
> * ecma_arraybuffer_get_length (ecma_object_t *obj_p);
> * ecma_typedarray_get_buffer (ecma_object_t *typedarray_p);
> * ecma_typedarray_get_length (ecma_object_t *typedarray_p);
> * ecma_typedarray_get_element_size_shift (ecma_object_t *typedarray_p);
>
> 2/ Ability to query whether a jerry_value_t is an instance of ArrayBuffer or is a TypedArray. Something equivalent to:
> * ecma_is_arraybuffer (ecma_value_t val);
> * ecma_is_typedarray (ecma_value_t target);
>
> 3/ Maybe also a convenience function for creating an ArrayBuffer with a single call (probably not necessary for TypedArrays). Something equivalent to:
> * ecma_arraybuffer_new_object (ecma_length_t lengh);
>
> 4/ It would be nice to also have DataView implemented, since Uint32Array is always with the > platform's endianness, it makes it hard to parse external data structures that are big endian when running on little-endian platforms.
>
> When interfacing with native APIs, including filesystems, network interfaces, etc, ArrayBuffers are very convenient, and the ability to easily exchange buffers with JS code is extremely useful.
| C API for ArrayBuffer/TypedArray | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1832/comments | 15 | 2017-05-18T08:24:00Z | 2018-05-24T10:05:04Z | https://github.com/jerryscript-project/jerryscript/issues/1832 | 229,591,352 | 1,832 |
[
"jerryscript-project",
"jerryscript"
] | ###### Jerry version:
```
Checked revision: 31cd3b8
Build command: ./tools/build.py --clean --debug --error-messages=on
```
###### OS:
```
Ubuntu 16.04.2 LTS
```
###### Test case:
```javascript
//ஃ︠﹍
```
The [test](https://github.com/jerryscript-project/jerryscript/files/1008577/test.txt) file is attached (saved as txt to be accepted by GH).
###### Backtrace:
```
ICE: Assertion 'lit_is_valid_cesu8_string (string_p, string_size)' failed at jerryscript/jerry-core/ecma/base/ecma-helpers-string.c(ecma_new_ecma_string_from_utf8):154.
Error: ERR_FAILED_INTERNAL_ASSERTION
bt
#0 0xf7fd8be9 in __kernel_vsyscall ()
#1 0xf7898ea9 in raise () from /lib/i386-linux-gnu/libc.so.6
#2 0xf789a407 in abort () from /lib/i386-linux-gnu/libc.so.6
#3 0x08055111 in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-port/default/default-fatal.c:71
#4 0x0809cbab in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:58
#5 0x0809cbde in jerry_assert_fail (assertion=0x8157a40 "lit_is_valid_cesu8_string (string_p, string_size)", file=0x81578c0 "jerryscript/jerry-core/ecma/base/ecma-helpers-string.c", function=0x811dfe0 <__func__.3102.lto_priv.698> "ecma_new_ecma_string_from_utf8", line=154) at jerryscript/jerry-core/jrt/jrt-fatals.c:82
#6 0x080f977a in ecma_new_ecma_string_from_utf8 (string_p=0x8180ba1 <buffer.lto_priv+1> "\341\212\261\360\236\273\262/ஃ︠﹍", string_size=7) at jerryscript/jerry-core/ecma/base/ecma-helpers-string.c:154
#7 0x08086074 in lexer_construct_regexp_object (context_p=0xffffbe90, parse_only=false) at jerryscript/jerry-core/parser/js/js-lexer.c:1819
#8 0x08062417 in parser_parse_unary_expression.lto_priv.192 (context_p=0xffffbe90, grouping_level_p=0xffffbbf0) at jerryscript/jerry-core/parser/js/js-parser-expr.c:647
#9 0x080522c4 in parser_parse_expression (context_p=0xffffbe90, options=2) at jerryscript/jerry-core/parser/js/js-parser-expr.c:1363
#10 0x08079499 in parser_parse_statements (context_p=0xffffbe90) at jerryscript/jerry-core/parser/js/js-parser-statm.c:1981
#11 0x0809185d in parser_parse_source (source_p=0x8180ba0 <buffer.lto_priv> "/\341\212\261\360\236\273\262/ஃ︠﹍", size=21, strict_mode=0, error_location_p=0xffffc060) at jerryscript/jerry-core/parser/js/js-parser.c:2042
#12 0x08093b72 in parser_parse_script (source_p=0x8180ba0 <buffer.lto_priv> "/\341\212\261\360\236\273\262/ஃ︠﹍", size=21, is_strict=false, bytecode_data_p=0xffffc110) at jerryscript/jerry-core/parser/js/js-parser.c:2496
#13 0x08112233 in jerry_parse (source_p=0x8180ba0 <buffer.lto_priv> "/\341\212\261\360\236\273\262/ஃ︠﹍", source_size=21, is_strict=false) at jerryscript/jerry-core/api/jerry.c:312
#14 0x08112381 in jerry_parse_named_resource (name_p=0xffffc68a "/home/reni/data/.fuzzinator/jerry/test-17407-140390459994520.js", name_length=63, source_p=0x8180ba0 <buffer.lto_priv> "/\341\212\261\360\236\273\262/ஃ︠﹍", source_size=21, is_strict=false) at jerryscript/jerry-core/api/jerry.c:367
#15 0x08119373 in main (argc=3, argv=0xffffc3d4) at jerryscript/jerry-main/main-unix.c:664
```
<sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [Grammarinator](https://github.com/renatahodovan/grammarinator)</sup>
| Assertion 'lit_is_valid_cesu8_string (string_p, string_size)' failed in ecma_new_ecma_string_from_utf8 | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1831/comments | 0 | 2017-05-17T17:28:56Z | 2017-05-23T10:04:11Z | https://github.com/jerryscript-project/jerryscript/issues/1831 | 229,431,875 | 1,831 |
[
"jerryscript-project",
"jerryscript"
] | ###### Jerry version:
```
Checked revision: 31cd3b8
Build command: ./tools/build.py --clean --debug --error-messages=on
```
###### OS:
```
Ubuntu 16.04.2 LTS
```
###### Test case:
```javascript
/[\]ౘ/
```
The [test](https://github.com/jerryscript-project/jerryscript/files/1008565/test.txt) file is attached (saved as txt to be accepted by GH).
###### Backtrace:
```
ICE: Assertion '(c & LIT_UTF8_3_BYTE_MASK) == LIT_UTF8_3_BYTE_MARKER' failed at jerryscript/jerry-core/lit/lit-strings.c(lit_read_code_unit_from_utf8):425.
Error: ERR_FAILED_INTERNAL_ASSERTION
bt
#0 0xf7fd8be9 in __kernel_vsyscall ()
#1 0xf7898ea9 in raise () from /lib/i386-linux-gnu/libc.so.6
#2 0xf789a407 in abort () from /lib/i386-linux-gnu/libc.so.6
#3 0x08055111 in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-port/default/default-fatal.c:71
#4 0x0809cbab in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:58
#5 0x0809cbde in jerry_assert_fail (assertion=0x8143d80 "(c & LIT_UTF8_3_BYTE_MASK) == LIT_UTF8_3_BYTE_MARKER", file=0x8143a40 "jerryscript/jerry-core/lit/lit-strings.c", function=0x812c000 <__func__.2029.lto_priv.360> "lit_read_code_unit_from_utf8", line=425) at jerryscript/jerry-core/jrt/jrt-fatals.c:82
#6 0x0809fed1 in lit_read_code_unit_from_utf8 (buf_p=0xf65009db "\247\277]ౘ", code_point=0xffffb6d0) at jerryscript/jerry-core/lit/lit-strings.c:425
#7 0x080a0121 in lit_utf8_read_next (buf_p=0xffffb974) at jerryscript/jerry-core/lit/lit-strings.c:467
#8 0x0807e0d5 in re_parse_char_class (parser_ctx_p=0xffffb970, append_char_class=0x807a4dd <re_append_char_class>, re_ctx_p=0xffffb9f0, out_token_p=0xffffba04) at jerryscript/jerry-core/parser/regexp/re-parser.c:334
#9 0x0807bb6d in re_parse_alternative (re_ctx_p=0xffffb9f0, expect_eof=true) at jerryscript/jerry-core/parser/regexp/re-compiler.c:390
#10 0x0807c37b in re_compile_bytecode (out_bytecode_p=0xffffbae0, pattern_str_p=0xf65009d0, flags=0) at jerryscript/jerry-core/parser/regexp/re-compiler.c:560
#11 0x08086093 in lexer_construct_regexp_object (context_p=0xffffbe90, parse_only=false) at jerryscript/jerry-core/parser/js/js-lexer.c:1820
#12 0x08062417 in parser_parse_unary_expression.lto_priv.192 (context_p=0xffffbe90, grouping_level_p=0xffffbbf0) at jerryscript/jerry-core/parser/js/js-parser-expr.c:647
#13 0x080522c4 in parser_parse_expression (context_p=0xffffbe90, options=2) at jerryscript/jerry-core/parser/js/js-parser-expr.c:1363
#14 0x08079499 in parser_parse_statements (context_p=0xffffbe90) at jerryscript/jerry-core/parser/js/js-parser-statm.c:1981
#15 0x0809185d in parser_parse_source (source_p=0x8180ba0 <buffer.lto_priv> "delete/[\\\352\247\277]ౘ/", size=17, strict_mode=0, error_location_p=0xffffc060) at jerryscript/jerry-core/parser/js/js-parser.c:2042
#16 0x08093b72 in parser_parse_script (source_p=0x8180ba0 <buffer.lto_priv> "delete/[\\\352\247\277]ౘ/", size=17, is_strict=false, bytecode_data_p=0xffffc110) at jerryscript/jerry-core/parser/js/js-parser.c:2496
#17 0x08112233 in jerry_parse (source_p=0x8180ba0 <buffer.lto_priv> "delete/[\\\352\247\277]ౘ/", source_size=17, is_strict=false) at jerryscript/jerry-core/api/jerry.c:312
#18 0x08112381 in jerry_parse_named_resource (name_p=0xffffc68a "/home/reni/data/.fuzzinator/jerry/test-17407-140390428900712.js", name_length=63, source_p=0x8180ba0 <buffer.lto_priv> "delete/[\\\352\247\277]ౘ/", source_size=17, is_strict=false) at jerryscript/jerry-core/api/jerry.c:367
#19 0x08119373 in main (argc=3, argv=0xffffc3d4) at jerryscript/jerry-main/main-unix.c:664
```
<sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [Grammarinator](https://github.com/renatahodovan/grammarinator)</sup>
| Assertion '(c & LIT_UTF8_3_BYTE_MASK) == LIT_UTF8_3_BYTE_MARKER' failed in lit_read_code_unit_from_utf8 | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1830/comments | 1 | 2017-05-17T17:24:09Z | 2019-01-02T10:00:31Z | https://github.com/jerryscript-project/jerryscript/issues/1830 | 229,430,666 | 1,830 |
[
"jerryscript-project",
"jerryscript"
] | ###### Jerry version:
```
Checked revision: 31cd3b8
Build command: ./tools/build.py --clean --debug --error-messages=on
```
###### OS:
```
Ubuntu 16.04.2 LTS
```
###### Test case:
```javascript
for ({get 10() {} };;)
break;
```
###### Description:
The test case above triggers a SyntaxError exception with the following message:
```js
for ({get 10() {} };;)
~~~~~~~~~~^
Script Error: SyntaxError: Expected argument list. [line: 1, column: 11]
```
Numerical getters/setters are allowed by the standard and JerryScript supports them too. It seems that the above glitch only happens if these getter/setters are placed in loops.
<sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [Grammarinator](https://github.com/renatahodovan/grammarinator)</sup>
| Unexpected SyntaxError by numerical getter/setters in loops | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1829/comments | 0 | 2017-05-17T11:37:30Z | 2017-05-19T12:49:38Z | https://github.com/jerryscript-project/jerryscript/issues/1829 | 229,323,044 | 1,829 |
[
"jerryscript-project",
"jerryscript"
] | ## Problem
Currently tizenrt-artik05x does not support `longjmp/setjmp` correctly.
I tried to use `longjmp/setjmp` implementation from nuttx-stm32f4 port.
But it shows following error:
```
System Information:
Verarm_undefinedinsn:
Undefined instruction at 0x4130b58
up_assert: Assertion failed at file:armv7-r/arm_undefinedinsn.c line: 107 task: appmain
```
## Looking for Solution
Since artik05x is cortex-r4, not cortex-m4, I looked for `vstm` and `vldm` in [Cortex R4 Technical Manual](http://infocenter.arm.com/help/topic/com.arm.doc.ddi0363e/DDI0363E_cortexr4_r1p3_trm.pdf). And I found `vldm` in this manual, however, there is no `vstm`. So I removed `vstm` from nuttx-stm32f4 `longjmp/setjmp` and it escapes me from above error. ( `vldm` does _not_ cause the undefined instruction error. ) So I will expand the `vstm` instruction on tizenrt-artik05x and run some tests in order to make sure it is correct.
| Add `setjmp` and `longjmp` functions for tizenrt-artik05x target | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1823/comments | 3 | 2017-05-15T06:41:33Z | 2017-05-17T05:48:36Z | https://github.com/jerryscript-project/jerryscript/issues/1823 | 228,619,102 | 1,823 |
[
"jerryscript-project",
"jerryscript"
] | I've discovered a NULL pointer de-reference condition within Jerryscript.
If the bytes - "0x27 0x5c 0xe2 0x80 0xa8 0x27 0x41" are evaluated by jerry_eval a segmentation fault will occur resulting in a denial of service.
It occurs within jmem_heap_free_block when block_p->size is de-referenced.
**Proof**
![image](https://cloud.githubusercontent.com/assets/25182776/26021655/38ac0afc-378a-11e7-865e-f74c0c951822.png)
The call tree is as follows (generally):
1. jerry_eval
2. ecma_op_eval_chars_buffer
3. parser_parse_script
4. parser_parse_source
5. lexer_next_token (parses the source for strings and returns)
6. parser_parse_statements (throws a parsing error via parser_raise_error and returns to the parser_parse_source PARSER_CATCH statement)
7. parser_free_literals
8. util_free_literal
9. jmem_heap_free_block (SEGMENTATION FAULT) | Denial of Service: Null Pointer De-reference | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1821/comments | 1 | 2017-05-13T02:26:02Z | 2017-05-22T11:17:08Z | https://github.com/jerryscript-project/jerryscript/issues/1821 | 228,443,030 | 1,821 |
[
"jerryscript-project",
"jerryscript"
] | It's been an issue several times that users of JerryScript don't have access to dynamic memory management (in the general case). jerry-libc doesn't provide malloc/free, partially because jerry-core doesn't necessarily need them. But that has some adverse effects on use cases:
- jerry-main cannot use dynamic memory for file input reading, or for command line argument handling,
- the default jobqueue port implementation has to access internal jmem functions to allocate memory for job queue items (in its current form -- until #1804 gets merged, if ever), and
- the recent context extension #1802 also needs some dynamic memory to work.
Wouldn't a pair of public API functions (`void *jerry_alloc ()` / `void jerry_free (void *)`) solve these issues? It is of course a somewhat risky thing to allow, because that may easily eat away the jerry heap. But is allowing access to jmem internals any better? | Expose dynamic memory management via public API | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1805/comments | 10 | 2017-05-08T12:15:51Z | 2018-09-04T14:31:26Z | https://github.com/jerryscript-project/jerryscript/issues/1805 | 227,027,293 | 1,805 |
[
"jerryscript-project",
"jerryscript"
] | TL;DR: Is there any other way to implement a Promise job queue than what's implemented in the default port? If not, should it not be merged into jerry-core?
Source of my confusion:
- If Promises are available/enabled then those JS functions that are in `then`s or `catch`es are to be executed after the main script completed. Until they get their turn, they are enqueued by `jerry_port_jobqueue_enqueue`.
- Enqueued jobs _must_ be executed, otherwise they keep references to their environment and memory will not be freed. (Just try to comment out `jerry_port_default_jobqueue_run` in main-unix.c, the debug-built jerry tool will assert out at cleanup when running a script with Promises, because heap does not get emptied.)
- However, there is no general API to execute the enqueued jobs. The default port provides `jerry_port_default_jobqueue_run`, but it is specific to that port.
- What's more, the default port implementation uses the engine's internal memory handling routines (`jmem_heap_alloc_block`, `jmem_heap_free_block`), which is quite a no-no IMHO.
I've taken a quick look at another VM (JavaScriptCore) and command line tool (jsc), how it handles Promises and enqueued jobs. Without digging too deep, it seems to me that there the VM has an API call to execute such jobs (called microtasks, if I'm not mistaken).
(`vm.drainMicrotasks();` at https://trac.webkit.org/browser/webkit/trunk/Source/JavaScriptCore/jsc.cpp#L3522)
Wouldn't it be better for us, too, to integrate Promise job handling into the engine. E.g., something like
- `jerry_run_enqueued` to run one enqueued job,
- `jerry_run_all_enqueued` to run until the queue gets empty (replacement for `jerry_port_default_jobqueue_run` and analogous to JSC's `vm.drainMicrotasks`, I think).
Advantages:
- the whole API needed to run a Promise-enabled engine is port-independent (in addition to the above discussed, `jerry_init` can do the queue initialization instead of `jerry_port_default_jobqueue_init`),
- no API layering violation,
- less burden on port implementers.
However, I'm not sure whether there are any use cases for which this approach would be inappropriate.
Feedbacks are welcome. | Is the JobQueue Port API a good abstraction? | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1799/comments | 9 | 2017-05-04T20:43:33Z | 2017-05-31T16:57:50Z | https://github.com/jerryscript-project/jerryscript/issues/1799 | 226,402,902 | 1,799 |
[
"jerryscript-project",
"jerryscript"
] | Recent changes in the API revealed that we have no strict policy for removing API or introducing experimental API. It would be good to have some policy rules for that. My suggestions:
Deprecating an API: we already have a JERRY_DEPRECATED_API define and we should add this to deprecated functions. After the label is added the function will be removed 4 months later.
Experimental API: we should add a prefix to these functions (e.g. jerry_new_, jerry_exp_) and these functions can be changed without further notice. Use them at your own risk. For example I would add this prefix to all debugger functions now, and could be used for providing an API for snapshot merging. | JerryScript API maintenance (removal, experimental) | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1798/comments | 11 | 2017-05-04T09:27:11Z | 2019-10-25T19:03:08Z | https://github.com/jerryscript-project/jerryscript/issues/1798 | 226,223,212 | 1,798 |
[
"jerryscript-project",
"jerryscript"
] | # Problem / Motivation
I've looked around the jerry-core library a bit to see what we expose of ourselves. I was especially interested in the global symbols available from the static `libjerry-core.a` archive. We have two types of global symbols, at least conceptually: there are those which are part of the public API (e.g., `jerry_release_value` -- let's call these "public globals"), and there are those which should probably not be available to the outside world but cannot be source-local `static`s because of modularization (e.g., `vm_run` or `ecma_op_to_string` -- let's call these "internal globals"). We have had problems with "internal globals" before: internal memory management routines used to have a `mem_` prefix but that conflicted with other projects that wanted to embed the library. We ended up renaming the memory management module to `jmem` and re-prefixing all routines with `jmem_`. However, I don't think that the threat of conflicting symbols has been completely lifted.
In the most basic build variant, on OSX, I get the following results when looking for global symbols that _don't_ have the `jerry_` prefix:
```bash
$ ./tools/build.py --clean
$ nm ./build/lib/libjerry-core.a -g | grep -v ' U ' | grep -v 'jerry_' | wc -l
611
```
This means that there are 600+ global symbols that are only for the internal working of jerry-core but may potentially conflict with code we have no influence on. What's more frightening (to me, at least) is that these "internal globals" follow quite diverse naming schemes:
```bash
$ nm ./build/lib/libjerry-core.a -g | grep -v ' U ' | grep -v 'jerry_' | cut -d ' ' -f 2,3 | cut -d '_' -f 1,2 | sort | uniq -c
1
1 ./build/lib/libjerry-core.a(jerry-all-in.c.o):
2 S _cbc
35 S _ecma
2 T _do
399 T _ecma
16 T _jmem
10 T _lexer
56 T _lit
15 T _opfunc
44 T _parser
19 T _re
1 T _util
10 T _vm
```
I think it's quite hard to prepare our users: it's very hard to tell them what identifiers they _must_ avoid if they don't want to run into cryptic linker/runtime(?) issues. (E.g., a `do_`, `util_`, or `re_` prefix is not unimaginable to be used elsewhere.)
_Note_: I'm not concerned about "claiming" the `jerry_` prefix. That should not conflict. If someone chooses this project, s/he should live with the fact that this prefix is reserved for the JS engine.
# Suggestion / Options
**Option 1**: The easy route
Let's rename at least those "internal globals" which do not follow the "prefix with the module name" naming scheme: `do_`, `cbc_`, `util_`. These are the most problematic, I think.
Note: `lexer_`, `parser_`, and `opfunc_` are actually also in violation of that naming scheme, but it's not cast to stone after all. My very subjective judgement does not consider them as harmful as the other three prefixes.
**Option 2**: The middle course
Let's add a newly chosen prefix to _all_ "internal globals". E.g., `jrs_`, `jry_`, `j_`, `j3y_`, `j9t_`, etc. The key is to have a _single_ prefix we can communicate to our users not to use (in addition to `jerry_`).
Note: I haven't listed `jerry_` as a potential prefix for "internal globals". Right now, it's just my instincts that tell me to have different prefixes for public and internal globals.
**Option 3**: The hard path
Let's add a macro that must be used at the definition and at the references of such global symbols, which adds a custom prefix to the symbols. For the biggest flexibility, this macro can have a sensible default for the prefix (see Option 2) but can also allow a config-time override.
```c
#ifndef CONFIG_SYMBOL_PREFIX
#define CONFIG_SYMBOL_PREFIX jrs_
#endif
#define J(SYMBOL) CONFIG_SYMBOL_PREFIX ## SYMBOL
ecma_property_pair_t *
J (ecma_alloc_property_pair) (void)
{
return J (mem_heap_alloc_block) (sizeof (ecma_property_pair_t));
}
```
Note 1: The example is a trimmed down variant of real code.
Note 2: This option could hopefully also include the reverting of the `mem`-to-`jmem` change, because that single `j` is highly arbitrary IMHO. The example already shows a symbol in reverted form.
Note 3: AFAIK, Valgrind uses a solution something like this.
**Option 4**: Do nothing
We can conclude this, too.
# Analysis
- Option 1:
- Pro: Can be applied practically at no cost, it's just the renaming of 5 identifiers in the simplest case.
- Con: Just scratches the surface. In fact, the issue is not solved.
- Option 2:
- Pro: Issue solved (mostly). Provided that we choose a non-uncommon prefix, we will most probably not conflict with any user.
- Con: This means a HUGE rewrite of the code base. These functions are everywhere. 600+ definitions and I-cannot-guess-how-many references.
- Option 3:
- Pro: Issue solved (completely). A user will be able to reconfigure the prefix if that sub-1% chance hits that the default prefix conflicts with its code base.
- Con: as for Option 3 + with our current coding style ("space before open parenthesis") the rewritten code will look weird (i.e., we cannot even write `J(xxx)`, we have to add that space `J (xxx)`)
Note 1: Should we conclude for any of the above, it will be possible to enforce the naming scheme with checks using similar techniques as shown in Motivation.
Note 2: This should not be a breaking change. Noone should try to access these symbols from outside the library (except for unit tests).
_Any feedback would be greatly appreciated!_
| Prefixing "internal global" symbols of jerry-core | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1795/comments | 17 | 2017-04-28T18:53:02Z | 2019-10-28T15:21:19Z | https://github.com/jerryscript-project/jerryscript/issues/1795 | 225,163,818 | 1,795 |
[
"jerryscript-project",
"jerryscript"
] | Now we've got ES6 `Promise` support from within .js, I think it's a good time to add the C API as well :) | Add C API for Promise | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1794/comments | 15 | 2017-04-28T14:15:37Z | 2019-01-02T10:00:31Z | https://github.com/jerryscript-project/jerryscript/issues/1794 | 225,094,061 | 1,794 |
[
"jerryscript-project",
"jerryscript"
] | It was a shock for me to realize that the public API is available everywhere in the project because it is inluded in jrt.h. JerryScript has an opposite design: we have public/internal aliases for many types. E.g. jerry_value_t (public) is the same as ecma_value_t (private), jerry_length_t (public) = ecma_length_t (private), etc.
However, I realized that now certain types are crawling into the internal side from the public side. This dependency should be dropped. I am willing to work on this. | Removing jerryscript.h include from jrt.h | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1791/comments | 2 | 2017-04-28T07:55:35Z | 2017-05-11T10:42:51Z | https://github.com/jerryscript-project/jerryscript/issues/1791 | 225,006,356 | 1,791 |
[
"jerryscript-project",
"jerryscript"
] | Currently each snapshot has its own string table, and in projects like IoT.js many files have references to the same strings (usually function names). These strings are duplicated for each snapshot file, and the binary size could be reduced by sharing the string table. A multi entry point snapshot file could be a solution for this problem. We need a utility for merging snapshots, and relative offsets would allow merging many files without reaching the maximum snapshot size. | Merging snapshots to save space | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1779/comments | 5 | 2017-04-24T14:03:08Z | 2017-10-12T13:22:19Z | https://github.com/jerryscript-project/jerryscript/issues/1779 | 223,830,797 | 1,779 |
[
"jerryscript-project",
"jerryscript"
] | # Motivation
Currently, "ports" of JerryScript are a strange concept. The build system is
prepared in some way to include platform-specific code into `jerry-core` (via
the `PORT_DIR` cmake option). However, except for `jerry-main`, which is a
unix/posix-specific app and thus uses the unix/posix-specific code in
`targets/default`, no known application uses that feature. Actually, almost(?)
all applications in `targets` mix two concepts: they usually contain a demo
application _and_ a jerry port implementation that is needed to run the app on a
given platform (often all in the same source). This is very bad for reusability,
since if someone wants to write another jerry-based app for the same platform,
they will have to copy-paste the platform-specific code from the demo app. (This
is quite visible in recent `nuttx-stm32f4`-related developments: all
improvements in the target had to be replicated via copy-paste in IoT.js, as
there was no way for better code reuse.)
In addition to the reusability problem, there is one more issue. Port
implementations may have extra APIs on top of the mandatory jerry port API. Even
if they have extra headers for such APIs, they cannot be easily used. The port
implementation sources are injected into `jerry-core` but the build system has
no way of knowing whether that implementation has any interface headers - so
they are not publicised, they are not installed. If an application wanted to use
such a header it had to manually amend include directories. (This is visible in
in `jerry-main`, which adds `PORT_DIR` to its include path. Note however, that
this is quite error prone! In the sources, it is explicitly including
`jerryscript-port-default.h`, not "any" port's header, because it is relying on
the extensions of the default port implementation.)
# Proposal
I propose to change the way ports are treated. Let's split ports out of apps
(`targets/*`) into a different subdir hierarchy (I propose `jerry-port/*`) to
highlight the difference between platform-specific but reusable code and
app-specific code.
I also propose to drop the injection mechanism of `PORT_DIR` into `jerry-core`,
and on platforms where it makes sense, turn them into proper libraries.
As of now, there is only one properly separated port implementation (`default`),
which should be moved right away, but other target maintainers should also
consider the split (IMHO).
Note: actually, the proposed change does not _force_ splitting out port code
from apps, neither the introduction of new libraries. If an application decides
to keep port implementation tightly coupled with app code, nothing has to be
changed.
# Analysis
PROs:
- `jerry-core` is under full control, no external/unknown code is injected into
the build that could potentially cause conflicts,
- port implementation may be a proper lib with public interface headers
correctly managed/installed by build system,
- port does not have to be implemented in C, it may be coded in any language, and
- port implementations become reusable.
CONS:
- this is a potentially breaking change (mostly, not-in-tree users may be
affected).
| [Discussion] Split port implementation out of applications (and drop `PORT_DIR`) | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1776/comments | 1 | 2017-04-24T10:46:10Z | 2017-04-25T19:52:27Z | https://github.com/jerryscript-project/jerryscript/issues/1776 | 223,778,130 | 1,776 |
[
"jerryscript-project",
"jerryscript"
] | I would like to introduce a new port `tizenrt-artik05x`.
Tizen RT is a lightweight RTOS-based platform to support low-end IoT devices. The project is under developing in [github tizenrt repo](https://github.com/Samsung/TizenRT). Artik05x is an IoT SoC solution that will be released soon. Please refer to [Artik053](https://github.com/Samsung/TizenRT/blob/master/build/configs/artik053/README.md) for more information.
I will make a PR that contains the minimum porting that can print `Hello world from jerryscript` and a document for building and running. | target: tizenrt-artik05x: add minimal working port and the guide | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1774/comments | 5 | 2017-04-24T09:04:52Z | 2017-05-17T05:50:35Z | https://github.com/jerryscript-project/jerryscript/issues/1774 | 223,749,774 | 1,774 |
[
"jerryscript-project",
"jerryscript"
] | ###### Jerry version:
```
Checked revision: 67c641e
Build: ./tools/build.py --clean --debug --profile=es2015-subset
```
###### OS:
```
Ubuntu 16.04.2 LTS
```
###### Test case:
```javascript
Function()(Promise.prototype.toLocaleString())
```
###### Backtrace:
```
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):1796.
Error: ERR_FAILED_INTERNAL_ASSERTION
bt
#0 0x000000000047697d in syscall_2 () at jerryscript/jerry-libc/target/posix/jerry-asm.S:59
#1 0x000000000040474f in raise (sig=6) at jerryscript/jerry-libc/target/posix/jerry-libc-target.c:95
#2 0x0000000000404721 in abort () at jerryscript/jerry-libc/target/posix/jerry-libc-target.c:81
#3 0x00000000004133af in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/targets/default/jerry-port-default-fatal.c:53
#4 0x000000000042ad54 in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:61
#5 0x000000000042ada6 in jerry_assert_fail (assertion=0x4816f0 "ecma_object_check_class_name_is_object (obj_p)", file=0x480fc8 "jerryscript/jerry-core/ecma/operations/ecma-objects.c", function=0x4902f0 <__func__.4267.lto_priv.382> "ecma_object_get_class_name", line=1796) at jerryscript/jerry-core/jrt/jrt-fatals.c:85
#6 0x000000000043bc4e in ecma_object_get_class_name (obj_p=0x69f740 <jerry_global_heap+1144>) at jerryscript/jerry-core/ecma/operations/ecma-objects.c:1796
#7 0x000000000045ce23 in ecma_builtin_helper_object_to_string (this_arg=1147) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-helpers.c:76
#8 0x000000000043d47b in ecma_builtin_object_prototype_object_to_string.lto_priv.488 (this_arg=1147) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-object-prototype.c:59
#9 0x000000000044506c in ecma_builtin_object_prototype_dispatch_routine (builtin_routine_id=58, this_arg_value=1147, arguments_list=0x0, arguments_number=0) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-object-prototype.inc.h:32
#10 0x000000000045f7e7 in ecma_builtin_dispatch_routine (builtin_object_id=ECMA_BUILTIN_ID_OBJECT_PROTOTYPE, builtin_routine_id=58, this_arg_value=1147, arguments_list=0x0, arguments_number=0) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.inc.h:20
#11 0x000000000045ff12 in ecma_builtin_dispatch_call (obj_p=0x69fe60 <jerry_global_heap+2968>, this_arg_value=1147, arguments_list_p=0x0, arguments_list_len=0) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.c:844
#12 0x000000000043c5d3 in ecma_op_function_call (func_obj_p=0x69fe60 <jerry_global_heap+2968>, this_arg_value=1147, arguments_list_p=0x0, arguments_list_len=0) at jerryscript/jerry-core/ecma/operations/ecma-function-object.c:461
#13 0x000000000043d5d9 in ecma_builtin_object_prototype_object_to_locale_string.lto_priv.486 (this_arg=1147) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-object-prototype.c:112
#14 0x000000000044508a in ecma_builtin_object_prototype_dispatch_routine (builtin_routine_id=60, this_arg_value=1147, arguments_list=0x7fffffffcb10, arguments_number=0) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-object-prototype.inc.h:34
#15 0x000000000045f7e7 in ecma_builtin_dispatch_routine (builtin_object_id=ECMA_BUILTIN_ID_OBJECT_PROTOTYPE, builtin_routine_id=60, this_arg_value=1147, arguments_list=0x7fffffffcb10, arguments_number=0) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.inc.h:20
#16 0x000000000045ff12 in ecma_builtin_dispatch_call (obj_p=0x69ff78 <jerry_global_heap+3248>, this_arg_value=1147, arguments_list_p=0x7fffffffcb10, arguments_list_len=0) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.c:844
#17 0x000000000043c5d3 in ecma_op_function_call (func_obj_p=0x69ff78 <jerry_global_heap+3248>, this_arg_value=1147, arguments_list_p=0x7fffffffcb10, arguments_list_len=0) at jerryscript/jerry-core/ecma/operations/ecma-function-object.c:461
#18 0x000000000042049d in opfunc_call.lto_priv.143 (frame_ctx_p=0x7fffffffcb50) at jerryscript/jerry-core/vm/vm.c:411
#19 0x0000000000416a90 in vm_execute (frame_ctx_p=0x7fffffffcb50, arg_p=0x0, arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:2681
#20 0x0000000000416d11 in vm_run (bytecode_header_p=0x6a0e80 <jerry_global_heap+7096>, this_binding_value=27, lex_env_p=0x69f2f8 <jerry_global_heap+48>, is_eval_code=false, arg_list_p=0x0, arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:2761
#21 0x00000000004200f1 in vm_run_global (bytecode_p=0x6a0e80 <jerry_global_heap+7096>) at jerryscript/jerry-core/vm/vm.c:231
#22 0x0000000000474406 in jerry_run (func_val=195) at jerryscript/jerry-core/jerry.c:419
#23 0x0000000000473c3d in main (argc=3, argv=0x7fffffffd198) at jerryscript/jerry-main/main-unix.c:705
```
<sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/)</sup>
| Assertion 'ecma_object_check_class_name_is_object (obj_p)' failed in ecma_object_get_class_name | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1765/comments | 1 | 2017-04-21T14:17:31Z | 2019-01-02T10:00:31Z | https://github.com/jerryscript-project/jerryscript/issues/1765 | 223,397,226 | 1,765 |
[
"jerryscript-project",
"jerryscript"
] | ###### Jerry version:
```
Checked revision: ea44b3b
Build command: ./tools/build.py --clean --debug --profile=es2015-subset
```
###### OS:
```
Ubuntu 16.04.2 LTS
```
###### Test case:
```javascript
new Promise(Math.max.propertyIsEnumerable.toString).then()
```
###### Backtrace:
```
ICE: Assertion 'ECMA_IS_VALUE_ERROR (value)' failed at jerryscript/jerry-core/ecma/base/ecma-helpers-value.c(ecma_get_value_from_error_value):612.
Error: ERR_FAILED_INTERNAL_ASSERTION
bt
#0 0xf7fd8be9 in __kernel_vsyscall ()
#1 0xf7898ea9 in raise () from /lib/i386-linux-gnu/libc.so.6
#2 0xf789a407 in abort () from /lib/i386-linux-gnu/libc.so.6
#3 0x0806c9c3 in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/targets/default/jerry-port-default-fatal.c:53
#4 0x0809c825 in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:61
#5 0x0809c85d in jerry_assert_fail (assertion=0x8157500 "ECMA_IS_VALUE_ERROR (value)", file=0x8157080 "jerryscript/jerry-core/ecma/base/ecma-helpers-value.c", function=0x8118a00 <__func__.3817.lto_priv.746> "ecma_get_value_from_error_value", line=612) at jerryscript/jerry-core/jrt/jrt-fatals.c:85
#6 0x0810dffe in ecma_get_value_from_error_value (value=4132450179) at jerryscript/jerry-core/ecma/base/ecma-helpers-value.c:612
#7 0x080b69b8 in ecma_process_promise_reaction_job.lto_priv.432 (obj_p=0xf6102170) at jerryscript/jerry-core/ecma/operations/ecma-jobqueue.c:170
#8 0x0806c319 in jerry_port_jobqueue_run () at jerryscript/targets/default/jerry-port-default-jobqueue.c:124
#9 0x0811760f in main (argc=3, argv=0xffffc3d4) at jerryscript/jerry-main/main-unix.c:814
```
<sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/)</sup>
| Assertion 'ECMA_IS_VALUE_ERROR (value)' failed in ecma_get_value_from_error_value | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1763/comments | 2 | 2017-04-21T13:48:28Z | 2019-01-02T10:00:31Z | https://github.com/jerryscript-project/jerryscript/issues/1763 | 223,388,985 | 1,763 |
[
"jerryscript-project",
"jerryscript"
] | As part of foundation ops, we've been looking into ways to add open source license compliance processes to the org in a way that lets JSF projects maintain their autonomy. We're currently looking at adopting [FOSSA](http://fossa.io/) to help us continuously scan for licenses across JSF projects/their deep dependencies and automate compliance work.
FOSSA works like a CI or license linter -- on each commit it scans all source files in a project and its dependencies for license violations. It can then automatically trigger Slack notifications, block PRs that bring in deps with incompatible licenses, collect raw copyright headers to generate attribution files/notices and more. They're focused a lot on making compliance really easy to run in the background for developers, and they're already running on a bunch of open source JavaScript projects.
| Add FOSSA License Scanner to CI | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1759/comments | 9 | 2017-04-21T01:23:09Z | 2019-10-25T19:47:33Z | https://github.com/jerryscript-project/jerryscript/issues/1759 | 223,247,520 | 1,759 |
[
"jerryscript-project",
"jerryscript"
] | It would be nice if the VM loop can be interruptible.
In those cases when the JerryScript is used as a library or embedded in a 3rd party application it is hard to be responsible for the application. If the execution of a JavaScript takes too much time - infinite loop, benchmarking, etc. - the main application is not able pause or brake the current execution context.
Is it possible to have a callback function mechanism implemented which is responsible to break or pause the current VM loop? Maybe this callback function can be called in backward loop instruction (if there is such). | Interruptible VM loop via callback function | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1752/comments | 3 | 2017-04-20T06:41:54Z | 2017-05-02T06:53:38Z | https://github.com/jerryscript-project/jerryscript/issues/1752 | 222,964,260 | 1,752 |
[
"jerryscript-project",
"jerryscript"
] | For developer may want to known current snapshot version, could export macro 'JERRY_SNAPSHOT_VERSION' for user to access?
currently this macro exist in jerry-snapshot.h which could not be included by developers.
e.g move JERRY_SNAPSHOT_VERSION from jerry-snapshot.h to jerryscript.h | Export macro JERRY_SNAPSHOT_VERSION | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1751/comments | 6 | 2017-04-20T06:06:09Z | 2019-01-10T17:51:55Z | https://github.com/jerryscript-project/jerryscript/issues/1751 | 222,958,477 | 1,751 |
[
"jerryscript-project",
"jerryscript"
] | For our project, I would like to be able to instantiate (multiple) JerryScript engines, each with their own heap size.
Currently, the heap size is configured at compile-time using `CONFIG_MEM_HEAP_AREA_SIZE`, which controls these defines and structs:
```
#define JMEM_HEAP_SIZE ((size_t) (CONFIG_MEM_HEAP_AREA_SIZE))
...
#define JMEM_HEAP_AREA_SIZE (JMEM_HEAP_SIZE - JMEM_ALIGNMENT)
...
typedef struct
{
jmem_heap_free_t first; /**< first node in free region list */
uint8_t area[JMEM_HEAP_AREA_SIZE]; /**< heap area */
} jmem_heap_t;
...
extern jmem_heap_t jerry_global_heap;
...
// All accesses of `jerry_global_heap` should be done through this macro:
#define JERRY_HEAP_CONTEXT(field) (jerry_global_heap.field)
```
Simplest way to solve this would be to add `#ifndef JERRY_HEAP_CONTEXT` around the `#define JERRY_HEAP_CONTEXT ...` and make it possible to let the client of JerryScript define `JERRY_HEAP_CONTEXT` without having to touch `jcontext.h`. Should the `jerry_global_heap` variable declaration in `jcontext.c` also be #ifdef'd out in this case?
BTW, `JERRY_CONTEXT`, `JERRY_HASH_TABLE_CONTEXT`, etc. should probably also have `#ifndef`s around them?
Thoughts? | [Discussion] Improved multi-instance support (incl. runtime configurable heap size) | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1746/comments | 13 | 2017-04-19T09:56:10Z | 2019-01-02T10:00:30Z | https://github.com/jerryscript-project/jerryscript/issues/1746 | 222,683,258 | 1,746 |
[
"jerryscript-project",
"jerryscript"
] | While jerry_exec_snapshot does receive (a param #2) the length of the snapshot buffer, it does not pass it to snapshot_load_compiled_code, which is prone to unsupported snapshot contents (i.e.: corrupt file, snapshot generated by different jerry version etc.).
This has been observed in practice, crashing TizenRT platform (offset being ~20MB, with largest snapshot included smaller than 5kB). | snapshot_load_compiled_code does not verify snapshot size | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1741/comments | 6 | 2017-04-18T10:30:04Z | 2018-05-24T09:25:24Z | https://github.com/jerryscript-project/jerryscript/issues/1741 | 222,371,343 | 1,741 |
[
"jerryscript-project",
"jerryscript"
] | TL;DR: `print` is not part of the ES standard, JerryScript still supports it unconditionally in the core of the engine. Shall we keep it there or not?
JerryScript - or, the jerry-core library - aims to be a complete ES5.1 engine, but as small as possible. (Plus, ES2015 features start getting implemented, but that's a long road ahead. And I hope that resource awareness will be kept in mind during those implementation works, too.) The implementation follows the standard quite strictly (minus the unintentional bugs, of course), except for one built-in function: the global object's `print` method, which is not mentioned anywhere in the standard.
Of course, having `print` available is really useful for testing the engine. E.g., the command line tool `jerry`, which is built around the library both as a testing tool and as an example for other embedders, would not be of big use if no output would be observable. `print("Hello JerryScript!");` is really something that can be expected to work.
Still, the question is, shall the implementation of `print` reside in jerry-core? There are two other JS utility functions now, which are also available from the global object in `jerry`: `assert` and `gc`, but they are added as external functions by the tool, not provided by the core engine. So, there is a precedent for having non-standard functions registered from outside. To reformulate the question: is `print` different enough from / more important than `assert` and `gc` that justifies its implementation in the core?
The issue with the JavaScript `print` function is linked to another issue: the need for the `jerry_port_console` port C function. This port function has only been introduced to ensure that the implementation of the `print` built-in was not tied to the `printf` libc function. But, if `print` is not provided by the core engine then the ports don't have to provide the `jerry_port_console` either (i.e., we can make the port API a bit leaner).
I've investigated the use cases of JS `assert` (as an example) and JS `print` (as the topic of this issue), and the implementation of C `jerry_port_console` (because it is closely related to `print`) in the default command line tool and in all targets found in the repository + in the external IoT.js project. (I've started writing all this up a while ago and `gc` is a somewhat recent addition, so I've not compiled data on that.) The following table summarizes the findings:
| | availability of JS `assert` | availability of JS `print` | use of `print` and `jerry_port_console` |
|--------------|---------------------------------------------|--------------------------------------------------------------------------------------------------|------------------------------------------------------------|
|main-unix | external C (calls `jerry_port_log`, `exit`) | builtin + links default `jerry_port_console` | C calls `jerry_port_console` directly & C calls JS `print` |
|esp8266 | external C (calls `printf`, `exit`) | external C (calls `printf`) & builtin + links default `jerry_port_console` | JS examples call JS `print` |
|mbed | external C (calls `printf`, `exit`) | builtin + implements `jerry_port_console` (calls `vfprintf`) | JS examples call JS `print` |
|mbedos5 | external C (throws JS error) | builtin + implements `jerry_port_console` (calls `vfprintf`, `printf`) | JS examples call JS `print` |
|curie_bsp | none | builtin + implements `jerry_port_console` (calls `vsnprintf`, `printk`) | C calls `jerry_port_console` directly & C calls JS `print` |
|zephyr | none | builtin + implements `jerry_port_console` (calls `vfprintf`) | README example calls JS `print` & C calls JS `print` |
|nuttx-stm32f4 | external C (calls `jerry_port_log`, `exit`) | builtin + implements `jerry_port_console` (calls `vfprintf`) | C calls `jerry_port_console` directly |
|particle | none | builtin + links default `jerry_port_console` (should implement? `Serial.println`) | none |
|riot-stm32f4 | none | builtin + links default `jerry_port_console` | hardcoded JS script calls JS `print` |
|iot.js | pure JS (throws JS error) | builtin + links default `jerry_port_console` & external C for JS `console.log` (calls `fprintf`) | none |
Summary:
- 5 targets (esp8266, curie_bsp, zephyr, particle, riot-stm32f4) don't implement `assert` at all.
- 5 targets (mbed, mbedos5, curie_bsp, zephyr, nuttx-stm32f4) implement their own `jerry_port_console`.
- esp8266 has the default `print` with `jerry_port_console` implementation in its code base but then redefines `print` with an external function.
- iot.js has `print` and `console.log` both, but should not expose `print` IMHO. (It has no choice, however.)
- particle uses the default port's `jerry_port_console` implementation but it is unclear whether that's OK (or it should have its own implementation based on `Serial.println`).
- 3 targets (main-unix, curie_bsp, zephyr) call the JS `print` function from the C code via the JerryScript API.
- Several targets call `print` from JS example code, README descriptions, etc.
Moreover, JS `print` is used all over in debugger tests (tests/debugger), in some conformance tests (tests/jerry-test-suite/es2015), and in some regression tests (tests/jerry). Thus, if `print` is unavailable, testing cannot be performed on a target/port.
So, it seems that `print` has infiltrated most of the platforms and most of the use cases. But! Note that `assert` would also be needed for all tests to run, so would be `gc` now. So, if it is "only" about testing, then we are already facing problems in several targets as these JS functions are unavailable.
If we drop the `print` built-in, it has pros and cons (as I see it):
Pros:
- Only standard built-ins in jerry-core.
- Smaller jerry-core code base.
- Smaller port API.
Cons:
- Heavy refactoring needed (e.g., provide replacements for C `jerry_port_console` or JS `print` where directly used from C code).
- All targets must provide their own external C implementation for JS `print` (if they really need it).
Ultimate question: what does the community think?
| [Discussion] Are JS `print` and C `jerry_port_console` functions needed? | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1737/comments | 6 | 2017-04-15T19:11:05Z | 2017-05-03T09:48:46Z | https://github.com/jerryscript-project/jerryscript/issues/1737 | 221,966,831 | 1,737 |
[
"jerryscript-project",
"jerryscript"
] | [This conversation](https://github.com/01org/zephyr.js/issues/852) prompted me to wonder about the roadmap of JerryScript. I remember that Samsung representatives joined us at a TC39 meeting in 2014 and explained that the goal was to create an ES5.1 subset, but it appears that ES2015 features have also been added (which is good!).
Anyway, I'm wondering if there is a published document that describes the long term goals, or a roadmap of some sort. Thanks in advance! :) | JerryScript Development Roadmap? | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1735/comments | 1 | 2017-04-14T18:12:12Z | 2018-05-24T09:26:11Z | https://github.com/jerryscript-project/jerryscript/issues/1735 | 221,860,776 | 1,735 |
[
"jerryscript-project",
"jerryscript"
] | Related to #1717 would it be possible to implement support for constructors (`__attribute__((constructor))`) in jerry's C library? I think that's where it needs to be implemented, in the `jerry-asm.S` file.
Having support for constructors makes it easy to register modules independently of the main program, since all you have to do is compile in a module and it will be available at runtime without any additional code. | Feature request: Support __attribute__((constructor)) for easy module loading | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1722/comments | 13 | 2017-04-09T18:03:11Z | 2017-04-13T15:21:12Z | https://github.com/jerryscript-project/jerryscript/issues/1722 | 220,487,512 | 1,722 |
[
"jerryscript-project",
"jerryscript"
] | A while ago, `JERRY_CONTEXT` define and `jerry_context_t` had been added.
Before that change, all the fields in `jerry_context_t` were `static`s that were sprinkled throughout the JerryScript code base. This wasn't great for projects where multiple instances of JerryScript are needed, because `static`s are by definition "singleton".
Luckily, the addition of the `JERRY_CONTEXT` define made it easier to create multiple instances of JerryScript. Typically, to support multiple instances, one would provide a custom definition of `JERRY_CONTEXT`, for example to look up the current `jerry_context_t` in thread local storage.
However, often, binding code also needs to keep state regarding the native resources that it uses. In a multi-context scenario, each instance of JerryScript needs to have its own "instance" of this binding state as well. Therefore, using `static` variables cannot be used. Again, because `static` equals "singleton".
Using `__thread` or a platform-specific thread local storage (TLS) API could be used of course, but this would make the binding code less portable / re-usable.
Therefore, I think it make sense to try to come up with an API to associate binding state with a JerryScript context in an easy way that promotes re-use and portability of the binding code.
Some design goals that I have in mind for this an API to associate binding state with a JerryScript context:
- enable multiple bindings to each associate their own state with a JerryScript context.
- making binding code "portable" / re-usable: avoid `__thread` or a platform specific TLS API.
- should not require having to change JerryScript code (incl. `jcontext.[h|c]`).
- "scales down": no bloat when using a single-context (same speed/RAM/code size as today).
- easy to use from a developer point of view (probably not as easy as `static`, but hopefully close?)
I imagining something like a `void *user_binding_state[]` array in `JERRY_CONTEXT`, plus a couple of `jerry_...` functions to register/allocate/get/free the state for a particular binding. But I'm not quite sure how such a solution would "scale down".
Thoughts? | [Discussion] API to associate binding state (pointers) with the JerryScript context | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1717/comments | 52 | 2017-04-06T12:59:25Z | 2017-04-14T00:25:30Z | https://github.com/jerryscript-project/jerryscript/issues/1717 | 219,890,608 | 1,717 |
[
"jerryscript-project",
"jerryscript"
] | When implementing external functions, you might have written something like this:
```
// Native implementation of Xyz.prototype.doSomething(a, b)
// First arg is expected to be a string.
// Second (optional) arg is expected to be a boolean.
// `this` is expected to be bound to an instance of Xyz.
static jerry_value_t native_method_impl(const jerry_value_t func_val __attribute__((unused)),
const jerry_value_t this_val __attribute__((unused)),
const jerry_value_t *args_p __attribute__((unused)),
const jerry_length_t args_cnt __attribute__((unused))) {
if (args_cnt < 2) {
return jerry_create_error(...);
}
// Validate and "transform" (copy to C string) argument 0:
if (!jerry_value_is_string(args_p[0])) {
return jerry_create_error(...);
}
char arg0[32];
if (0 == jerry_string_to_utf8_char_buffer(arg[0], (jerry_char_t *)arg0, sizeof(arg0))) {
// arg0 buffer too small
return jerry_create_error(...);
}
// Validate and "transform" (copy to C bool) argument 1:
bool arg1 = true; /* default value is true */
if (args_cnt >= 1) {
// Optional 2nd arg of type boolean
if (!jerry_value_is_boolean(args_p[1])) {
return jerry_create_error(...);
}
arg1 = jerry_get_boolean_value(args_p[1]);
}
// Validate `this`:
struct native_obj_t *this_native_obj;
if (!jerry_get_object_native_handle(this_val, (uintptr_t *)&this_native_obj)) {
// Whoops, no native handle at all! Caller probably re-bound the method.
return jerry_create_error(...);
}
if (!check_is_native_obj(native_obj)) {
// Whoops, some other kind of struct! Caller probably re-bound the method.
return jerry_create_error(...);
}
// yay, arguments validated (finally!)
// Now, let's use this_native_obj, arg0 and arg1 to do something interesting!
// ... method implementation here ...
return jerry_create_undefined();
}
void xyz_init(void)
{
// ...
jerry_value_t do_something = jerry_create_external_function(native_method_impl);
jerry_value_t rv = jerry_set_property (xyz_prototype, do_something_name, do_something);
// ...
}
```
In short, when implementing a native external function, one may have to:
1. Check that mandatory arguments...
- are supplied at all.
- are of the expected type.
- are within the expected range of values.
2. Check optional arguments in a similar manner as mandatory ones. Assume default values when omitted.
3. Check `this` in a similar manner as mandatory ones.
4. If a check does not pass, return appropriate JS Error (Error, TypeError, ...).
5. "Transform" the JS value to C values (i.e. copy to C string, assign C bool, convert string to C enum ...)
All projects I've looked at either use macros or helper functions to condense the code a bit, but effectively still
involves quite a bit of manually written validation code.
Writing correct validation code is quite involved, tedious and prone to errors.
Therefore, I'd like to propose adding a utility to JerryScript to help with this task.
## Proposal
Design Goals for the initial version of this utility:
- Simple validation of arguments (incl. `this`) and "transformation" to C types.
- The solution should target "most common cases", including:
- Checks & transforms for values of primitive/common types (string => char *, boolean => C bool, etc.).
- Optional arguments.
- Extensibility: it should be possible to add additional check/transformer functions without having to change JerryScript source code files.
- Smaller binary code size compared to manual validation code.
Non-goals:
- "Function overloading" / allowing an argument to be of various types and changing the behavior of the function based on the argument type. In my opinion this is not a "common case". Addressing this case by manually writing validation code is probably fine.
- "Rest/... parameters". I think it's OK to check/transform rest parameters manually manually for now.
- "options" object arguments (passing an object containing additional/optional arguments). Support for this can be added later.
- string "symbols" to C enums: can be added later. However, it should be trivial to add such a check+transform yourself.
Me and @jiangzidong have come up with this solution direction.
Here is how the utility would be used in the example use case:
```
static const jerry_native_handle_info_t native_obj_info = ...; // depends on PR #1711
// Native implementation of Xyz.prototype.doSomething(a, b)
// First arg is expected to be a string.
// Second (optional) arg is expected to be a boolean.
// `this` is expected to be bound to an instance of Xyz.
static jerry_value_t native_method_impl(const jerry_value_t func_val __attribute__((unused)),
const jerry_value_t this_val __attribute__((unused)),
const jerry_value_t *args_p __attribute__((unused)),
const jerry_length_t args_cnt __attribute__((unused))) {
char arg0[32];
bool arg1 = true; /* default value is true */
struct native_obj_t *this_native_obj;
const jerry_arg_t mapping[] = {
// First element in the array is the mapping for `this`.
// If no checking is needed for `this`, use JERRY_ARG_IGNORE.
{JERRY_ARG_TYPED_NATIVE_HANDLE, &this_native_obj, native_obj_info}, // depends on PR #1711
// Further elements map to args_p[0], args_p[1], etc.
{JERRY_ARG_UTF8_STRING, arg0, sizeof(arg0)},
{JERRY_ARG_OPTIONAL | JERRY_ARG_BOOL, &arg1},
};
// This function is the "work horse" which does the validation and transformations:
jerry_value_t err;
if (!jerry_validate_and_assign_args(&err, this_val, args_p, args_cnt, mapping, ARRAY_LENGTH(mapping))) {
return err;
}
// yay, arguments validated (that was easy!)
// Now, let's use this_native_obj, arg0 and arg1 to do something interesting!
// ... method implementation here ...
return jerry_create_undefined();
}
```
The basic idea is to create an array that describes what types of arguments are expected in the `args_p` array, how to transform them and to where to assign the results to.
A glimpse behind the scenes:
```
typedef enum
{
// Ignore the argument (useful to skip validating `this` or for args that need to be checked manually)
JERRY_ARG_IGNORE = 0,
// Checks for boolean and assigns to C bool
JERRY_ARG_BOOL,
// Checks for number within uint8_t range and assigns to C uint8_t
JERRY_ARG_UINT8,
// ... repeats for each [u]intXX_t
// Checks for string, copies C string to existing buffer.
JERRY_ARG_UTF8_STRING,
// Checks for string, creates buffer using jerry_port_malloc() and copies C string to it.
JERRY_ARG_UTF8_STRING_MALLOC,
// Checks that native handle matches supplied jerry_native_handle_info_t * // depends on PR #1711
JERRY_ARG_TYPED_NATIVE_HANDLE,
// Checks for function and assigns to jerry_value_t
JERRY_ARG_FUNCTION,
...
JERRY_ARG__COUNT,
// Flag to indicate the argument is optional (`undefined` or of the expected type & value)
JERRY_ARG_OPTIONAL = 0x80,
} jerry_arg_type_t;
_Static_assert(JERRY_ARG__COUNT <= JERRY_ARG_OPTIONAL, "Too many JERRY_ARG_... enums!");
typedef struct
{
// Type of check + transform:
jerry_arg_type_t arg_type;
// "Destination" pointer: (this is where the transformed value need to be assigned to)
union {
void *ptr;
char *ptr_char;
uint8_t *ptr_uint8;
// ... etc ...
};
} jerry_arg_t;
```
Using anonymous unions, defining the array can be quite clean looking.
I imagine adding (inline) C functions to create each of the `jerry_arg_t` elements in the array and get better type safety etc.
`jerry_validate_and_assign_args()` would take the array of `jerry_arg_t` elements and iterate over them, checking for each element whether the corresponding argument from `arg_p` matches. If so, it would transform the value and assign it to the "destination".
## Open Questions
- Extensibility: our current thinking is to add a `JERRY_ARG_CUSTOM` enum value and to provide a validation+transformation callback as part of the `jerry_arg_t` element. Note we would need to add another field for the callback to `jerry_arg_t` (thus increasing all members in the array...) Alternatively, we could have a "registration" API to add custom validations/transforms at runtime. Any other ideas are welcome.
- Errors: would it be OK if the utility defined the Error types and messages? Or do users of this utility need control over this (i.e. through a port function)?
- Smaller binary code size: any thoughts on the current design and its implications for code size? We tried to limit the number of function calls to one (although one with 6 arguments). In our experience, function calls take up quite a lot of code space.
- Alternative solution direction: using a "format string" to specify the transformations in a single C string (kind of like Python's [struct.unpack]). I think this would be harder to use (you have to learn the "format string" format), but it may be better from a code size and extensibility perspective compared to the proposal.
[struct.unpack]: https://docs.python.org/2/library/struct.html | [Proposal] Utilities for argument validation in external functions | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1716/comments | 38 | 2017-04-05T14:13:54Z | 2019-01-02T10:00:30Z | https://github.com/jerryscript-project/jerryscript/issues/1716 | 219,597,206 | 1,716 |
[
"jerryscript-project",
"jerryscript"
] | Is there any plan to support for iOS? | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1713/comments | 14 | 2017-04-04T11:37:13Z | 2019-01-30T07:44:37Z | https://github.com/jerryscript-project/jerryscript/issues/1713 | 219,221,727 | 1,713 |
|
[
"jerryscript-project",
"jerryscript"
] | In the most GitHub project website use the "Fork me on GitHub" ribbon. In my opinion this is a good proposer to check our repository. So we can change the "View on GitHub" menu for this, but first I want to ask the community about it.
If you don't know about ribbons check [this](https://github.com/blog/273-github-ribbons). | Use GitHub ribbon | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1709/comments | 6 | 2017-03-31T09:41:11Z | 2017-04-07T16:50:04Z | https://github.com/jerryscript-project/jerryscript/issues/1709 | 218,450,503 | 1,709 |
[
"jerryscript-project",
"jerryscript"
] | Hi,
For those of you who *do* read the GitHub issues but are not on the [mailing list](https://mail.gna.org/listinfo/jerryscript-dev):
We are planning the first JerryScript community call on Wednesday 5 April, 10:00 CET / 18:00 Korea / 17:00 China / 09:00 UK time. It's a chance to meet fellow contributors and discuss the plans we have with JerryScript. There's no set agenda for the first call.
To join, just go to this Google Hangout: https://hangouts.google.com/call/fwivajpnavhn7j64wiknjo7tvqe
Hope to see you all on Wednesday!
| JerryScript community call 5 April | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1706/comments | 1 | 2017-03-31T07:38:11Z | 2017-04-24T13:53:22Z | https://github.com/jerryscript-project/jerryscript/issues/1706 | 218,421,526 | 1,706 |
[
"jerryscript-project",
"jerryscript"
] | ###### Jerry version:
```
Checked revision: 3ff9a7d
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 --jerry-libc=off --static-link=off --strip=off --system-allocator=on --linker-flag=-fuse-ld=gold --error-messages=on
```
###### OS:
```
Ubuntu 16.04.2 LTS
```
###### Test case:
```javascript
Number(982).toPrecision(1)
```
###### Backtrace:
```
=================================================================
==29528==ERROR: AddressSanitizer: stack-buffer-overflow on address 0xf54b4b5f at pc 0x080bc8d2 bp 0xffabc658 sp 0xffabc648
READ of size 1 at 0xf54b4b5f thread T0
#0 0x80bc8d1 in ecma_builtin_number_prototype_helper_round jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-number-prototype.c:159
#1 0x80bc8d1 in ecma_builtin_number_prototype_object_to_precision.lto_priv.483 jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-number-prototype.c:845
#2 0x80c499a in ecma_builtin_number_prototype_dispatch_routine jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-number-prototype.inc.h:37
#3 0x80ea9f8 in ecma_builtin_dispatch_routine.lto_priv.626 jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.inc.h:91
#4 0x80e533d in ecma_builtin_dispatch_call jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.c:844
#5 0x80b1356 in ecma_op_function_call jerryscript/jerry-core/ecma/operations/ecma-function-object.c:461
#6 0x807d096 in opfunc_call.lto_priv.236 jerryscript/jerry-core/vm/vm.c:411
#7 0x80689ad in vm_execute jerryscript/jerry-core/vm/vm.c:2682
#8 0x8068f32 in vm_run jerryscript/jerry-core/vm/vm.c:2761
#9 0x807c73f in vm_run_global jerryscript/jerry-core/vm/vm.c:231
#10 0x810e219 in jerry_run jerryscript/jerry-core/jerry.c:387
#11 0x810d608 in main jerryscript/jerry-main/main-unix.c:731
#12 0xf6fee636 in __libc_start_main (/lib/i386-linux-gnu/libc.so.6+0x18636)
#13 0x8048e50 (jerryscript/build/bin/jerry+0x8048e50)
Address 0xf54b4b5f is located in stack of thread T0 at offset 95 in frame
#0 0x80bc2d7 in ecma_builtin_number_prototype_object_to_precision.lto_priv.483 jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-number-prototype.c:769
This frame has 2 object(s):
[32, 36) 'exponent'
[96, 160) 'digits' <== Memory access at offset 95 underflows this variable
HINT: this may be a false positive if your program uses some custom stack unwind mechanism or swapcontext
(longjmp and C++ exceptions *are* supported)
SUMMARY: AddressSanitizer: stack-buffer-overflow jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-number-prototype.c:159 ecma_builtin_number_prototype_helper_round
Shadow bytes around the buggy address:
0x3ea96910: f5 f5 f5 f5 00 00 00 00 00 00 00 00 00 00 00 00
0x3ea96920: f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5
0x3ea96930: f5 f5 f5 f5 00 00 00 00 00 00 00 00 00 00 00 00
0x3ea96940: f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5
0x3ea96950: f5 f5 f5 f5 00 00 00 00 00 00 00 00 00 00 00 00
=>0x3ea96960: f1 f1 f1 f1 04 f4 f4 f4 f2 f2 f2[f2]00 00 00 00
0x3ea96970: 00 00 00 00 f3 f3 f3 f3 00 00 00 00 00 00 00 00
0x3ea96980: f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5
0x3ea96990: f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 00 00 00 00
0x3ea969a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x3ea969b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 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
Heap right redzone: fb
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack partial redzone: f4
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
==29528==ABORTING
```
<sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/)</sup>
| stack-buffer-overflow in ecma_builtin_number_prototype_helper_round | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1701/comments | 0 | 2017-03-30T09:52:02Z | 2019-06-17T06:26:44Z | https://github.com/jerryscript-project/jerryscript/issues/1701 | 218,141,263 | 1,701 |
[
"jerryscript-project",
"jerryscript"
] | ## Background
### Pebble App Runtime
At Pebble, the watches run 3rd party applications inside an "application runtime" (JerryScript is part of this). We shipped new firmware updates every 6 weeks or so, which often included fixes and optimization, potentially affecting that application runtime. While making changes to the runtime, we always tried our best to avoid breaking any existing applications. It's worth mentioning, that those 3rd party applications had an update cycle that was decoupled and was often way slower, e.g. once a year, when a new HW model came out.
I suspect that most JerryScript-based projects (IoT.js, Zephyr.js, mbed.js, etc.) do not have to deal with decoupled release cycles between 1st party "application runtime" and 3rd party .js application code. So the issue I'm about to explain is probably a none-issue for those projects.
### "Memory Contract"
One of the biggest challenges we had to deal with, is what we call the "Memory Contract": the idea that the memory footprint (esp. heap usage) underneath an API, must never grow over time. Not obeying this "contract" meant potential trouble for existing applications. Even growing an internal struct by one byte from one firmware version to the next, could mean that a (3rd party) application that ran fine on the earlier firmware version, may run out of memory on the updated firmware, if the app used an API that allocated that bigger struct behind the scenes and it was at the edge of running out of memory. And this actually happened in practice early on, before we formally defined a "Memory Contract".
Note that in our case, the applications are written by 3rd parties over which Pebble's firmware developers had no direct control. We did try to motivate them to test their applications by releasing a beta version of our firmware ahead of the public release, in order to find out memory contract issues and hopefully giving us a chance to fix problems before the public release. But having to prod developers to fix apps for every system software release is no fun. Having applications "rot" away and having to remove them because of this is also no fun.
The "solution" we used was quite simple. By padding out structs up to the contract-defined size per type (a few extra bytes), we effectively bought ourself a bit of leeway to add fields in the future, at the cost of wasting those unused padding bytes, for example:
```
typdef struct {
int foo;
int bar;
uint8_t _padding[8];
} SomeDatastructureInternalToAPIImplementation;
_Static_assert(sizeof(SomeDatastructureInternalToAPIImplementation) == 16,
"Whoops, larger than allowed!");
```
I realize many types of refactorings affect memory usage (both the heap as well as stack) in ways that will not be covered or caught by this system. That said, it did cover many refactorings that we did and thereby effectively slowed down "application rot".
## Memory Contract for JerryScript
When we added JerryScript in the mix at Pebble, we ignored to define a "Memory Contract" for the JerryScript code itself. We felt it was a topic that needed to addressed in JerryScript itself, but never really got to addressing this.
Our proposal is based on pre-processor macros, to support semi-automatic padding of structs.
In creating them, we have 2 design goals:
- for clients of JerryScript that do not share our concern, there should be no impact on the RAM footprint.
- the "baseline" for how much padding should be added should be decided by the client project, based on how large the unpadded structs are when starting the project and also based on a guesstimate of how long into the future they want to be able support that contract (the more padding you add, the more wiggle room you buy to allow for future expansions).
Sketch:
```
// --- For each struct declaration in JerryScript:
JERRY_TYPEDEF_STRUCT({
// ... all the fields here ...
}, ecma_object_t);
// ... etc ...
// --- default-padding.h (part of JerryScript)
// By default, don't add padding:
#ifndef JERRY_TYPEDEF_STRUCT
# define JERRY_TYPEDEF_STRUCT(c_type, ...) \
typedef struct { \
__VA_ARGS__ \
} c_type;
#endif
// --- my-project-padding.h (passed into gcc using -include)
// Max struct sizes ("Memory Contract"):
#define EXPECTED_SIZE_ecma_object_t 8
#define EXPECTED_SIZE_ecma_built_in_props_t 16
// ... etc ...
// Padding size controls:
#define PADDING_SIZE_ecma_object_t 4
#define PADDING_SIZE_ecma_built_in_props_t 4
// ... etc ...
#define JERRY_TYPEDEF_STRUCT(c_type, ...) \
typedef struct { \
__VA_ARGS__ \
uint8_t _padding[PADDING_SIZE_##c_type]; \
} c_type; \
_Static_assert(sizeof(c_type) == EXPECTED_SIZE_##c_type, \
"struct 'TODO' too large!");
// TODO: Need a macro for structs with flexible arrays at the end.
```
Because of the large alignment size of the JerryScript heap, this would probably waste too much space for most users, hence the "fallback" default-padding.h that does not add any padding at at.
I'm looking forward to feedback on this idea. Has anyone else run into these or similar concerns?
| [Proposal] 'Memory Contract' for JerryScript structs | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1694/comments | 9 | 2017-03-28T10:17:19Z | 2019-10-25T20:04:34Z | https://github.com/jerryscript-project/jerryscript/issues/1694 | 217,512,035 | 1,694 |
[
"jerryscript-project",
"jerryscript"
] | Hi guys,
I encountered the following problem when compiling jerryscript for zephyr target. I use GNU ARM Embedded Toolchain, not Zephyr SDK on Mac OSX. Any ideas about this? Thanks for your help.
```
....
../../../../arm-none-eabi/bin/ld: error: zephyr_prebuilt.elf uses VFP register arguments,
.../../../../arm-none-eabi/lib/libm.a(lib_a-s_nextafter.o) does not
....
```
| error: zephyr_prebuilt.elf uses VFP register arguments | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1684/comments | 2 | 2017-03-24T02:08:01Z | 2017-04-24T13:52:40Z | https://github.com/jerryscript-project/jerryscript/issues/1684 | 216,624,506 | 1,684 |
[
"jerryscript-project",
"jerryscript"
] | So far, all projects I've looked at that use JerryScript's [native handle APIs], fail to implement proper validation on obtained native handle values. Zephyr.js, IoT.js, mbed.js, etc. are all affected by this problem.
Let me explain the problem by using an example from the mbedos5 port. The port defines a number of bindings that define classes of JavaScript objects which, on the native side, are backed by different C++ classes (in case of a C project, they would be backed by different types of structs).
For example, there is a [`AnalogIn` C++ class] for which a [`AnalogIn` JavaScript constructor and method bindings] are defined. Below a snippet for the `read()` method. There, `jerry_get_object_native_handle()` is used to get a pointer to the `AnalogIn` C++ instance that is (presumably) associated with the JS `AnalogIn` object on which `read()` is called:
```
// AnalogIn.prototype.read(num):
DECLARE_CLASS_FUNCTION(AnalogIn, read) {
CHECK_ARGUMENT_COUNT(AnalogIn, read, (args_count == 0));
// Extract native AnalogIn pointer
uintptr_t ptr_val;
jerry_get_object_native_handle(this_obj, &ptr_val);
AnalogIn* native_ptr = reinterpret_cast<AnalogIn*>(ptr_val);
float result = native_ptr->read();
return jerry_create_number(result);
}
```
The problem arises when `this` gets bound to a JS object with no native handle, or even worse, a native handle containing a pointer to a *different* C++ class instance / C struct type. For example:
```
// d's native handle is a pointer to C++ instance of class `DigitalOut`:
var d = new DigitalOut(1);
// i's native handle is a pointer to C++ instance of class `AnalogIn`:
var i = new AnalogIn(2);
// Whoops.. the read() binding will interpret the native handle as a pointer to an
// `AnalogIn` instance, while it's actually a `DigitalOut`... Unsafe/invalid cast! BAD!
i.read.call(d);
```
Note this is not only applies to getting native handles for `this`, but also for arguments to a function. Also note that checking `this.constructor` isn't bullet proof, because it can be changed from the JS code.
## TL;DR
So, in short, one would *always* have to add type checks to make sure that the native handle is actually of the expected type, before casting and dereferencing the handle's value.
Because one would always have to deal when using the native handle API and because apparently the issue is overlooked by many dependent projects, I would argue that this concern should be addressed by JerryScript's API, by adding a type field to the API.
## Latest Proposal (updated after discussion below):
```
// --- jerryscript.h
// Old API:
__attribute__((deprecated))
bool jerry_get_object_native_handle (const jerry_value_t obj_val,
uintptr_t *out_handle_p);
__attribute__((deprecated))
void jerry_set_object_native_handle (const jerry_value_t obj_val,
uintptr_t handle_p,
jerry_object_free_callback_t freecb_p);
// New API:
//! Structure
typedef struct {
jerry_object_free_callback_t free_cb;
} jerry_native_handle_info_t;
#define JERRY_NATIVE_HANDLE_INFO_FOR_CTYPE(c_type) _jerry_native_handle_info_##c_type
#ifndef JERRY_DEFINE_NATIVE_HANDLE_INFO
#define JERRY_DEFINE_NATIVE_HANDLE_INFO(c_type, free_cb) \
static const jerry_native_handle_info_t JERRY_NATIVE_HANDLE_INFO_FOR_CTYPE(c_type) = { \
.free_cb = free_cb, \
};
#endif // JERRY_DEFINE_NATIVE_HANDLE_INFO
//! When getting, also pass the native handle info.
//! @return false if no native handle, true if out_handle_p and
//! out_native_handle_type were assigned.
bool jerry_get_object_native_handle_ext (const jerry_value_t obj_val, uintptr_t *out_handle_p,
jerry_native_handle_info_t *out_native_handle_info_p);
void jerry_set_object_native_handle_ext (const jerry_value_t obj_val, uintptr_t handle_p,
const jerry_native_handle_info_t *native_handle_info_p);
// --- simple_example_my_binding.c
typedef struct {
int x;
bool y;
} MyBindingThing;
static void my_thing_free_cb(const uintptr_t native_p) {
// ...
}
JERRY_DEFINE_NATIVE_HANDLE_INFO(MyBindingThing, my_thing_free_cb);
static void my_thing_create(...) {
MyBindingThing *native_thing = malloc(sizeof(MyBindingThing));
// ...
jerry_value_t js_thing = jerry_create_object();
jerry_set_object_native_handle(js_thing, (uintptr_t)native_thing,
&JERRY_NATIVE_HANDLE_INFO_FOR_CTYPE(MyBindingThing));
}
static void get_native_thing(jerry_value_t js_thing) {
MyBindingThing *native_thing;
jerry_native_handle_info_t *info;
if (!jerry_get_object_native_handle_ext(js_thing, (uintptr_t)&native_thing, &info)) {
// No native handle found, handle this error case...
return;
}
// Note: type checking is not done inside jerry_get_object_native_handle_ext(),
// to cater to the use case where the native object is derived from MyBindingThing, so
// where the type value is potentially different, but casting the handle to
// MyBindingThing* is safe.
if (&JERRY_NATIVE_HANDLE_INFO_FOR_CTYPE(MyBindingThing) != info) {
// handle is of unexpected type!
return;
}
// Safe to use native_thing now!
// ...
}
// --- complex_example_shared_freecb_my_binding.c
typedef struct {
jerry_native_handle_info_t base_info;
bool is_foo_supported;
bool is_bar_supported;
} MyHandleInfo;
static void my_thing_free_cb(const uintptr_t native_p) {
// ...
}
static const MyHandleInfo my_handle_type_a = {
.base_info = { .free_cb = my_thing_free_cb },
.is_foo_supported = true,
.is_bar_supported = true,
};
static const MyHandleInfo my_handle_type_b = {
.base_info = { .free_cb = my_thing_free_cb },
.is_foo_supported = true,
.is_bar_supported = false,
};
static void my_thing_a_create(...) {
MyBindingThingA *native_thing = ...
// ...
jerry_value_t js_thing = jerry_create_object();
jerry_set_object_native_handle(js_thing, (uintptr_t)native_thing,
(jerry_native_handle_info_t *)&my_handle_type_a);
}
static void my_thing_b_create(...) {
MyBindingThingB *native_thing = ...
// ...
jerry_value_t js_thing = jerry_create_object();
jerry_set_object_native_handle(js_thing, (uintptr_t)native_thing,
(jerry_native_handle_info_t *)&my_handle_type_b);
}
static void do_bar_on_thing(jerry_value_t js_thing) {
void *native_thing;
MyHandleInfo *info;
if (!jerry_get_object_native_handle_ext(js_thing, (uintptr_t)&native_thing,
(jerry_native_handle_info_t *)&info)) {
// No native handle found, handle this error case...
return;
}
if (info != & my_handle_type_a && info != my_handle_type_b) {
// handle is of unexpected type!
return;
}
if (!info->is_bar_supported) {
return;
}
// Safe to do bar on native_thing now!
// ...
}
```
## Misc. Implementation thoughts
- Instead of adding yet another "external pointer" internal property to store the type, perhaps the handle, type and free callback pointer can be combined into a single struct to reduce the memory footprint. (What's the rationale behind the handle value and free callback being stored as separate internal properties in today's code?)
- A pointer and type can probably be compressed into a `uintptr_t` on small embedded systems, but the "compression" would be dependent on the memory layout of the target, may require some .ld script mangling, etc. So, not very convenient. If the additional memory footprint is an issue, a solution may be to let the proposed API call into `jerry_port_...` functions to compress/decompress the type and pointer into a `uintptr_t` (and provide an example / readme on how to implement them).
[native handle APIs]: https://github.com/jerryscript-project/jerryscript/blob/4420401cf5c7810a8c5c9404e6921d88d30c16ad/jerry-core/jerryscript.h#L326
[`AnalogIn` C++ class]: https://docs.mbed.com/docs/mbed-os-api-reference/en/5.1/APIs/io/AnalogIn/
[`AnalogIn` JavaScript constructor and method bindings]: https://github.com/jerryscript-project/jerryscript/blob/4420401cf5c7810a8c5c9404e6921d88d30c16ad/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-drivers/source/AnalogIn-js.cpp#L32 | [Proposal] Add `type` argument to native handle API | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1681/comments | 31 | 2017-03-23T09:39:11Z | 2017-04-11T00:45:43Z | https://github.com/jerryscript-project/jerryscript/issues/1681 | 216,364,463 | 1,681 |
[
"jerryscript-project",
"jerryscript"
] | As mentioned on the JerryScript mailing list: @jiangzidong and myself will be working on adding ES6 Promise to JerryScript. I'm opening this ticket just to track the fact that we are working on this.
@jiangzidong FYI:
> this is my dev branch: https://github.com/LaszloLango/jerryscript/tree/promise-dev
> It is not much, but might save some time for you.
>
> Regards,
> László | ES6 Promise | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1675/comments | 2 | 2017-03-22T08:22:06Z | 2019-01-02T10:00:30Z | https://github.com/jerryscript-project/jerryscript/issues/1675 | 215,985,357 | 1,675 |
[
"jerryscript-project",
"jerryscript"
] | Hi,
Jan did an excellent work on porting and maintaining JerryScript on the ARM Mbed OS so I would like to nominate him to become a committer for JerryScript and reviewer for the Mbed port.
His patches are:
#1531 target: mbedos5: Change to debug profiles
#1522 target: mbedos5: Support for building on Windows
#1518 target: mbedos5: Sort magic strings
#1512 target: mbedos5: mbed CLI refuses to build if no .mbed file present
#1494 target: mbedos5: Update generate_pins.py
#1485 target: mbedos5: Define JERRY_JS_PARSER macro
#1468 target: mbedos5: Update to mbed OS 5.2.3
#1458 target: mbedos5: Allow jerry_port_console and jerry_port_log to be overriden by user code
#1457 target: mbedos5: Add return value to setTimeout/setInterval and implement clearTimeout/clearInterval
#1455 target: mbedos5: Add PwmOut and AnalogIn interfaces
#1427 target: mbedos5: Add carriage return in jerry_port_console
Any seconds? | Nominating Jan Jongboom (@janjongboom) to become a JerryScript committer and mbed port reviewer | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1673/comments | 9 | 2017-03-22T07:34:01Z | 2017-03-28T13:41:36Z | https://github.com/jerryscript-project/jerryscript/issues/1673 | 215,976,728 | 1,673 |
[
"jerryscript-project",
"jerryscript"
] | ###### Jerry version:
```
Checked revision: 4420401
Build command: ./tools/build.py --clean --debug
```
###### OS:
```
Ubuntu 16.04.2 LTS
```
###### Test case:
```javascript
Array.prototype.splice(0, 0, 0, "")
Array.prototype.shift()
Array.prototype.push("", 0, 1)
Array.prototype.sort(JSON.parse)
```
###### Backtrace:
```
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):42.
Error: ERR_FAILED_INTERNAL_ASSERTION
bt
#0 0x000000000046e2f4 in syscall_2 () at jerryscript/jerry-libc/target/posix/jerry-asm.S:59
#1 0x0000000000402760 in raise (sig=6) at jerryscript/jerry-libc/target/posix/jerry-libc-target.c:91
#2 0x0000000000402732 in abort () at jerryscript/jerry-libc/target/posix/jerry-libc-target.c:77
#3 0x000000000041155d in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION)
at jerryscript/targets/default/jerry-port-default-fatal.c:53
#4 0x000000000042c330 in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:61
#5 0x000000000042c382 in jerry_assert_fail (assertion=0x471ae0 "ECMA_STRING_IS_REF_EQUALS_TO_ONE (string_p)",
file=0x471a80 "jerryscript/jerry-core/ecma/base/ecma-literal-storage.c",
function=0x488650 <__func__.3396.lto_priv.109> "ecma_free_string_list", line=42)
at jerryscript/jerry-core/jrt/jrt-fatals.c:85
#6 0x00000000004138d3 in ecma_free_string_list (string_list_p=0x692398 <jerry_global_heap+416>)
at jerryscript/jerry-core/ecma/base/ecma-literal-storage.c:42
#7 0x0000000000413954 in ecma_finalize_lit_storage () at jerryscript/jerry-core/ecma/base/ecma-literal-storage.c:59
#8 0x0000000000458283 in ecma_finalize () at jerryscript/jerry-core/ecma/base/ecma-init-finalize.c:62
#9 0x000000000046bb38 in jerry_cleanup () at jerryscript/jerry-core/jerry.c:177
#10 0x000000000046b9fb in main (argc=3, argv=0x7fffffffd388) at jerryscript/jerry-main/main-unix.c:829
```
<sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/)</sup>
| Assertion 'ECMA_STRING_IS_REF_EQUALS_TO_ONE (string_p)' failed in ecma_free_string_list | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1671/comments | 0 | 2017-03-21T16:08:38Z | 2017-07-13T08:54:16Z | https://github.com/jerryscript-project/jerryscript/issues/1671 | 215,793,312 | 1,671 |
[
"jerryscript-project",
"jerryscript"
] | ###### Jerry version:
```
Checked revision: 4420401
Build command: ./tools/build.py --clean --debug --profile=es2015-subset --compile-flag=-m32 --system-allocator=on --jerry-libc=off --error-messages=on
```
###### OS:
```
Ubuntu 16.04.2 LTS
```
###### Test case:
```javascript
Int16Array.from();
```
The same assertion check fails when calling the `of` method or using any other typed array variants (Int8Array, Uint8ClampedArray, Uint32Array, etc.).
###### Backtrace:
```
ICE: Assertion '!ecma_is_value_empty (ret_value)' failed at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.c(ecma_builtin_dispatch_call):883.
Error: ERR_FAILED_INTERNAL_ASSERTION
bt
#0 0xf7fd8be9 in __kernel_vsyscall ()
#1 0xf7898ea9 in raise () from /lib/i386-linux-gnu/libc.so.6
#2 0xf789a407 in abort () from /lib/i386-linux-gnu/libc.so.6
#3 0x0806add9 in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION)
at jerryscript/targets/default/jerry-port-default-fatal.c:53
#4 0x080a3f56 in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:61
#5 0x080a3f8e in jerry_assert_fail (assertion=0x8148160 "!ecma_is_value_empty (ret_value)",
file=0x8147f60 "jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.c",
function=0x8115c00 <__func__.5013.lto_priv.627> "ecma_builtin_dispatch_call", line=883)
at jerryscript/jerry-core/jrt/jrt-fatals.c:85
#6 0x080e532a in ecma_builtin_dispatch_call (obj_p=0xf6500a00, this_arg_value=4132440627, arguments_list_p=0xffffc04c, arguments_list_len=0)
at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.c:883
#7 0x080b1293 in ecma_op_function_call (func_obj_p=0xf6500a00, this_arg_value=4132440627, arguments_list_p=0xffffc04c, arguments_list_len=0)
at jerryscript/jerry-core/ecma/operations/ecma-function-object.c:461
#8 0x0807d0de in opfunc_call.lto_priv.237 (frame_ctx_p=0xffffc0b0) at jerryscript/jerry-core/vm/vm.c:411
#9 0x0806837a in vm_execute (frame_ctx_p=0xffffc0b0, arg_p=0x0, arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:2674
#10 0x080688ff in vm_run (bytecode_header_p=0xf6500ac0, this_binding_value=4132441011, lex_env_p=0xf61007f0, is_eval_code=false, arg_list_p=0x0,
arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:2753
#11 0x0807c787 in vm_run_global (bytecode_p=0xf6500ac0) at jerryscript/jerry-core/vm/vm.c:231
#12 0x0810de04 in jerry_run (func_val=4132440723) at jerryscript/jerry-core/jerry.c:387
#13 0x0810d1f3 in main (argc=3, argv=0xffffc5b4) at jerryscript/jerry-main/main-unix.c:731
```
<sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/)</sup>
| Assertion '!ecma_is_value_empty (ret_value)' failed in ecma_builtin_dispatch_call | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1670/comments | 2 | 2017-03-21T16:04:34Z | 2019-01-02T10:00:30Z | https://github.com/jerryscript-project/jerryscript/issues/1670 | 215,791,865 | 1,670 |
[
"jerryscript-project",
"jerryscript"
] | The first thing that comes to mind thinking about `import` is probably to include another piece of .js source, but that's not the main reason why I'm interested in this feature:
I think having this ES6 feature would help a lot in creating an ecosystem of modules/API bindings for JerryScript. Having a standard way to define, register, instantiate (and destroy) a module (from C code), paves the way for reuse. It would make it much easier to take someone else's module and plug it into your project.
I’m still familiarizing myself with this part of the spec, but is there anything in ES6 import / System.import that would make it impossible to add this to JerryScript? | Discussion: ES6 import / System.import? | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1665/comments | 4 | 2017-03-17T12:18:44Z | 2018-09-06T11:01:15Z | https://github.com/jerryscript-project/jerryscript/issues/1665 | 214,987,719 | 1,665 |
[
"jerryscript-project",
"jerryscript"
] | After the PST -> PDT change some of the test262 tests are failed. The reason is the wrong daylight saving time. `ecma_date_daylight_saving_ta` in `ecma-builtin-helpers-date.c` is get the daylight saving adjustment from the system, but it gets it for the current date and not for the date we must set (e.g.: `new Date(1969, 12)`).
```
=== Summary ===
- Ran 11552 tests
- Passed 11546 tests (99.9%)
- Failed 6 tests (0.1%)
Failed tests
ch15/15.9/15.9.3/S15.9.3.1_A5_T1 in non-strict mode
ch15/15.9/15.9.3/S15.9.3.1_A5_T2 in non-strict mode
ch15/15.9/15.9.3/S15.9.3.1_A5_T3 in non-strict mode
ch15/15.9/15.9.3/S15.9.3.1_A5_T4 in non-strict mode
ch15/15.9/15.9.3/S15.9.3.1_A5_T5 in non-strict mode
ch15/15.9/15.9.3/S15.9.3.1_A5_T6 in non-strict mode
``` | Calculation of daylight saving time is wrong | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1661/comments | 6 | 2017-03-14T13:04:04Z | 2018-10-17T22:58:19Z | https://github.com/jerryscript-project/jerryscript/issues/1661 | 214,065,026 | 1,661 |
[
"jerryscript-project",
"jerryscript"
] | I would like to be able to use the debugger with code loaded from snapshots. Because of device limitations, it may not be possible to parse the source on the device itself. The current debugging approach assumes that the device itself is capable of parsing the JS source.
To support debugging of snapshots, I think we need:
1. The "offline" JerryScript parser should be able to serialize the collected debug info to a separate file, which I'll refer to as the "sourcemap" (would the commonly used [sourcemap] format work for this?)
2. The debugger should be able to load debug info "out of bounds" by deserializing the sourcemap file (this would also pave the way for on-the-fly attachment of the debugger, I think)
3. The "disabled breakpoint" instructions should be emitted into the snapshot too (not sure if this is the case already)
4. Optional: "tag" the snapshot data with the filename of the sourcemap matching the snapshot. This way, the debugger can attempt to find the sourcemap file automatically (similar to the [sourcemap comment] that browser's use).
[sourcemap]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit
[sourcemap comment]: https://developer.mozilla.org/en-US/docs/Tools/Debugger/How_to/Use_a_source_map
| Debugger support for snapshots | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1660/comments | 18 | 2017-03-14T11:50:37Z | 2017-04-21T09:08:20Z | https://github.com/jerryscript-project/jerryscript/issues/1660 | 214,048,061 | 1,660 |
[
"jerryscript-project",
"jerryscript"
] | ###### Jerry version:
```
Checked revision: b140158
Build: debug.linux
```
###### OS:
```
Ubuntu 16.04.2 LTS
```
###### Test case:
Running this test cases lasts unexpectedly long (killed after 2 minutes):
```javascript
new Date(-565224, 1)
```
###### Build command:
```
./tools/build.py --debug --clean
```
<sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/)</sup>
| Hang in Date constructor | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1657/comments | 1 | 2017-03-14T00:47:46Z | 2017-03-16T16:03:42Z | https://github.com/jerryscript-project/jerryscript/issues/1657 | 213,938,441 | 1,657 |
[
"jerryscript-project",
"jerryscript"
] | Compiling Jerryscript (+ RIOT) on my Linux VM, I get the below old-style-definition warnings (by default treated as errors, though they can be bypassed by tweaking the CFLAGS).
```
/home/vagrant/RIOT/examples/javascript/bin/pkg/iotlab-m3/jerryscript/jerry-core/jmem/jmem-allocator.c:40:1: warning: old-style function definition [-Wold-style-definition]
jmem_finalize ()
^
/home/vagrant/RIOT/examples/javascript/bin/pkg/iotlab-m3/jerryscript/jerry-core/jmem/jmem-poolman.c: In function 'jmem_pools_collect_empty':
/home/vagrant/RIOT/examples/javascript/bin/pkg/iotlab-m3/jerryscript/jerry-core/jmem/jmem-poolman.c:194:1: warning: old-style function definition [-Wold-style-definition]
jmem_pools_collect_empty ()
^
/home/vagrant/RIOT/examples/javascript/bin/pkg/iotlab-m3/jerryscript/jerry-core/parser/regexp/re-compiler.c: In function 're_cache_gc_run':
/home/vagrant/RIOT/examples/javascript/bin/pkg/iotlab-m3/jerryscript/jerry-core/parser/regexp/re-compiler.c:491:1: warning: old-style function definition [-Wold-style-definition]
re_cache_gc_run ()
^
/home/vagrant/RIOT/examples/javascript/bin/pkg/iotlab-m3/jerryscript/targets/default/jerry-port-default-date.c: In function 'jerry_port_get_current_time':
/home/vagrant/RIOT/examples/javascript/bin/pkg/iotlab-m3/jerryscript/targets/default/jerry-port-default-date.c:53:8: warning: old-style function definition [-Wold-style-definition]
double jerry_port_get_current_time ()
^
/home/vagrant/RIOT/examples/javascript/bin/pkg/iotlab-m3/jerryscript/targets/default/jerry-port-default-fatal.c: In function 'jerry_port_default_is_abort_on_fail':
/home/vagrant/RIOT/examples/javascript/bin/pkg/iotlab-m3/jerryscript/targets/default/jerry-port-default-fatal.c:39:6: warning: old-style function definition [-Wold-style-definition]
bool jerry_port_default_is_abort_on_fail ()
^
``` | old-style-definition warnings | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1649/comments | 2 | 2017-03-08T15:30:34Z | 2017-03-09T12:41:27Z | https://github.com/jerryscript-project/jerryscript/issues/1649 | 212,766,850 | 1,649 |
[
"jerryscript-project",
"jerryscript"
] | This issue was discovered and debugged by @MaureenHelm. She got a Zephyr.js build with a sample application, which is converted by Zephyr.js to bytecode snapshot, faulting on FRDM-K64F (ARM Cortex-M4). The same sample worked for me, so it took some time to debug. Maureen found that it boils down to these lines: https://github.com/jerryscript-project/jerryscript/blob/master/jerry-core/ecma/base/ecma-literal-storage.c#L481 . As can be seen, the input pointer is uint8_t*, but gets casted to uint32_t* and dereferenced. This is not safe conversion for many architectures, where unaligned access to words, etc. is not supported.
What's interested is that Cortex-M3/4 actually support unaligned access (but not Cortex-M0 for example), but it works only with single-word (or half-word) loads. And he we had a compiler optimizing 2 consecutive loads to multiple load instruction, which still doesn't support unaligned access:
~~~
uint32_t string_count = ((uint32_t *) buffer_p)[0];
uint32_t number_count = ((uint32_t *) buffer_p)[1];
6a1a: e890 0410 ldmia.w r0, {r4, sl}
~~~
So, the above code is definitely a bug in JerryScript, and there possibly more, so more code should be reviewed.
We'd appreciate a comment from the maintainers if there's already a way to resolve this (i.e. a function/macro to do byte-by-byte loads and then combination of individual bytes). We'd be looking into this over next days as time permits otherwise.
| JerryScript uses unaligned word access when dealing with bytecode | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1647/comments | 11 | 2017-03-07T10:37:22Z | 2017-03-17T07:49:44Z | https://github.com/jerryscript-project/jerryscript/issues/1647 | 212,392,783 | 1,647 |
[
"jerryscript-project",
"jerryscript"
] | ###### Jerry version:
```
Checked revision: f780f2b
Build: debug.linux
```
###### OS:
```
Ubuntu 16.04.2 LTS
```
###### Test case:
```javascript
new String(0).split(RegExp.prototype)
```
###### Build command:
```
./tools/build.py --debug --clean
```
###### Backtrace:
```
ICE: Assertion 'ecma_get_value_type_field (value) == ECMA_TYPE_STRING' failed at jerryscript/jerry-core/ecma/base/ecma-helpers-value.c(ecma_get_string_from_value):592.
Error: ERR_FAILED_INTERNAL_ASSERTION
Program received signal SIGABRT, Aborted.
0x000000000046e06f in syscall_2 () at jerryscript/jerry-libc/target/posix/jerry-asm.S:59
59 SYSCALL_2
(gdb) bt
#0 0x000000000046e06f in syscall_2 () at jerryscript/jerry-libc/target/posix/jerry-asm.S:59
#1 0x0000000000402760 in raise (sig=6) at jerryscript/jerry-libc/target/posix/jerry-libc-target.c:91
#2 0x0000000000402732 in abort () at jerryscript/jerry-libc/target/posix/jerry-libc-target.c:77
#3 0x00000000004113e9 in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION)
at jerryscript/targets/default/jerry-port-default-fatal.c:53
#4 0x000000000042c190 in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:61
#5 0x000000000042c1e2 in jerry_assert_fail (assertion=0x47fa70 "ecma_get_value_type_field (value) == ECMA_TYPE_STRING",
file=0x47f890 "jerryscript/jerry-core/ecma/base/ecma-helpers-value.c",
function=0x480c30 <__func__.3392.lto_priv.649> "ecma_get_string_from_value", line=592)
at jerryscript/jerry-core/jrt/jrt-fatals.c:85
#6 0x0000000000469655 in ecma_get_string_from_value (value=72)
at jerryscript/jerry-core/ecma/base/ecma-helpers-value.c:592
#7 0x00000000004420e8 in ecma_builtin_string_prototype_object_split.lto_priv.441 (this_arg=211, arg1=291, arg2=72)
at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-string-prototype.c:1790
#8 0x0000000000445156 in ecma_builtin_string_prototype_dispatch_routine (builtin_routine_id=46, this_arg_value=211, arguments_list=0x7fffffffccec,
arguments_number=1) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-string-prototype.inc.h:63
#9 0x000000000045a9ba in ecma_builtin_dispatch_routine (builtin_object_id=ECMA_BUILTIN_ID_STRING_PROTOTYPE, builtin_routine_id=46, this_arg_value=211,
arguments_list=0x7fffffffccec, arguments_number=1)
at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.inc.h:55
#10 0x000000000045ae0d in ecma_builtin_dispatch_call (obj_p=0x6922d8 <jerry_global_heap+224>, this_arg_value=211, arguments_list_p=0x7fffffffccec,
arguments_list_len=1) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.c:844
#11 0x0000000000437718 in ecma_op_function_call (func_obj_p=0x6922d8 <jerry_global_heap+224>, this_arg_value=211, arguments_list_p=0x7fffffffccec,
arguments_list_len=1) at jerryscript/jerry-core/ecma/operations/ecma-function-object.c:461
#12 0x000000000041dc0f in opfunc_call.lto_priv.138 (frame_ctx_p=0x7fffffffcd30) at jerryscript/jerry-core/vm/vm.c:385
#13 0x0000000000415680 in vm_execute (frame_ctx_p=0x7fffffffcd30, arg_p=0x0, arg_list_len=0)
at jerryscript/jerry-core/vm/vm.c:2651
#14 0x00000000004158f4 in vm_run (bytecode_header_p=0x6923b8 <jerry_global_heap+448>, this_binding_value=27, lex_env_p=0x692220 <jerry_global_heap+40>,
is_eval_code=false, arg_list_p=0x0, arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:2730
#15 0x000000000041d89d in vm_run_global (bytecode_p=0x6923b8 <jerry_global_heap+448>) at jerryscript/jerry-core/vm/vm.c:211
#16 0x000000000046bc21 in jerry_run (func_val=139) at jerryscript/jerry-core/jerry.c:385
#17 0x000000000046b516 in main (argc=3, argv=0x7fffffffd388) at jerryscript/jerry-main/main-unix.c:726
```
<sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/)</sup>
| Assertion 'ecma_get_value_type_field (value) == ECMA_TYPE_STRING' failed in ecma_get_string_from_value | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1641/comments | 0 | 2017-03-03T13:05:14Z | 2017-03-14T09:01:23Z | https://github.com/jerryscript-project/jerryscript/issues/1641 | 211,682,831 | 1,641 |
[
"jerryscript-project",
"jerryscript"
] | ###### Jerry version:
```
Checked revision: 92f74f3
Build: debug.linux
```
###### OS:
```
Ubuntu 16.04.2 LTS, x86_64
```
###### Test case:
```javascript
var seal = seal < 'e'
```
###### Build command:
```
./tools/build.py --debug --compile-flag=-fsanitize=address --compile-flag=-m32 --compile-flag=-fno-omit-frame-pointer --compile-flag=-fno-common --compile-flag=-g --jerry-libc=off --static-link=off --strip=off --system-allocator=on --linker-flag=-fuse-ld=gold
```
###### Backtrace:
```
=================================================================
==17728==ERROR: AddressSanitizer: heap-buffer-overflow on address 0xf4d00739 at pc 0x080f052d bp 0xffdd0158 sp 0xffdd0148
READ of size 1 at 0xf4d00739 thread T0
#0 0x80f052c in ecma_utf8_string_to_number jerryscript/jerry-core/ecma/base/ecma-helpers-conversion.c:548
#1 0x80ec774 in ecma_string_to_number jerryscript/jerry-core/ecma/base/ecma-helpers-string.c:827
#2 0x80ae23d in ecma_op_to_number jerryscript/jerry-core/ecma/operations/ecma-conversion.c:257
#3 0x80b0639 in ecma_op_abstract_relational_compare jerryscript/jerry-core/ecma/operations/ecma-comparison.c:308
#4 0x80526ac in opfunc_less_than jerryscript/jerry-core/vm/opcodes-ecma-relational.c:46
#5 0x8076516 in vm_loop.lto_priv.194 jerryscript/jerry-core/vm/vm.c:1950
#6 0x806f22c in vm_execute jerryscript/jerry-core/vm/vm.c:2642
#7 0x806f80e in vm_run jerryscript/jerry-core/vm/vm.c:2730
#8 0x807f6b2 in vm_run_global jerryscript/jerry-core/vm/vm.c:211
#9 0x810192d in jerry_run jerryscript/jerry-core/jerry.c:385
#10 0x8108d3f in main jerryscript/jerry-main/main-unix.c:726
#11 0xf700c636 in __libc_start_main (/lib/i386-linux-gnu/libc.so.6+0x18636)
#12 0x8048e50 (jerryscript/build/bin/jerry+0x8048e50)
0xf4d00739 is located 0 bytes to the right of 9-byte region [0xf4d00730,0xf4d00739)
allocated by thread T0 here:
#0 0xf725ddee in malloc (/usr/lib32/libasan.so.2+0x96dee)
#1 0x80a2e2d in jmem_heap_alloc_block_internal jerryscript/jerry-core/jmem/jmem-heap.c:324
#2 0x80a2ee7 in jmem_heap_gc_and_alloc_block jerryscript/jerry-core/jmem/jmem-heap.c:360
#3 0x80a2fac in jmem_heap_alloc_block jerryscript/jerry-core/jmem/jmem-heap.c:406
#4 0x80e9bc9 in ecma_new_ecma_string_from_utf8 jerryscript/jerry-core/ecma/base/ecma-helpers-string.c:190
#5 0x806cd0a in ecma_find_or_create_literal_string jerryscript/jerry-core/ecma/base/ecma-literal-storage.c:72
#6 0x809e87b in parser_post_processing jerryscript/jerry-core/parser/js/js-parser.c:1742
#7 0x809f4a2 in parser_parse_source.lto_priv.252 jerryscript/jerry-core/parser/js/js-parser.c:1927
#8 0x808abad in parser_parse_script jerryscript/jerry-core/parser/js/js-parser.c:2382
#9 0x8109678 in jerry_parse jerryscript/jerry-core/jerry.c:278
#10 0x81017af in jerry_parse_named_resource jerryscript/jerry-core/jerry.c:341
#11 0x8108cf6 in main jerryscript/jerry-main/main-unix.c:717
#12 0xf700c636 in __libc_start_main (/lib/i386-linux-gnu/libc.so.6+0x18636)
SUMMARY: AddressSanitizer: heap-buffer-overflow jerryscript/jerry-core/ecma/base/ecma-helpers-conversion.c:548 ecma_utf8_string_to_number
Shadow bytes around the buggy address:
0x3e9a0090: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x3e9a00a0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x3e9a00b0: fa fa fa fa fa fa 00 fa fa fa 00 fa fa fa 00 fa
0x3e9a00c0: fa fa 00 00 fa fa 00 fa fa fa 00 fa fa fa 00 fa
0x3e9a00d0: fa fa 00 00 fa fa 00 fa fa fa 00 fa fa fa 00 00
=>0x3e9a00e0: fa fa 00 fa fa fa 00[01]fa fa 00 fa fa fa 00 00
0x3e9a00f0: fa fa 00 fa fa fa 00 06 fa fa fd fa fa fa 00 00
0x3e9a0100: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x3e9a0110: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x3e9a0120: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x3e9a0130: 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
Heap right redzone: fb
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack partial redzone: f4
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
==17728==ABORTING
```
<sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/)</sup>
| heap-buffer-overflow in ecma_utf8_string_to_number | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1636/comments | 0 | 2017-03-02T11:58:17Z | 2017-03-09T14:03:46Z | https://github.com/jerryscript-project/jerryscript/issues/1636 | 211,370,579 | 1,636 |
[
"jerryscript-project",
"jerryscript"
] | I happen to run my JS code with jerry engine.
There are issues with the code (my bad), but all I get in the end is:
uncaughtException: ReferenceError: Cannot resolve reference.
That's it.
How do I get some information regarding error location?
File and line would be the bare minimum.
Column and identifier would help even more.
Getting some context would be extremely helpful, as I am likely to immediately see what is wrong. | Runtime error messages contain no source information | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1635/comments | 4 | 2017-03-02T11:32:30Z | 2017-03-31T06:36:58Z | https://github.com/jerryscript-project/jerryscript/issues/1635 | 211,364,849 | 1,635 |
[
"jerryscript-project",
"jerryscript"
] | ###### Jerry version:
```
Checked revision: 92f74f3
Build: debug.linux
```
###### OS:
```
Ubuntu 16.04.2 LTS, x86_64
```
###### Test case:
```javascript
65535.9.toString(3)
```
###### 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 --jerry-libc=off --static-link=off --strip=off --system-allocator=on --linker-flag=-fuse-ld=gold
```
###### Backtrace:
```
==21706==ERROR: AddressSanitizer: heap-buffer-overflow on address 0xf4501739 at pc 0xf7220fc8 bp 0xffcbeda8 sp 0xffcbe97c
READ of size 53 at 0xf4501739 thread T0
#0 0xf7220fc7 in __asan_memmove (/usr/lib32/libasan.so.2+0x8afc7)
#1 0xf72213df in __interceptor_memmove (/usr/lib32/libasan.so.2+0x8b3df)
#2 0x80a2b3a in memmove /usr/include/bits/string3.h:59
#3 0x80a2b3a in ecma_builtin_number_prototype_object_to_string.lto_priv.74 jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-number-prototype.c:396
#4 0x806aadb in ecma_builtin_number_prototype_object_to_locale_string jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-number-prototype.c:432
#5 0x806aadb in ecma_builtin_number_prototype_dispatch_routine jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-number-prototype.inc.h:39
#6 0x8056cd6 in ecma_builtin_dispatch_routine jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.inc.h:91
#7 0x8056cd6 in ecma_builtin_dispatch_call jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.c:844
#8 0x8070325 in ecma_op_function_call jerryscript/jerry-core/ecma/operations/ecma-function-object.c:461
#9 0x809124d in opfunc_call jerryscript/jerry-core/vm/vm.c:385
#10 0x809124d in vm_execute.constprop.17 jerryscript/jerry-core/vm/vm.c:2651
#11 0x809eb14 in vm_run jerryscript/jerry-core/vm/vm.c:2730
#12 0x804a63e in vm_run_global jerryscript/jerry-core/vm/vm.c:211
#13 0x804a63e in jerry_run jerryscript/jerry-core/jerry.c:385
#14 0x804a63e in main jerryscript/jerry-main/main-unix.c:726
#15 0xf6fdb636 in __libc_start_main (/lib/i386-linux-gnu/libc.so.6+0x18636)
#16 0x804af26 (jerryscript/build/bin/jerry+0x804af26)
0xf4501739 is located 0 bytes to the right of 57-byte region [0xf4501700,0xf4501739)
allocated by thread T0 here:
#0 0xf722cdee in malloc (/usr/lib32/libasan.so.2+0x96dee)
#1 0x807b50c in jmem_heap_alloc_block_internal jerryscript/jerry-core/jmem/jmem-heap.c:324
#2 0x807b50c in jmem_heap_gc_and_alloc_block.lto_priv.40 jerryscript/jerry-core/jmem/jmem-heap.c:360
#3 0x80a2625 in jmem_heap_alloc_block jerryscript/jerry-core/jmem/jmem-heap.c:406
#4 0x80a2625 in ecma_builtin_number_prototype_object_to_string.lto_priv.74 jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-number-prototype.c:298
#5 0x806aadb in ecma_builtin_number_prototype_object_to_locale_string jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-number-prototype.c:432
#6 0x806aadb in ecma_builtin_number_prototype_dispatch_routine jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-number-prototype.inc.h:39
#7 0x8056cd6 in ecma_builtin_dispatch_routine jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.inc.h:91
#8 0x8056cd6 in ecma_builtin_dispatch_call jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.c:844
#9 0x8070325 in ecma_op_function_call jerryscript/jerry-core/ecma/operations/ecma-function-object.c:461
#10 0x809124d in opfunc_call jerryscript/jerry-core/vm/vm.c:385
#11 0x809124d in vm_execute.constprop.17 jerryscript/jerry-core/vm/vm.c:2651
#12 0x809eb14 in vm_run jerryscript/jerry-core/vm/vm.c:2730
#13 0x804a63e in vm_run_global jerryscript/jerry-core/vm/vm.c:211
#14 0x804a63e in jerry_run jerryscript/jerry-core/jerry.c:385
#15 0x804a63e in main jerryscript/jerry-main/main-unix.c:726
#16 0xf6fdb636 in __libc_start_main (/lib/i386-linux-gnu/libc.so.6+0x18636)
SUMMARY: AddressSanitizer: heap-buffer-overflow ??:0 __asan_memmove
Shadow bytes around the buggy address:
0x3e8a0290: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x3e8a02a0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x3e8a02b0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x3e8a02c0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x3e8a02d0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
=>0x3e8a02e0: 00 00 00 00 00 00 00[01]fa fa fa fa fd fd fd fd
0x3e8a02f0: fd fd fd fd fa fa fa fa fd fd fd fd fd fd fd fd
0x3e8a0300: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x3e8a0310: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x3e8a0320: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x3e8a0330: 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
Heap right redzone: fb
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack partial redzone: f4
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
==21706==ABORTING
```
Using a regular debug build (with `./tools/build.py --clean --debug` build command) we end up in an assertion failure:
```
ICE: Assertion 'next_offset == JMEM_HEAP_END_OF_LIST || jmem_is_heap_pointer (JMEM_HEAP_GET_ADDR_FROM_OFFSET (next_offset))' failed at jerryscript/jerry-core/jmem/jmem-heap.c(jmem_heap_alloc_block_internal):259.
Error: ERR_FAILED_INTERNAL_ASSERTION
Program received signal SIGABRT, Aborted.
0x000000000046e07c in syscall_2 () at jerryscript/jerry-libc/target/posix/jerry-asm.S:59
59 SYSCALL_2
(gdb) bt
#0 0x000000000046e07c in syscall_2 () at jerryscript/jerry-libc/target/posix/jerry-asm.S:59
#1 0x0000000000402760 in raise (sig=6) at jerryscript/jerry-libc/target/posix/jerry-libc-target.c:91
#2 0x0000000000402732 in abort () at jerryscript/jerry-libc/target/posix/jerry-libc-target.c:77
#3 0x00000000004113e9 in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION)
at jerryscript/targets/default/jerry-port-default-fatal.c:53
#4 0x000000000042c190 in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:61
#5 0x000000000042c1e2 in jerry_assert_fail (
assertion=0x475898 "next_offset == JMEM_HEAP_END_OF_LIST || jmem_is_heap_pointer (JMEM_HEAP_GET_ADDR_FROM_OFFSET (next_offset))",
file=0x475760 "jerryscript/jerry-core/jmem/jmem-heap.c",
function=0x484fa0 <__func__.3006.lto_priv.279> "jmem_heap_alloc_block_internal", line=259)
at jerryscript/jerry-core/jrt/jrt-fatals.c:85
#6 0x000000000042b791 in jmem_heap_alloc_block_internal (size=62) at jerryscript/jerry-core/jmem/jmem-heap.c:258
#7 0x000000000042b914 in jmem_heap_gc_and_alloc_block (size=62, ret_null_on_error=false)
at jerryscript/jerry-core/jmem/jmem-heap.c:360
#8 0x000000000042b9d5 in jmem_heap_alloc_block (size=62) at jerryscript/jerry-core/jmem/jmem-heap.c:406
#9 0x000000000045f21d in ecma_new_ecma_string_from_utf8 (string_p=0x692310 <jerry_global_heap+280> "10022220020.220022002200220022002210211012200000110221",
string_size=54) at jerryscript/jerry-core/ecma/base/ecma-helpers-string.c:190
#10 0x000000000043fd4a in ecma_builtin_number_prototype_object_to_string.lto_priv.367 (this_arg=153, arguments_list_p=0x7fffffffcb4c, arguments_list_len=1)
at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-number-prototype.c:410
#11 0x000000000043f05f in ecma_builtin_number_prototype_dispatch_routine (builtin_routine_id=34, this_arg_value=153, arguments_list=0x7fffffffcb4c,
arguments_number=1) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-number-prototype.inc.h:37
#12 0x000000000045aa2f in ecma_builtin_dispatch_routine (builtin_object_id=ECMA_BUILTIN_ID_NUMBER_PROTOTYPE, builtin_routine_id=34, this_arg_value=153,
arguments_list=0x7fffffffcb4c, arguments_number=1) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.inc.h:91
#13 0x000000000045ae1a in ecma_builtin_dispatch_call (obj_p=0x6922c8 <jerry_global_heap+208>, this_arg_value=153, arguments_list_p=0x7fffffffcb4c,
arguments_list_len=1) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.c:844
#14 0x000000000043771e in ecma_op_function_call (func_obj_p=0x6922c8 <jerry_global_heap+208>, this_arg_value=153, arguments_list_p=0x7fffffffcb4c,
arguments_list_len=1) at jerryscript/jerry-core/ecma/operations/ecma-function-object.c:461
#15 0x000000000041dc0f in opfunc_call.lto_priv.138 (frame_ctx_p=0x7fffffffcb90) at jerryscript/jerry-core/vm/vm.c:385
#16 0x0000000000415681 in vm_execute (frame_ctx_p=0x7fffffffcb90, arg_p=0x0, arg_list_len=0)
at jerryscript/jerry-core/vm/vm.c:2651
#17 0x00000000004158f5 in vm_run (bytecode_header_p=0x6923c8 <jerry_global_heap+464>, this_binding_value=27, lex_env_p=0x692220 <jerry_global_heap+40>,
is_eval_code=false, arg_list_p=0x0, arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:2730
#18 0x000000000041d89d in vm_run_global (bytecode_p=0x6923c8 <jerry_global_heap+464>) at jerryscript/jerry-core/vm/vm.c:211
#19 0x000000000046bc2e in jerry_run (func_val=139) at jerryscript/jerry-core/jerry.c:385
#20 0x000000000046b523 in main (argc=3, argv=0x7fffffffd1e8) at jerryscript/jerry-main/main-unix.c:726
```
<sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/)</sup>
| heap-buffer-overflow in ecma_builtin_number_prototype_object_to_string | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1634/comments | 1 | 2017-03-02T10:44:56Z | 2017-03-30T08:40:06Z | https://github.com/jerryscript-project/jerryscript/issues/1634 | 211,353,855 | 1,634 |
[
"jerryscript-project",
"jerryscript"
] | ###### Jerry version:
```
Checked revision: 92f74f3
Build: debug.linux
```
###### OS:
```
Ubuntu 16.04.2 LTS
```
###### Test case:
```javascript
delete new Uint16Array()[0]
```
###### Build command:
```
./tools/build.py --clean --debug --compile-flag=-m32 --system-allocator=on --jerry-libc=off
```
###### Backtrace:
```
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):1197.
Error: ERR_FAILED_INTERNAL_ASSERTION
bt
#0 0xf7ffdbe9 in __kernel_vsyscall ()
#1 0x080f65c7 in raise ()
#2 0x080ba557 in abort ()
#3 0x08059ae5 in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/targets/default/jerry-port-default-fatal.c:53
#4 0x0806fbd6 in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:61
#5 0x0806fc09 in jerry_assert_fail (assertion=0x81468f8 "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=0x814633c "jerryscript/jerry-core/ecma/base/ecma-helpers.c", function=0x812c584 <__func__.3897.lto_priv.138> "ecma_is_property_configurable", line=1197) at jerryscript/jerry-core/jrt/jrt-fatals.c:85
#6 0x080abe99 in ecma_is_property_configurable () at jerryscript/jerry-core/ecma/base/ecma-helpers.c:1195
#7 0x0806eb2d in ecma_op_general_object_delete (obj_p=0x8385938, property_name_p=0x8385978, is_throw=false) at jerryscript/jerry-core/ecma/operations/ecma-objects-general.c:164
#8 0x0807d76d in ecma_op_object_delete (obj_p=0x8385938, property_name_p=0x8385978, is_throw=false) at jerryscript/jerry-core/ecma/operations/ecma-objects.c:984
#9 0x080585de in vm_op_delete_prop (object=137910587, property=137910417, is_strict=false) at jerryscript/jerry-core/vm/opcodes.c:237
#10 0x0805c77b in vm_loop.lto_priv.239 (frame_ctx_p=0xffffc0c4) at jerryscript/jerry-core/vm/vm.c:1426
#11 0x08057d2c in vm_execute (frame_ctx_p=0xffffc0c4, arg_p=0x0, arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:2642
#12 0x08057f0e in vm_run (bytecode_header_p=0x83858c0, this_binding_value=137909819, lex_env_p=0x83856e8, is_eval_code=false, arg_list_p=0x0, arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:2730
#13 0x0806104a in vm_run_global (bytecode_p=0x83858c0) at jerryscript/jerry-core/vm/vm.c:211
#14 0x080b29af in jerry_run (func_val=137910171) at jerryscript/jerry-core/jerry.c:385
#15 0x080b232b in main (argc=3, argv=0xffffc514) at jerryscript/jerry-main/main-unix.c:726
```
<sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/)</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' failed in ecma_is_property_configurable | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1633/comments | 1 | 2017-03-02T10:09:34Z | 2017-03-07T00:32:51Z | https://github.com/jerryscript-project/jerryscript/issues/1633 | 211,344,879 | 1,633 |
[
"jerryscript-project",
"jerryscript"
] | Jerry version
```
checked version e993ee6c
```
OS
```
Ubuntu 14.04 64bit
```
build cmd
```
./tools/build.py --clean --debug --compile-flag=-m32 --system-allocator=on --jerry-libc=off
```
Test case
```
./build/bin/jerry tests/jerry/parser-oom.js
Script Error: assertion failed
```
If I remove the build flag: --system-allocator=on, then the case will pass | tests/jerry/parser-oom.js fail | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1630/comments | 8 | 2017-03-01T02:16:16Z | 2017-03-03T00:43:58Z | https://github.com/jerryscript-project/jerryscript/issues/1630 | 210,960,194 | 1,630 |
[
"jerryscript-project",
"jerryscript"
] | ###### Jerry version:
```
Checked revision: 3de72af
Build: debug.linux
```
###### OS:
```
Ubuntu 16.04.2 LTS
```
###### Test case:
```javascript
with (print) new function (a, a) {
var init;
init()
}
```
###### Backtrace:
The test fails on different assertion checks depeding on the way it was built. Furthermore, with removing the second argument of the function, it triggers a third failure.
Build command:
```
./tools/build.py --clean --debug --compile-flag=-m32 --system-allocator=on --jerry-libc=off
```
```
ICE: Assertion 'string_p != NULL' failed at jerryscript/jerry-core/ecma/base/ecma-helpers-string.c(ecma_deref_ecma_string):738.
Error: ERR_FAILED_INTERNAL_ASSERTION
bt
#0 0xf7ffdbe9 in __kernel_vsyscall ()
#1 0x080f2327 in raise ()
#2 0x080b9e67 in abort ()
#3 0x08057768 in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/targets/default/jerry-port-default-fatal.c:53
#4 0x080707a1 in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:61
#5 0x080707d4 in jerry_assert_fail (assertion=0x813fdcd "string_p != NULL", file=0x813f9e8 "jerryscript/jerry-core/ecma/base/ecma-helpers-string.c", function=0x81287c4 <__func__.3952.lto_priv.630> "ecma_deref_ecma_string", line=738) at jerryscript/jerry-core/jrt/jrt-fatals.c:85
#6 0x080a3ff0 in ecma_deref_ecma_string (string_p=0x0) at jerryscript/jerry-core/ecma/base/ecma-helpers-string.c:738
#7 0x080b022b in ecma_free_value (value=2) at jerryscript/jerry-core/ecma/base/ecma-helpers-value.c:878
#8 0x08062877 in opfunc_call.lto_priv.245 (frame_ctx_p=0xffffbf14) at jerryscript/jerry-core/vm/vm.c:402
#9 0x0805ae17 in vm_execute (frame_ctx_p=0xffffbf14, arg_p=0xffffc10c, arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:2651
#10 0x0805afd2 in vm_run (bytecode_header_p=0x837e970, this_binding_value=137881643, lex_env_p=0x837e798, is_eval_code=false, arg_list_p=0xffffc10c, arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:2730
#11 0x0807c53c in ecma_op_function_call (func_obj_p=0x837e7b0, this_arg_value=137881643, arguments_list_p=0xffffc10c, arguments_list_len=0) at jerryscript/jerry-core/ecma/operations/ecma-function-object.c:524
#12 0x0807c919 in ecma_op_function_construct_simple_or_external (func_obj_p=0x837e7b0, arguments_list_p=0xffffc10c, arguments_list_len=0) at jerryscript/jerry-core/ecma/operations/ecma-function-object.c:657
#13 0x0807cabc in ecma_op_function_construct (func_obj_p=0x837e7b0, arguments_list_p=0xffffc10c, arguments_list_len=0) at jerryscript/jerry-core/ecma/operations/ecma-function-object.c:718
#14 0x0806293f in opfunc_construct.lto_priv.244 (frame_ctx_p=0xffffc124) at jerryscript/jerry-core/vm/vm.c:443
#15 0x0805ae53 in vm_execute (frame_ctx_p=0xffffc124, arg_p=0x0, arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:2656
#16 0x0805afd2 in vm_run (bytecode_header_p=0x837e8a8, this_binding_value=137881147, lex_env_p=0x837e6e8, is_eval_code=false, arg_list_p=0x0, arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:2730
#17 0x080624a1 in vm_run_global (bytecode_p=0x837e8a8) at jerryscript/jerry-core/vm/vm.c:211
#18 0x080b23bc in jerry_run (func_val=137881811) at jerryscript/jerry-core/jerry.c:385
#19 0x080b1d44 in main (argc=3, argv=0xffffc574) at jerryscript/jerry-main/main-unix.c:726
```
Build command:
```
./tools/build.py --clean --debug
```
```
ICE: Assertion 'compressed_pointer != JMEM_CP_NULL' failed at jerryscript/jerry-core/jmem/jmem-allocator.c(jmem_decompress_pointer):96.
Error: ERR_FAILED_INTERNAL_ASSERTION
Program received signal SIGABRT, Aborted.
0x000000000046e067 in syscall_2 () at jerryscript/jerry-libc/target/posix/jerry-asm.S:59
59 SYSCALL_2
(gdb) bt
#0 0x000000000046e067 in syscall_2 () at jerryscript/jerry-libc/target/posix/jerry-asm.S:59
#1 0x0000000000402760 in raise (sig=6) at jerryscript/jerry-libc/target/posix/jerry-libc-target.c:91
#2 0x0000000000402732 in abort () at jerryscript/jerry-libc/target/posix/jerry-libc-target.c:77
#3 0x00000000004113e9 in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION)
at jerryscript/targets/default/jerry-port-default-fatal.c:53
#4 0x000000000042c185 in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:61
#5 0x000000000042c1d7 in jerry_assert_fail (assertion=0x475b88 "compressed_pointer != JMEM_CP_NULL",
file=0x475aa8 "jerryscript/jerry-core/jmem/jmem-allocator.c",
function=0x485050 <__func__.2999.lto_priv.272> "jmem_decompress_pointer", line=96)
at jerryscript/jerry-core/jrt/jrt-fatals.c:85
#6 0x000000000042bfd3 in jmem_decompress_pointer (compressed_pointer=0) at jerryscript/jerry-core/jmem/jmem-allocator.c:96
#7 0x00000000004631fc in ecma_get_pointer_from_ecma_value () at jerryscript/jerry-core/ecma/base/ecma-helpers-value.c:109
#8 ecma_get_string_from_value () at jerryscript/jerry-core/ecma/base/ecma-helpers-value.c:594
#9 ecma_free_value (value=2) at jerryscript/jerry-core/ecma/base/ecma-helpers-value.c:877
#10 0x000000000041dc73 in opfunc_call.lto_priv.138 (frame_ctx_p=0x7fffffffc9f0) at jerryscript/jerry-core/vm/vm.c:402
#11 0x0000000000415681 in vm_execute (frame_ctx_p=0x7fffffffc9f0, arg_p=0x7fffffffccfc, arg_list_len=0)
at jerryscript/jerry-core/vm/vm.c:2651
#12 0x00000000004158f5 in vm_run (bytecode_header_p=0x692470 <jerry_global_heap+632>, this_binding_value=211, lex_env_p=0x6922a0 <jerry_global_heap+168>,
is_eval_code=false, arg_list_p=0x7fffffffccfc, arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:2730
#13 0x00000000004378a5 in ecma_op_function_call (func_obj_p=0x6922a8 <jerry_global_heap+176>, this_arg_value=211, arguments_list_p=0x7fffffffccfc,
arguments_list_len=0) at jerryscript/jerry-core/ecma/operations/ecma-function-object.c:524
#14 0x0000000000437cc0 in ecma_op_function_construct_simple_or_external (func_obj_p=0x6922a8 <jerry_global_heap+176>, arguments_list_p=0x7fffffffccfc,
arguments_list_len=0) at jerryscript/jerry-core/ecma/operations/ecma-function-object.c:657
#15 0x0000000000437e51 in ecma_op_function_construct (func_obj_p=0x6922a8 <jerry_global_heap+176>, arguments_list_p=0x7fffffffccfc, arguments_list_len=0)
at jerryscript/jerry-core/ecma/operations/ecma-function-object.c:718
#16 0x000000000041dd47 in opfunc_construct.lto_priv.137 (frame_ctx_p=0x7fffffffcd30) at jerryscript/jerry-core/vm/vm.c:443
#17 0x00000000004156bd in vm_execute (frame_ctx_p=0x7fffffffcd30, arg_p=0x0, arg_list_len=0)
at jerryscript/jerry-core/vm/vm.c:2656
#18 0x00000000004158f5 in vm_run (bytecode_header_p=0x6923b8 <jerry_global_heap+448>, this_binding_value=27, lex_env_p=0x692220 <jerry_global_heap+40>,
is_eval_code=false, arg_list_p=0x0, arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:2730
#19 0x000000000041d89d in vm_run_global (bytecode_p=0x6923b8 <jerry_global_heap+448>) at jerryscript/jerry-core/vm/vm.c:211
#20 0x000000000046bc19 in jerry_run (func_val=139) at jerryscript/jerry-core/jerry.c:385
#21 0x000000000046b50e in main (argc=3, argv=0x7fffffffd388) at jerryscript/jerry-main/main-unix.c:726
````
Using the first build command but with a single function parameter:
```javascript
with (print) new function (a) {
var init;
init()
}
```
```
ICE: Assertion 'chunk_p != NULL' failed at jerryscript/jerry-core/jmem/jmem-poolman.c(jmem_pools_free):162.
Error: ERR_FAILED_INTERNAL_ASSERTION
Program received signal SIGABRT, Aborted.
0xf7ffdbe9 in __kernel_vsyscall ()
(gdb) bt
#0 0xf7ffdbe9 in __kernel_vsyscall ()
#1 0x080ecae7 in raise ()
#2 0x080b4627 in abort ()
#3 0x0805741f in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION)
at jerryscript/targets/default/jerry-port-default-fatal.c:53
#4 0x0806f6e3 in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:61
#5 0x0806f716 in jerry_assert_fail (assertion=0x8130d79 "chunk_p != NULL",
file=0x8130cb8 "jerryscript/jerry-core/jmem/jmem-poolman.c",
function=0x81265a8 <__func__.3729.lto_priv.321> "jmem_pools_free", line=162)
at jerryscript/jerry-core/jrt/jrt-fatals.c:85
#6 0x0806f405 in jmem_pools_free (chunk_p=0x0, size=8) at jerryscript/jerry-core/jmem/jmem-poolman.c:162
#7 0x080a88db in ecma_dealloc_number (number_p=0x0) at jerryscript/jerry-core/ecma/base/ecma-alloc.c:84
#8 0x080aad48 in ecma_free_value (value=1) at jerryscript/jerry-core/ecma/base/ecma-helpers-value.c:871
#9 0x08062419 in opfunc_call.lto_priv.193 (frame_ctx_p=0xffffbf44) at jerryscript/jerry-core/vm/vm.c:402
#10 0x0805aa16 in vm_execute (frame_ctx_p=0xffffbf44, arg_p=0xffffc13c, arg_list_len=0)
at jerryscript/jerry-core/vm/vm.c:2651
#11 0x0805abd1 in vm_run (bytecode_header_p=0x8375968, this_binding_value=137844763, lex_env_p=0x8375908, is_eval_code=false, arg_list_p=0xffffc13c,
arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:2730
#12 0x0807b235 in ecma_op_function_call (func_obj_p=0x8375790, this_arg_value=137844763, arguments_list_p=0xffffc13c, arguments_list_len=0)
at jerryscript/jerry-core/ecma/operations/ecma-function-object.c:524
#13 0x0807b612 in ecma_op_function_construct_simple_or_external.lto_priv.358 (func_obj_p=0x8375790, arguments_list_p=0xffffc13c, arguments_list_len=0)
at jerryscript/jerry-core/ecma/operations/ecma-function-object.c:657
#14 0x080745dc in ecma_op_function_construct (func_obj_p=0x8375790, arguments_list_p=0xffffc13c, arguments_list_len=0)
at jerryscript/jerry-core/ecma/operations/ecma-function-object.c:718
#15 0x080624e1 in opfunc_construct.lto_priv.192 (frame_ctx_p=0xffffc154) at jerryscript/jerry-core/vm/vm.c:443
#16 0x0805aa52 in vm_execute (frame_ctx_p=0xffffc154, arg_p=0x0, arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:2656
#17 0x0805abd1 in vm_run (bytecode_header_p=0x83758a0, this_binding_value=137844283, lex_env_p=0x8375658, is_eval_code=false, arg_list_p=0x0, arg_list_len=0)
at jerryscript/jerry-core/vm/vm.c:2730
#18 0x08062043 in vm_run_global (bytecode_p=0x83758a0) at jerryscript/jerry-core/vm/vm.c:211
#19 0x080ab4b3 in jerry_run (func_val=137844939) at jerryscript/jerry-core/jerry.c:385
#20 0x080aeeca in main (argc=3, argv=0xffffc5a4) at jerryscript/jerry-main/main-unix.c:726
```
<sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/)</sup>
| Assertion 'string_p != NULL' failed in ecma_deref_ecma_string | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1624/comments | 0 | 2017-02-27T12:44:04Z | 2017-03-03T11:23:19Z | https://github.com/jerryscript-project/jerryscript/issues/1624 | 210,473,487 | 1,624 |
[
"jerryscript-project",
"jerryscript"
] | ###### Jerry version:
```
Checked revision: 3de72af
Build: debug.linux
```
###### OS:
```
Ubuntu 16.04.2 LTS
```
###### Test case:
```javascript
for (var a in new Int8Array(123));
```
###### Build command:
```
./tools/build.py --clean --debug --compile-flag=-m32 --system-allocator=on --jerry-libc=off --profile=es2015-subset
```
###### Backtrace:
```
Program received signal SIGSEGV, Segmentation fault.
0x080809ac in ecma_op_object_get_own_property (object_p=0x837e970, property_name_p=0x83804a8, property_ref_p=0x0, options=0)
at jerryscript/jerry-core/ecma/operations/ecma-objects.c:156
156 property_ref_p->virtual_value = value;
bt
#0 0x080809ac in ecma_op_object_get_own_property (object_p=0x837e998, property_name_p=0x83804c0, property_ref_p=0x0, options=0) at jerryscript/jerry-core/ecma/operations/ecma-objects.c:156
#1 0x08080c95 in ecma_op_object_get_property (object_p=0x837e998, property_name_p=0x83804c0, property_ref_p=0x0, options=0) at jerryscript/jerry-core/ecma/operations/ecma-objects.c:305
#2 0x08079518 in ecma_op_object_has_property (object_p=0x837e998, property_name_p=0x83804c0) at jerryscript/jerry-core/ecma/operations/ecma-objects.c:355
#3 0x0805f525 in vm_loop.lto_priv.246 (frame_ctx_p=0xffffc084) at jerryscript/jerry-core/vm/vm.c:2172
#4 0x0805adf2 in vm_execute (frame_ctx_p=0xffffc084, arg_p=0x0, arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:2642
#5 0x0805afd4 in vm_run (bytecode_header_p=0x837e8a8, this_binding_value=137881147, lex_env_p=0x837e6e8, is_eval_code=false, arg_list_p=0x0, arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:2730
#6 0x080624a3 in vm_run_global (bytecode_p=0x837e8a8) at jerryscript/jerry-core/vm/vm.c:211
#7 0x080b23c8 in jerry_run (func_val=137881499) at jerryscript/jerry-core/jerry.c:385
#8 0x080b1d50 in main (argc=3, argv=0xffffc4d4) at jerryscript/jerry-main/main-unix.c:726
```
<sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/)</sup>
| Segmentation fault in ecma_op_object_get_own_property | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1622/comments | 1 | 2017-02-27T10:41:20Z | 2017-03-07T00:33:03Z | https://github.com/jerryscript-project/jerryscript/issues/1622 | 210,446,918 | 1,622 |
[
"jerryscript-project",
"jerryscript"
] | ###### Jerry version:
```
Checked revision: 3de72af
Build: debug.linux
```
###### OS:
```
Ubuntu 16.04.2 LTS
```
###### Test case:
```javascript
var eval = eval.bind()
eval(Math.cos())
```
###### Build command:
```
./tools/build.py --clean --debug --compile-flag=-m32 --system-allocator=on --jerry-libc=off
```
###### Backtrace:
```
ICE: Assertion 'ecma_op_is_callable (ecma_make_object_value (func_obj_p))' failed at jerryscript/jerry-core/ecma/operations/ecma-function-object.c(ecma_op_function_call):453.
Error: ERR_FAILED_INTERNAL_ASSERTION
bt
#0 0xf7ffdbe9 in __kernel_vsyscall ()
#1 0x080f2337 in raise ()
#2 0x080b9e77 in abort ()
#3 0x0805776a in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/targets/default/jerry-port-default-fatal.c:53
#4 0x080707a3 in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:61
#5 0x080707d6 in jerry_assert_fail (assertion=0x813a1b8 "ecma_op_is_callable (ecma_make_object_value (func_obj_p))", file=0x813a018 "jerryscript/jerry-core/ecma/operations/ecma-function-object.c", function=0x812c7dc <__func__.4225.lto_priv.421> "ecma_op_function_call", line=453) at jerryscript/jerry-core/jrt/jrt-fatals.c:85
#6 0x0807c3b0 in ecma_op_function_call (func_obj_p=0x837e938, this_arg_value=137882721, arguments_list_p=0xffffc058, arguments_list_len=1) at jerryscript/jerry-core/ecma/operations/ecma-function-object.c:453
#7 0x0807c74b in ecma_op_function_call (func_obj_p=0x837ec40, this_arg_value=72, arguments_list_p=0xffffc058, arguments_list_len=1) at jerryscript/jerry-core/ecma/operations/ecma-function-object.c:590
#8 0x0806280d in opfunc_call.lto_priv.245 (frame_ctx_p=0xffffc084) at jerryscript/jerry-core/vm/vm.c:385
#9 0x0805ae19 in vm_execute (frame_ctx_p=0xffffc084, arg_p=0x0, arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:2651
#10 0x0805afd4 in vm_run (bytecode_header_p=0x837ea80, this_binding_value=137881147, lex_env_p=0x837e6e8, is_eval_code=false, arg_list_p=0x0, arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:2730
#11 0x080624a3 in vm_run_global (bytecode_p=0x837ea80) at jerryscript/jerry-core/vm/vm.c:211
#12 0x080b23c8 in jerry_run (func_val=137881883) at jerryscript/jerry-core/jerry.c:385
#13 0x080b1d50 in main (argc=3, argv=0xffffc4d4) at jerryscript/jerry-main/main-unix.c:726
```
<sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/)</sup>
| Assertion 'ecma_op_is_callable (ecma_make_object_value (func_obj_p))' failed in ecma_op_function_call | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1621/comments | 0 | 2017-02-27T10:32:37Z | 2017-04-03T11:05:30Z | https://github.com/jerryscript-project/jerryscript/issues/1621 | 210,444,810 | 1,621 |
[
"jerryscript-project",
"jerryscript"
] | ###### Jerry version:
```
Checked revision: 62a581f
Build: debug.linux
```
###### OS:
```
Ubuntu 16.04.2 LTS
```
###### Test case:
```javascript
var a = new ArrayBuffer (0xfffffffe)
```
###### Build command:
```
tools/build.py --clean --debug --profile=es2015-subset --compile-flag=-m32 --system-allocator=on --jerry-libc=off
```
###### Backtrace:
```
Program received signal SIGSEGV, Segmentation fault.
0x080d6c8a in __memset_sse2_rep ()
(gdb) bt
#0 0x080d6c8a in __memset_sse2_rep ()
#1 0x08076159 in ecma_arraybuffer_new_object (length=4294967294) at jerryscript/jerry-core/ecma/operations/ecma-arraybuffer-object.c:99
#2 0x080760d4 in ecma_op_create_arraybuffer_object (arguments_list_p=0xffffc064, arguments_list_len=1) at jerryscript/jerry-core/ecma/operations/ecma-arraybuffer-object.c:71
#3 0x08059d51 in ecma_builtin_arraybuffer_dispatch_construct (arguments_list_p=0xffffc064, arguments_list_len=1) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-arraybuffer.c:94
#4 0x0809aea4 in ecma_builtin_dispatch_construct (obj_p=0x837e7b8, arguments_list_p=0xffffc064, arguments_list_len=1) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.inc.h:312
#5 0x0807c943 in ecma_op_function_construct (func_obj_p=0x837e7b8, arguments_list_p=0xffffc064, arguments_list_len=1) at jerryscript/jerry-core/ecma/operations/ecma-function-object.c:712
#6 0x08062909 in opfunc_construct.lto_priv.245 (frame_ctx_p=0xffffc084) at jerryscript/jerry-core/vm/vm.c:443
#7 0x0805ae1d in vm_execute (frame_ctx_p=0xffffc084, arg_p=0x0, arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:2656
#8 0x0805af9c in vm_run (bytecode_header_p=0x837e8d0, this_binding_value=137881147, lex_env_p=0x837e6e8, is_eval_code=false, arg_list_p=0x0, arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:2730
#9 0x0806246b in vm_run_global (bytecode_p=0x837e8d0) at jerryscript/jerry-core/vm/vm.c:211
#10 0x080b2263 in jerry_run (func_val=137881499) at jerryscript/jerry-core/jerry.c:385
#11 0x080b1beb in main (argc=3, argv=0xffffc4d4) at jerryscript/jerry-main/main-unix.c:726
```
<sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/)</sup>
| Segmentation fault in ecma_arraybuffer_new_object | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1616/comments | 1 | 2017-02-23T16:48:09Z | 2017-03-07T00:33:39Z | https://github.com/jerryscript-project/jerryscript/issues/1616 | 209,818,388 | 1,616 |
[
"jerryscript-project",
"jerryscript"
] | ###### Jerry version:
```
Checked revision: 62a581f
Build: debug.linux
```
###### OS:
```
Ubuntu 16.04.2 LTS
```
###### Test case:
```javascript
var a = a (a === a * a (0x10000) ) && eval == 0x10000()
```
###### Backtrace:
```
ICE: Assertion 'context_p->last_cbc.literal_type == LEXER_IDENT_LITERAL' failed at jerryscript/jerry-core/parser/js/js-parser-expr.c(parser_process_unary_expression):790.
Error: ERR_FAILED_INTERNAL_ASSERTION
timeout: the monitored command dumped core
bt
#0 0xf7ffdbe9 in __kernel_vsyscall ()
#1 0x080f21d7 in raise ()
#2 0x080b9d17 in abort ()
#3 0x08057732 in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/targets/default/jerry-port-default-fatal.c:53
#4 0x0807076b in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:61
#5 0x0807079e in jerry_assert_fail (assertion=0x8132344 "context_p->last_cbc.literal_type == LEXER_IDENT_LITERAL", file=0x8131dc8 "jerryscript/jerry-core/parser/js/js-parser-expr.c", function=0x8130720 <__func__.4201.lto_priv.168> "parser_process_unary_expression", line=790) at jerryscript/jerry-core/jrt/jrt-fatals.c:85
#6 0x08050fef in parser_process_unary_expression (context_p=0xffffbf48) at jerryscript/jerry-core/parser/js/js-parser-expr.c:790
#7 0x08052396 in parser_parse_expression (context_p=0xffffbf48, options=5) at jerryscript/jerry-core/parser/js/js-parser-expr.c:1367
#8 0x08062ac8 in parser_parse_var_statement (context_p=0xffffbf48) at jerryscript/jerry-core/parser/js/js-parser-statm.c:353
#9 0x080652a4 in parser_parse_statements (context_p=0xffffbf48) at jerryscript/jerry-core/parser/js/js-parser-statm.c:1777
#10 0x0806e468 in parser_parse_source.lto_priv.303 (source_p=0x817b040 <buffer.lto_priv> "\nvar eval = ", '\n' <repeats 14 times>, "eval ((eval + eval) === \n eval (eval(\n eval.writable ) === false) * Math.pow(0x10000, eval) ) && eval == 0x10000(eval, \neval.prop )\neval = 1 & 2;\n\neval(eval =="..., size=204, strict_mode=0, error_location_p=0xffffc0b4) at jerryscript/jerry-core/parser/js/js-parser.c:1913
#11 0x08066a2a in parser_parse_script (source_p=0x817b040 <buffer.lto_priv> "\nvar eval = ", '\n' <repeats 14 times>, "eval ((eval + eval) === \n eval (eval(\n eval.writable ) === false) * Math.pow(0x10000, eval) ) && eval == 0x10000(eval, \neval.prop )\neval = 1 & 2;\n\neval(eval =="..., size=204, is_strict=false, bytecode_data_p=0xffffc0f0) at jerryscript/jerry-core/parser/js/js-parser.c:2374
#12 0x080b20e9 in jerry_parse (source_p=0x817b040 <buffer.lto_priv> "\nvar eval = ", '\n' <repeats 14 times>, "eval ((eval + eval) === \n eval (eval(\n eval.writable ) === false) * Math.pow(0x10000, eval) ) && eval == 0x10000(eval, \neval.prop )\neval = 1 & 2;\n\neval(eval =="..., source_size=204, is_strict=false) at jerryscript/jerry-core/jerry.c:278
#13 0x080b2189 in jerry_parse_named_resource (name_p=0xffffc777 "/home/reni/data/.fuzzinator/jerry/test-23716-140063047237080.js", name_length=63, source_p=0x817b040 <buffer.lto_priv> "\nvar eval = ", '\n' <repeats 14 times>, "eval ((eval + eval) === \n eval (eval(\n eval.writable ) === false) * Math.pow(0x10000, eval) ) && eval == 0x10000(eval, \neval.prop )\neval = 1 & 2;\n\neval(eval =="..., source_size=204, is_strict=false) at jerryscript/jerry-core/jerry.c:341
#14 0x080b1bb4 in main (argc=3, argv=0xffffc4d4) at jerryscript/jerry-main/main-unix.c:717
```
<sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/)</sup>
| Assertion 'context_p->last_cbc.literal_type == LEXER_IDENT_LITERAL' failed in parser_process_unary_expression | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1615/comments | 0 | 2017-02-23T15:04:07Z | 2017-02-28T09:41:41Z | https://github.com/jerryscript-project/jerryscript/issues/1615 | 209,786,995 | 1,615 |
[
"jerryscript-project",
"jerryscript"
] | ###### Jerry version:
```
Checked revision: 62a581f
Build: debug.linux
```
###### OS:
```
Ubuntu 16.04.2 LTS
```
###### Test case:
```javascript
new Int16Array(Float32Array.prototype)
```
###### Build command:
```
tools/build.py --clean --debug --profile=es2015-subset --compile-flag=-m32 --system-allocator=on --jerry-libc=off
```
###### Backtrace:
```
ICE: Assertion 'ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_GLOBAL)' failed at jerryscript/jerry-core/ecma/operations/ecma-objects.c(ecma_object_get_class_name):1762.
Error: ERR_FAILED_INTERNAL_ASSERTION
bt
#0 0xf7ffdbe9 in __kernel_vsyscall ()
#1 0x080f21d7 in raise ()
#2 0x080b9d17 in abort ()
#3 0x08057732 in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/targets/default/jerry-port-default-fatal.c:53
#4 0x0807076b in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:61
#5 0x0807079e in jerry_assert_fail (assertion=0x8139e20 "ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_GLOBAL)", file=0x8139780 "jerryscript/jerry-core/ecma/operations/ecma-objects.c", function=0x812c5c4 <__func__.4429.lto_priv.425> "ecma_object_get_class_name", line=1762) at jerryscript/jerry-core/jrt/jrt-fatals.c:85
#6 0x0807b98d in ecma_object_get_class_name (obj_p=0x837e958) at jerryscript/jerry-core/ecma/operations/ecma-objects.c:1762
#7 0x08076237 in ecma_is_arraybuffer (target=137881947) at jerryscript/jerry-core/ecma/operations/ecma-arraybuffer-object.c:146
#8 0x080751f6 in ecma_op_create_typedarray (arguments_list_p=0xffffc064, arguments_list_len=1, proto_p=0x837e998, element_size_shift=1 '\001', class_id=LIT_MAGIC_STRING_INT16_ARRAY_UL) at jerryscript/jerry-core/ecma/operations/ecma-typedarray-object.c:594
#9 0x080804bc in ecma_builtin_int16array_dispatch_construct (arguments_list_p=0xffffc064, arguments_list_len=1) at jerryscript/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-int16array.c:69
#10 0x0809af08 in ecma_builtin_dispatch_construct (obj_p=0x837e7d8, arguments_list_p=0xffffc064, arguments_list_len=1) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.inc.h:373
#11 0x0807c943 in ecma_op_function_construct (func_obj_p=0x837e7d8, arguments_list_p=0xffffc064, arguments_list_len=1) at jerryscript/jerry-core/ecma/operations/ecma-function-object.c:712
#12 0x08062909 in opfunc_construct.lto_priv.245 (frame_ctx_p=0xffffc084) at jerryscript/jerry-core/vm/vm.c:443
#13 0x0805ae1d in vm_execute (frame_ctx_p=0xffffc084, arg_p=0x0, arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:2656
#14 0x0805af9c in vm_run (bytecode_header_p=0x837e8f0, this_binding_value=137881147, lex_env_p=0x837e6e8, is_eval_code=false, arg_list_p=0x0, arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:2730
#15 0x0806246b in vm_run_global (bytecode_p=0x837e8f0) at jerryscript/jerry-core/vm/vm.c:211
#16 0x080b2263 in jerry_run (func_val=137881499) at jerryscript/jerry-core/jerry.c:385
#17 0x080b1beb in main (argc=3, argv=0xffffc4d4) at jerryscript/jerry-main/main-unix.c:726
```
<sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/)</sup>
| Assertion 'ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_GLOBAL)' failed in ecma_object_get_class_name | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1613/comments | 2 | 2017-02-23T14:05:11Z | 2017-02-27T08:31:10Z | https://github.com/jerryscript-project/jerryscript/issues/1613 | 209,769,745 | 1,613 |
[
"jerryscript-project",
"jerryscript"
] | ###### Environment: ######
```
Ubuntu 16.04
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4)
Jerry: 92eaea2
```
###### Build command: ######
`tools/build.py --debug --profile=es2015-subset --compile-flag=-m32 --system-allocator=on --jerry-libc=off`
###### Test case: ######
```javascript
var a = new Int8Array();
```
###### Error: ######
```
Assertion 'ecma_get_value_type_field (value) == ECMA_TYPE_OBJECT' failed at jerryscript/jerry-core/ecma/base/ecma-helpers-value.c(ecma_get_object_from_value):605
```
###### Backtrace: ######
```
#0 0xf7ffdbe9 in __kernel_vsyscall ()
#1 0x080f2847 in raise ()
#2 0x080b9f87 in abort ()
#3 0x080649d2 in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION)
at jerryscript/targets/default/jerry-port-default-fatal.c:53
#4 0x0807a3d4 in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION)
at jerryscript/jerry-core/jrt/jrt-fatals.c:61
#5 0x0807a407 in jerry_assert_fail (assertion=0x8140030 "ecma_get_value_type_field (value) == ECMA_TYPE_OBJECT",
file=0x813fdec "jerryscript/jerry-core/ecma/base/ecma-helpers-value.c",
function=0x8129334 <__func__.3617.lto_priv.629> "ecma_get_object_from_value", line=609)
at jerryscript/jerry-core/jrt/jrt-fatals.c:85
#6 0x080a1703 in ecma_get_object_from_value (value=0)
at jerryscript/jerry-core/ecma/base/ecma-helpers-value.c:609
#7 0x08080d32 in ecma_typedarray_get_arraybuffer (typedarray_p=0x837fbb8)
at jerryscript/jerry-core/ecma/operations/ecma-typedarray-object.c:462
#8 0x080a702e in ecma_gc_mark.lto_priv.647 (object_p=0x837fbb8)
at jerryscript/jerry-core/ecma/base/ecma-gc.c:284
#9 0x080a0a49 in ecma_gc_run (severity=JMEM_FREE_UNUSED_MEMORY_SEVERITY_LOW)
at jerryscript/jerry-core/ecma/base/ecma-gc.c:654
#10 0x080a0c15 in ecma_free_unused_memory (severity=JMEM_FREE_UNUSED_MEMORY_SEVERITY_LOW)
at jerryscript/jerry-core/ecma/base/ecma-gc.c:742
#11 0x08079fe2 in jmem_run_free_unused_memory_callbacks (severity=JMEM_FREE_UNUSED_MEMORY_SEVERITY_LOW)
at jerryscript/jerry-core/jmem/jmem-allocator.c:148
#12 0x0807a269 in jmem_heap_gc_and_alloc_block (size=24, ret_null_on_error=false)
at jerryscript/jerry-core/jmem/jmem-heap.c:357
#13 0x0807a32c in jmem_heap_alloc_block (size=24) at jerryscript/jerry-core/jmem/jmem-heap.c:406
#14 0x0809cfac in ecma_alloc_extended_object (size=24) at jerryscript/jerry-core/ecma/base/ecma-alloc.c:99
#15 0x080ab27c in ecma_create_object (prototype_object_p=0x837fa10, ext_object_size=24, type=ECMA_OBJECT_TYPE_GENERAL)
at jerryscript/jerry-core/ecma/base/ecma-helpers.c:103
#16 0x0809dde1 in ecma_builtin_init_object (obj_builtin_id=ECMA_BUILTIN_ID_ARRAYBUFFER_PROTOTYPE, prototype_obj_p=0x837fa10,
obj_type=ECMA_OBJECT_TYPE_GENERAL, is_extensible=true)
at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.c:163
#17 0x0809f462 in ecma_instantiate_builtin (id=ECMA_BUILTIN_ID_ARRAYBUFFER_PROTOTYPE)
at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.inc.h:304
#18 0x0809dcab in ecma_builtin_get (builtin_id=ECMA_BUILTIN_ID_ARRAYBUFFER_PROTOTYPE)
at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.c:111
#19 0x08079be7 in ecma_arraybuffer_new_object (length=0)
at jerryscript/jerry-core/ecma/operations/ecma-arraybuffer-object.c:89
#20 0x08080533 in ecma_typedarray_create_object_with_length (array_length=0, proto_p=0x837fb98, element_size_shift=0 '\000',
class_id=LIT_MAGIC_STRING_INT8_ARRAY_UL)
at jerryscript/jerry-core/ecma/operations/ecma-typedarray-object.c:225
#21 0x08080eff in ecma_op_create_typedarray (arguments_list_p=0xffffc954, arguments_list_len=0, proto_p=0x837fb98,
element_size_shift=0 '\000', class_id=LIT_MAGIC_STRING_INT8_ARRAY_UL)
at jerryscript/jerry-core/ecma/operations/ecma-typedarray-object.c:555
#22 0x08082fca in ecma_builtin_int8array_dispatch_construct (arguments_list_p=0xffffc954, arguments_list_len=0)
at jerryscript/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-int8array.c:69
``` | Assertion 'ecma_get_value_type_field (value) == ECMA_TYPE_OBJECT' failed in ecma_get_object_from_value | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1605/comments | 2 | 2017-02-21T12:12:42Z | 2017-02-27T08:29:23Z | https://github.com/jerryscript-project/jerryscript/issues/1605 | 209,127,277 | 1,605 |
[
"jerryscript-project",
"jerryscript"
] | We should eliminate all of the python warnings reported by pylint tool. After that we can validate our tool scripts with pylint on travis CI to improve the review process of them. There too many warnings in the current scripts. so my plan is to do it in several PRs. | Cleanup Python warnings | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1600/comments | 0 | 2017-02-21T08:35:12Z | 2018-05-24T09:23:50Z | https://github.com/jerryscript-project/jerryscript/issues/1600 | 209,074,554 | 1,600 |
[
"jerryscript-project",
"jerryscript"
] | ###### Jerry version:
```
Checked revision: 33138c0
Build: debug.linux
```
###### OS:
```
Ubuntu 16.04.2 LTS
```
###### Test case:
```javascript
for (var a;;
function() {
with (a) {
break c
}
}
)
try {}
finally {
break
}
```
###### Backtrace:
```
Script Error: SyntaxError
ICE: Assertion 'JERRY_CONTEXT (jmem_heap_allocated_size) == 0' failed at jerryscript/jerry-core/jmem/jmem-heap.c(jmem_heap_finalize):182.
Error: ERR_FAILED_INTERNAL_ASSERTION
timeout: the monitored command dumped core
bt
#0 0x000000000046e2a4 in syscall_2 () at jerryscript/jerry-libc/target/posix/jerry-asm.S:59
#1 0x0000000000402760 in raise (sig=6) at jerryscript/jerry-libc/target/posix/jerry-libc-target.c:91
#2 0x0000000000402732 in abort () at jerryscript/jerry-libc/target/posix/jerry-libc-target.c:77
#3 0x0000000000411e06 in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/targets/default/jerry-port-default-fatal.c:53
#4 0x000000000042c122 in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:61
#5 0x000000000042c174 in jerry_assert_fail (assertion=0x475a50 "JERRY_CONTEXT (jmem_heap_allocated_size) == 0", file=0x4759c0 "jerryscript/jerry-core/jmem/jmem-heap.c", function=0x4854a0 <__func__.2999.lto_priv.281> "jmem_heap_finalize", line=182) at jerryscript/jerry-core/jrt/jrt-fatals.c:85
#6 0x000000000042b521 in jmem_heap_finalize () at jerryscript/jerry-core/jmem/jmem-heap.c:182
#7 0x000000000042be2e in jmem_finalize () at jerryscript/jerry-core/jmem/jmem-allocator.c:51
#8 0x000000000046baed in jerry_cleanup () at jerryscript/jerry-core/jerry.c:184
#9 0x000000000046b9ab in main (argc=3, argv=0x7fffffffd2e8) at jerryscript/jerry-main/main-unix.c:825
```
<sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/)</sup>
| Assertion 'JERRY_CONTEXT (jmem_heap_allocated_size) == 0' failed in jmem_heap_finalize | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1598/comments | 0 | 2017-02-20T16:03:58Z | 2017-02-22T13:38:33Z | https://github.com/jerryscript-project/jerryscript/issues/1598 | 208,920,921 | 1,598 |
[
"jerryscript-project",
"jerryscript"
] | ###### Jerry version:
```
Checked revision: 33138c0
Build: debug.linux
```
###### OS:
```
Ubuntu 16.04.2 LTS
```
###### Test case:
```javascript
try
{
a
} catch (a)
{
var v_1 = [a, 1, a, 1, 1, a, 1, a,
1, a, 1, a, 1, a, 1, 1, a, 1, a, 1, a, 1, a, 1,
a, 1, a, 1, a, 1, a, 1, 1, a, 1, 1, a, 1, a, 1,
a, 1, a, 1, a, 1, a, 1, a, 1, 1, a, 1, 1, a, 1,
1, a, 1, a, 1, a, 1, a, a, 1, a, 1, a, 1, a, 1,
a, 1, 1, a, 1, a, 1, a, 1, a, 1, 1, a, 1, a, 1,
1, a, 1, a, 1, 1, a, 1, a, 1, a, 1, a, 1, 1, a,
1, 1, a, 1, a, 1, a, 1, a, 1, a, 1, a, 1, 1, a]
a()
}
```
###### Backtrace:
```
ICE: Assertion 'byte_code_p[0] == CBC_EXT_OPCODE' failed at jerryscript/jerry-core/vm/vm-stack.c(vm_stack_find_finally):226.
Error: ERR_FAILED_INTERNAL_ASSERTION
timeout: the monitored command dumped core
bt
#0 0x000000000046e2a4 in syscall_2 () at jerryscript/jerry-libc/target/posix/jerry-asm.S:59
#1 0x0000000000402760 in raise (sig=6) at jerryscript/jerry-libc/target/posix/jerry-libc-target.c:91
#2 0x0000000000402732 in abort () at jerryscript/jerry-libc/target/posix/jerry-libc-target.c:77
#3 0x0000000000411e06 in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/targets/default/jerry-port-default-fatal.c:53
#4 0x000000000042c122 in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:61
#5 0x000000000042c174 in jerry_assert_fail (assertion=0x46ee28 "byte_code_p[0] == CBC_EXT_OPCODE", file=0x46ed58 "jerryscript/jerry-core/vm/vm-stack.c", function=0x4897d0 <__func__.3308.lto_priv.29> "vm_stack_find_finally", line=226) at jerryscript/jerry-core/jrt/jrt-fatals.c:85
#6 0x000000000040363d in vm_stack_find_finally (frame_ctx_p=0x7fffffffcc90, vm_stack_top_ref_p=0x7fffffffc7e0, finally_type=VM_CONTEXT_FINALLY_THROW, search_limit=4294967295) at jerryscript/jerry-core/vm/vm-stack.c:226
#7 0x000000000041b0bc in vm_loop.lto_priv.140 (frame_ctx_p=0x7fffffffcc90) at jerryscript/jerry-core/vm/vm.c:2524
#8 0x0000000000415ae1 in vm_execute (frame_ctx_p=0x7fffffffcc90, arg_p=0x0, arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:2638
#9 0x0000000000415d7c in vm_run (bytecode_header_p=0x6924f8 <jerry_global_heap+768>, this_binding_value=27, lex_env_p=0x692220 <jerry_global_heap+40>, is_eval_code=false, arg_list_p=0x0, arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:2726
#10 0x000000000041d885 in vm_run_global (bytecode_p=0x6924f8 <jerry_global_heap+768>) at jerryscript/jerry-core/vm/vm.c:211
#11 0x000000000046be56 in jerry_run (func_val=139) at jerryscript/jerry-core/jerry.c:385
#12 0x000000000046b74b in main (argc=3, argv=0x7fffffffd2e8) at jerryscript/jerry-main/main-unix.c:727
```
Removing the left-hand side of the variable declaration postpones the failure to the assert in the next line:
```javascript
try
{
a
} catch (a)
{
[a, 1, a, 1, 1, a, 1, a,
1, a, 1, a, 1, a, 1, 1, a, 1, a, 1, a, 1, a, 1,
a, 1, a, 1, a, 1, a, 1, 1, a, 1, 1, a, 1, a, 1,
a, 1, a, 1, a, 1, a, 1, a, 1, 1, a, 1, 1, a, 1,
1, a, 1, a, 1, a, 1, a, a, 1, a, 1, a, 1, a, 1,
a, 1, 1, a, 1, a, 1, a, 1, a, 1, 1, a, 1, a, 1,
1, a, 1, a, 1, 1, a, 1, a, 1, a, 1, a, 1, 1, a,
1, 1, a, 1, a, 1, a, 1, a, 1, a, 1, a, 1, 1, a]
a()
}
```
###### Backtrace:
```
ICE: Assertion 'byte_code_p[1] >= CBC_EXT_FINALLY && byte_code_p[1] <= CBC_EXT_FINALLY_3' failed at jerryscript/jerry-core/vm/vm-stack.c(vm_stack_find_finally):228.
Error: ERR_FAILED_INTERNAL_ASSERTION
Program received signal SIGABRT, Aborted.
0x000000000046e2a4 in syscall_2 () at jerryscript/jerry-libc/target/posix/jerry-asm.S:59
59 SYSCALL_2
(gdb) bt
#0 0x000000000046e2a4 in syscall_2 () at jerryscript/jerry-libc/target/posix/jerry-asm.S:59
#1 0x0000000000402760 in raise (sig=6) at jerryscript/jerry-libc/target/posix/jerry-libc-target.c:91
#2 0x0000000000402732 in abort () at jerryscript/jerry-libc/target/posix/jerry-libc-target.c:77
#3 0x0000000000411e06 in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION)
at jerryscript/targets/default/jerry-port-default-fatal.c:53
#4 0x000000000042c122 in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:61
#5 0x000000000042c174 in jerry_assert_fail (assertion=0x46ee50 "byte_code_p[1] >= CBC_EXT_FINALLY && byte_code_p[1] <= CBC_EXT_FINALLY_3",
file=0x46ed58 "jerryscript/jerry-core/vm/vm-stack.c",
function=0x4897d0 <__func__.3308.lto_priv.29> "vm_stack_find_finally", line=228)
at jerryscript/jerry-core/jrt/jrt-fatals.c:85
#6 0x0000000000403686 in vm_stack_find_finally (frame_ctx_p=0x7fffffffccc0, vm_stack_top_ref_p=0x7fffffffc810, finally_type=VM_CONTEXT_FINALLY_THROW,
search_limit=4294967295) at jerryscript/jerry-core/vm/vm-stack.c:227
#7 0x000000000041b0bc in vm_loop.lto_priv.140 (frame_ctx_p=0x7fffffffccc0) at jerryscript/jerry-core/vm/vm.c:2524
#8 0x0000000000415ae1 in vm_execute (frame_ctx_p=0x7fffffffccc0, arg_p=0x0, arg_list_len=0)
at jerryscript/jerry-core/vm/vm.c:2638
#9 0x0000000000415d7c in vm_run (bytecode_header_p=0x6924f8 <jerry_global_heap+768>, this_binding_value=27, lex_env_p=0x692220 <jerry_global_heap+40>,
is_eval_code=false, arg_list_p=0x0, arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:2726
#10 0x000000000041d885 in vm_run_global (bytecode_p=0x6924f8 <jerry_global_heap+768>) at jerryscript/jerry-core/vm/vm.c:211
#11 0x000000000046be56 in jerry_run (func_val=139) at jerryscript/jerry-core/jerry.c:385
#12 0x000000000046b74b in main (argc=3, argv=0x7fffffffd318) at jerryscript/jerry-main/main-unix.c:727
```
<sup>Found by [Fuzzinator](http://fuzzinator.readthedocs.io/)</sup> | Assertion 'byte_code_p[0] == CBC_EXT_OPCODE' failed in vm_stack_find_finally | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1597/comments | 0 | 2017-02-20T15:54:25Z | 2017-02-22T13:38:53Z | https://github.com/jerryscript-project/jerryscript/issues/1597 | 208,918,406 | 1,597 |
[
"jerryscript-project",
"jerryscript"
] | I need to use the ENABLE_ALL_IN_ONE feature to integrate jerryscript to my project. But after I updated the jerryscript, it crashed. I tried the basic example. It still cannot work. So please validate it and fix it. Thanks. | ENABLE_ALL_IN_ONE feature bug | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1595/comments | 4 | 2017-02-20T05:55:48Z | 2017-02-21T08:27:16Z | https://github.com/jerryscript-project/jerryscript/issues/1595 | 208,790,094 | 1,595 |
[
"jerryscript-project",
"jerryscript"
] | I want to build jerryscript for ESP32(http://esp32.net/), but I found no solution or tips. Is there any plan to support for ESP32? | Is there any plan to support for ESP32? | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1564/comments | 7 | 2017-02-06T12:29:31Z | 2017-07-27T07:57:18Z | https://github.com/jerryscript-project/jerryscript/issues/1564 | 205,569,178 | 1,564 |
[
"jerryscript-project",
"jerryscript"
] | Hi
I am working on the typedarray prototype methods, such as `every` `filter` `forEach` `map` `some` `indexOf` `lastIndexOf` `reduce` `reduceRight` ....
Should I sumbit a whole big patch or classify those methods into several patches?
Thanks
Zidong | [Question about PR] typedarray prototype methods: one big patch or several small ones | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1562/comments | 3 | 2017-02-06T08:37:34Z | 2017-02-07T00:28:27Z | https://github.com/jerryscript-project/jerryscript/issues/1562 | 205,517,858 | 1,562 |
[
"jerryscript-project",
"jerryscript"
] | ###### Jerry version:
```
Checked revision: 77ab2c7
Build: debug.linux
```
###### OS:
```
Ubuntu 16.04, x86_64
```
###### Test case:
```javascript
var f = "function inner(a) {"
buildTree(53).traverse (function(node) {
f += "var t" + node.number + " = 1;"
})
f += "}"
var $ = eval(f)
function buildTree(depth, branches, numberContainer) {
function TreeNode(number) {
this.number = number
}
TreeNode.prototype .traverse = function (visit) {
visit(this)
if(this.left)
this.left .traverse (visit)
if(this.right)
this.right .traverse (visit)
}
if(!numberContainer)
numberContainer = [0]
var node = new TreeNode(numberContainer[$] ++)
if(--depth !== $) {
var branch = branches !== 0
if(branch)
$ >>= $
node.left = buildTree(depth, branches, numberContainer)
if(branch)
node.right = buildTree(depth, $, numberContainer)
}
return node
}
```
###### Backtrace:
```
ICE: Assertion 'register_count < PARSER_MAXIMUM_NUMBER_OF_REGISTERS' failed at jerryscript/jerry-core/parser/js/js-parser.c(parser_compute_indicies):293.
Error: ERR_FAILED_INTERNAL_ASSERTION
Aborted
bt
#0 0x000000000046daba in syscall_2 () at jerryscript/jerry-libc/target/posix/jerry-asm.S:59
#1 0x0000000000402760 in raise (sig=6) at jerryscript/jerry-libc/target/posix/jerry-libc-target.c:91
#2 0x0000000000402732 in abort () at jerryscript/jerry-libc/target/posix/jerry-libc-target.c:77
#3 0x00000000004113c6 in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/targets/default/jerry-port-default-fatal.c:53
#4 0x000000000042ce6f in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:61
#5 0x000000000042cec1 in jerry_assert_fail (assertion=0x474a78 "register_count < PARSER_MAXIMUM_NUMBER_OF_REGISTERS", file=0x4748d8 "jerryscript/jerry-core/parser/js/js-parser.c", function=0x486650 <__func__.4066.lto_priv.210> "parser_compute_indicies", line=293) at jerryscript/jerry-core/jrt/jrt-fatals.c:85
#6 0x000000000042854b in parser_compute_indicies (context_p=0x7fffffffc4e0, ident_end=0x7fffffffbe8c, uninitialized_var_end=0x7fffffffbe8a, initialized_var_end=0x7fffffffbe88, const_literal_end=0x7fffffffbe86) at jerryscript/jerry-core/parser/js/js-parser.c:293
#7 0x00000000004294d2 in parser_post_processing (context_p=0x7fffffffc4e0) at jerryscript/jerry-core/parser/js/js-parser.c:1274
#8 0x000000000042b3c8 in parser_parse_function (context_p=0x7fffffffc4e0, status_flags=6) at jerryscript/jerry-core/parser/js/js-parser.c:2155
#9 0x0000000000425380 in lexer_construct_function_object (context_p=0x7fffffffc4e0, extra_status_flags=6) at jerryscript/jerry-core/parser/js/js-lexer.c:1639
#10 0x000000000041e425 in parser_parse_function_statement (context_p=0x7fffffffc4e0) at jerryscript/jerry-core/parser/js/js-parser-statm.c:420
#11 0x0000000000420d32 in parser_parse_statements (context_p=0x7fffffffc4e0) at jerryscript/jerry-core/parser/js/js-parser-statm.c:1688
#12 0x000000000042b3b9 in parser_parse_function (context_p=0x7fffffffc4e0, status_flags=38) at jerryscript/jerry-core/parser/js/js-parser.c:2154
#13 0x0000000000425380 in lexer_construct_function_object (context_p=0x7fffffffc4e0, extra_status_flags=38) at jerryscript/jerry-core/parser/js/js-lexer.c:1639
#14 0x0000000000409f1c in parser_parse_unary_expression (context_p=0x7fffffffc4e0, grouping_level_p=0x7fffffffc378) at jerryscript/jerry-core/parser/js/js-parser-expr.c:605
#15 0x000000000040b846 in parser_parse_expression (context_p=0x7fffffffc4e0, options=2) at jerryscript/jerry-core/parser/js/js-parser-expr.c:1362
#16 0x0000000000421254 in parser_parse_statements (context_p=0x7fffffffc4e0) at jerryscript/jerry-core/parser/js/js-parser-statm.c:1878
#17 0x000000000042a99c in parser_parse_source.lto_priv.202 (source_p=0x69eba8 <jerry_global_heap+55728> "(function test() {\n echo(inner(0x7fffffff));\n function inner(a) {\n a |= 0;\n var r = 0;\n var v0 = a + a + 1;\n var t1 = -v0 + -v0 + 1;\n var v1 = -t1;\n var"..., size=9241, strict_mode=0, error_location_p=0x7fffffffc690) at jerryscript/jerry-core/parser/js/js-parser.c:1874
#18 0x00000000004227b1 in parser_parse_script (source_p=0x69eba8 <jerry_global_heap+55728> "(function test() {\n echo(inner(0x7fffffff));\n function inner(a) {\n a |= 0;\n var r = 0;\n var v0 = a + a + 1;\n var t1 = -v0 + -v0 + 1;\n var v1 = -t1;\n var"..., size=9241, is_strict=false, bytecode_data_p=0x7fffffffc6d0) at jerryscript/jerry-core/parser/js/js-parser.c:2252
#19 0x00000000004320c0 in ecma_op_eval_chars_buffer (code_p=0x69eba8 <jerry_global_heap+55728> "(function test() {\n echo(inner(0x7fffffff));\n function inner(a) {\n a |= 0;\n var r = 0;\n var v0 = a + a + 1;\n var t1 = -v0 + -v0 + 1;\n var v1 = -t1;\n var"..., code_buffer_size=9241, is_direct=true, is_called_from_strict_mode_code=false) at jerryscript/jerry-core/ecma/operations/ecma-eval.c:91
#20 0x0000000000431ffb in ecma_op_eval (code_p=0x69eba0 <jerry_global_heap+55720>, is_direct=true, is_called_from_strict_mode_code=false) at jerryscript/jerry-core/ecma/operations/ecma-eval.c:58
#21 0x000000000043d74d in ecma_builtin_global_object_eval (this_arg=72, x=55722) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-global.c:176
#22 0x000000000043d296 in ecma_builtin_global_dispatch_routine (builtin_routine_id=35, this_arg_value=72, arguments_list=0x7fffffffc9c0, arguments_number=1) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-global.inc.h:215
#23 0x000000000045adc4 in ecma_builtin_dispatch_routine.lto_priv.520 (builtin_object_id=ECMA_BUILTIN_ID_GLOBAL, builtin_routine_id=35, this_arg_value=72, arguments_list=0x7fffffffc9c0, arguments_number=1) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.inc.h:469
#24 0x0000000000454f40 in ecma_builtin_dispatch_call (obj_p=0x6916e0 <jerry_global_heap+1256>, this_arg_value=72, arguments_list_p=0x7fffffffc9c0, arguments_list_len=1) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.c:844
#25 0x0000000000438581 in ecma_op_function_call (func_obj_p=0x6916e0 <jerry_global_heap+1256>, this_arg_value=72, arguments_list_p=0x7fffffffc9c0, arguments_list_len=1) at jerryscript/jerry-core/ecma/operations/ecma-function-object.c:461
#26 0x000000000041db76 in opfunc_call.lto_priv.138 (frame_ctx_p=0x7fffffffca10) at jerryscript/jerry-core/vm/vm.c:385
#27 0x0000000000415614 in vm_execute (frame_ctx_p=0x7fffffffca10, arg_p=0x7fffffffcc54, arg_list_len=3) at jerryscript/jerry-core/vm/vm.c:2595
#28 0x0000000000415879 in vm_run (bytecode_header_p=0x6921a8 <jerry_global_heap+4016>, this_binding_value=27, lex_env_p=0x6980a0 <jerry_global_heap+28328>, is_eval_code=false, arg_list_p=0x7fffffffcc54, arg_list_len=3) at jerryscript/jerry-core/vm/vm.c:2664
#29 0x0000000000438719 in ecma_op_function_call (func_obj_p=0x6912e0 <jerry_global_heap+232>, this_arg_value=72, arguments_list_p=0x7fffffffcc54, arguments_list_len=3) at jerryscript/jerry-core/ecma/operations/ecma-function-object.c:524
#30 0x000000000041db76 in opfunc_call.lto_priv.138 (frame_ctx_p=0x7fffffffcca0) at jerryscript/jerry-core/vm/vm.c:385
#31 0x0000000000415614 in vm_execute (frame_ctx_p=0x7fffffffcca0, arg_p=0x0, arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:2595
#32 0x0000000000415879 in vm_run (bytecode_header_p=0x692468 <jerry_global_heap+4720>, this_binding_value=27, lex_env_p=0x691220 <jerry_global_heap+40>, is_eval_code=false, arg_list_p=0x0, arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:2664
#33 0x000000000041d804 in vm_run_global (bytecode_p=0x692468 <jerry_global_heap+4720>) at jerryscript/jerry-core/vm/vm.c:211
#34 0x0000000000469b92 in jerry_run (func_val=139) at jerryscript/jerry-core/jerry.c:340
#35 0x000000000046d5b5 in main (argc=3, argv=0x7fffffffd2e8) at jerryscript/jerry-main/main-unix.c:711
```
| Assertion 'register_count < PARSER_MAXIMUM_NUMBER_OF_REGISTERS' failed in parser_compute_indicies | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1556/comments | 0 | 2017-02-01T09:23:43Z | 2017-02-06T14:50:44Z | https://github.com/jerryscript-project/jerryscript/issues/1556 | 204,532,618 | 1,556 |
[
"jerryscript-project",
"jerryscript"
] | ###### Jerry version:
```
Checked revision: 77ab2c7
Build: debug.linux
```
###### OS:
```
Ubuntu 16.04, x86_64
```
```js
var src = "while($) { switch($) {";
for (var i = 0; i < 2270; i++)
src += "case " + i + ": if (n[" + i + "] ++ > 0) check ('a string " + i + "'); break;"
src += "}}"
eval(src)
```
###### Backtrace:
```
ICE: Assertion 'CBC_BRANCH_OFFSET_LENGTH (opcode) == 2' failed at jerryscript/jerry-core/vm/vm.c(vm_loop):811.
Error: ERR_FAILED_INTERNAL_ASSERTION
Aborted
bt
#0 0x000000000046daba in syscall_2 () at jerryscript/jerry-libc/target/posix/jerry-asm.S:59
#1 0x0000000000402760 in raise (sig=6) at jerryscript/jerry-libc/target/posix/jerry-libc-target.c:91
#2 0x0000000000402732 in abort () at jerryscript/jerry-libc/target/posix/jerry-libc-target.c:77
#3 0x00000000004113c6 in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/targets/default/jerry-port-default-fatal.c:53
#4 0x000000000042ce6f in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:61
#5 0x000000000042cec1 in jerry_assert_fail (assertion=0x471de0 "CBC_BRANCH_OFFSET_LENGTH (opcode) == 2", file=0x471cf0 "jerryscript/jerry-core/vm/vm.c", function=0x487410 <__func__.4220.lto_priv.142> "vm_loop", line=811) at jerryscript/jerry-core/jrt/jrt-fatals.c:85
#6 0x0000000000417684 in vm_loop.lto_priv.139 (frame_ctx_p=0x7fffffffc7a0) at jerryscript/jerry-core/vm/vm.c:811
#7 0x00000000004155ed in vm_execute (frame_ctx_p=0x7fffffffc7a0, arg_p=0x7fffffffc9e4, arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:2586
#8 0x0000000000415879 in vm_run (bytecode_header_p=0x6da970 <jerry_global_heap+300920>, this_binding_value=27, lex_env_p=0x691220 <jerry_global_heap+40>, is_eval_code=false, arg_list_p=0x7fffffffc9e4, arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:2664
#9 0x0000000000438719 in ecma_op_function_call (func_obj_p=0x6912d0 <jerry_global_heap+216>, this_arg_value=72, arguments_list_p=0x7fffffffc9e4, arguments_list_len=0) at jerryscript/jerry-core/ecma/operations/ecma-function-object.c:524
#10 0x000000000041db76 in opfunc_call.lto_priv.138 (frame_ctx_p=0x7fffffffca20) at jerryscript/jerry-core/vm/vm.c:385
#11 0x0000000000415614 in vm_execute (frame_ctx_p=0x7fffffffca20, arg_p=0x7fffffffcc64, arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:2595
#12 0x0000000000415879 in vm_run (bytecode_header_p=0x6914f0 <jerry_global_heap+760>, this_binding_value=27, lex_env_p=0x691220 <jerry_global_heap+40>, is_eval_code=false, arg_list_p=0x7fffffffcc64, arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:2664
#13 0x0000000000438719 in ecma_op_function_call (func_obj_p=0x6912c0 <jerry_global_heap+200>, this_arg_value=72, arguments_list_p=0x7fffffffcc64, arguments_list_len=0) at jerryscript/jerry-core/ecma/operations/ecma-function-object.c:524
#14 0x000000000041db76 in opfunc_call.lto_priv.138 (frame_ctx_p=0x7fffffffcca0) at jerryscript/jerry-core/vm/vm.c:385
#15 0x0000000000415614 in vm_execute (frame_ctx_p=0x7fffffffcca0, arg_p=0x0, arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:2595
#16 0x0000000000415879 in vm_run (bytecode_header_p=0x693648 <jerry_global_heap+9296>, this_binding_value=27, lex_env_p=0x691220 <jerry_global_heap+40>, is_eval_code=false, arg_list_p=0x0, arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:2664
#17 0x000000000041d804 in vm_run_global (bytecode_p=0x693648 <jerry_global_heap+9296>) at jerryscript/jerry-core/vm/vm.c:211
#18 0x0000000000469b92 in jerry_run (func_val=139) at jerryscript/jerry-core/jerry.c:340
#19 0x000000000046d5b5 in main (argc=3, argv=0x7fffffffd2e8) at jerryscript/jerry-main/main-unix.c:711
```
| Assertion 'CBC_BRANCH_OFFSET_LENGTH (opcode) == 2' failed in vm_loop | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1555/comments | 0 | 2017-02-01T09:22:50Z | 2017-02-06T09:19:32Z | https://github.com/jerryscript-project/jerryscript/issues/1555 | 204,532,452 | 1,555 |
[
"jerryscript-project",
"jerryscript"
] | ###### Jerry version:
```
Checked revision: 7b59c80
Build: debug.linux
```
###### OS:
```
Ubuntu 16.04, x86_64
```
###### Test case:
```javascript
function createHashTable() {
var o = new Array()
var elements = new Array()
o.elementHash = function (i) {
return Math.abs (i) & 31
}
o.add = function (i) {
var elementIndex = this.elementHash (i)
if(elements[elementIndex] !== undefined) {
for(var j = elementIndex; j < elementIndex + 4 && j < 32; ++j) {
delete this["h" + elements[j]]
}
}
elements[elementIndex] = i
this["h" + i] = i
}
return o
}
function useAsHashTable() {
for(var $;;) {
for(var j;; j = (j + 1) | $)
o.add (j)
}
}
var o = createHashTable()
useAsHashTable()
```
###### Backtrace:
```
ICE: Assertion 'entry_index != start_entry_index' failed at jerryscript/jerry-core/ecma/base/ecma-property-hashmap.c(ecma_property_hashmap_find):529.
Error: ERR_FAILED_INTERNAL_ASSERTION
Aborted
bt
#0 0x000000000046daba in syscall_2 () at jerryscript/jerry-libc/target/posix/jerry-asm.S:59
#1 0x0000000000402760 in raise (sig=6) at jerryscript/jerry-libc/target/posix/jerry-libc-target.c:91
#2 0x0000000000402732 in abort () at jerryscript/jerry-libc/target/posix/jerry-libc-target.c:77
#3 0x00000000004113c6 in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/targets/default/jerry-port-default-fatal.c:53
#4 0x000000000042ce6f in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:61
#5 0x000000000042cec1 in jerry_assert_fail (assertion=0x470e78 "entry_index != start_entry_index", file=0x470dd0 "jerryscript/jerry-core/ecma/base/ecma-property-hashmap.c", function=0x487630 <__func__.3594.lto_priv.114> "ecma_property_hashmap_find", line=529) at jerryscript/jerry-core/jrt/jrt-fatals.c:85
#6 0x000000000041224a in ecma_property_hashmap_find (hashmap_p=0x691d48 <jerry_global_heap+2896>, name_p=0x691c08 <jerry_global_heap+2576>, property_real_name_cp=0x7fffffffc22e) at jerryscript/jerry-core/ecma/base/ecma-property-hashmap.c:529
#7 0x0000000000463b91 in ecma_find_named_property (obj_p=0x691340 <jerry_global_heap+328>, name_p=0x691c08 <jerry_global_heap+2576>) at jerryscript/jerry-core/ecma/base/ecma-helpers.c:683
#8 0x0000000000435f8a in ecma_op_object_put (object_p=0x691340 <jerry_global_heap+328>, property_name_p=0x691c08 <jerry_global_heap+2576>, value=3120, is_throw=false) at jerryscript/jerry-core/ecma/operations/ecma-objects.c:774
#9 0x000000000041d77b in vm_op_set_value.lto_priv.143 (object=331, property=2578, value=3120, is_strict=false) at jerryscript/jerry-core/vm/vm.c:166
#10 0x000000000041ac75 in vm_loop.lto_priv.139 (frame_ctx_p=0x7fffffffc770) at jerryscript/jerry-core/vm/vm.c:2377
#11 0x00000000004155ed in vm_execute (frame_ctx_p=0x7fffffffc770, arg_p=0x7fffffffc9cc, arg_list_len=1) at jerryscript/jerry-core/vm/vm.c:2586
#12 0x0000000000415879 in vm_run (bytecode_header_p=0x691798 <jerry_global_heap+1440>, this_binding_value=331, lex_env_p=0x691300 <jerry_global_heap+264>, is_eval_code=false, arg_list_p=0x7fffffffc9cc, arg_list_len=1) at jerryscript/jerry-core/vm/vm.c:2664
#13 0x0000000000438719 in ecma_op_function_call (func_obj_p=0x6913c8 <jerry_global_heap+464>, this_arg_value=331, arguments_list_p=0x7fffffffc9cc, arguments_list_len=1) at jerryscript/jerry-core/ecma/operations/ecma-function-object.c:524
#14 0x000000000041db76 in opfunc_call.lto_priv.138 (frame_ctx_p=0x7fffffffca10) at jerryscript/jerry-core/vm/vm.c:385
#15 0x0000000000415614 in vm_execute (frame_ctx_p=0x7fffffffca10, arg_p=0x7fffffffcc54, arg_list_len=2) at jerryscript/jerry-core/vm/vm.c:2595
#16 0x0000000000415879 in vm_run (bytecode_header_p=0x6918f0 <jerry_global_heap+1784>, this_binding_value=27, lex_env_p=0x691220 <jerry_global_heap+40>, is_eval_code=false, arg_list_p=0x7fffffffcc54, arg_list_len=2) at jerryscript/jerry-core/vm/vm.c:2664
#17 0x0000000000438719 in ecma_op_function_call (func_obj_p=0x6912d0 <jerry_global_heap+216>, this_arg_value=72, arguments_list_p=0x7fffffffcc54, arguments_list_len=2) at jerryscript/jerry-core/ecma/operations/ecma-function-object.c:524
#18 0x000000000041db76 in opfunc_call.lto_priv.138 (frame_ctx_p=0x7fffffffcca0) at jerryscript/jerry-core/vm/vm.c:385
#19 0x0000000000415614 in vm_execute (frame_ctx_p=0x7fffffffcca0, arg_p=0x0, arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:2595
#20 0x0000000000415879 in vm_run (bytecode_header_p=0x691ab0 <jerry_global_heap+2232>, this_binding_value=27, lex_env_p=0x691220 <jerry_global_heap+40>, is_eval_code=false, arg_list_p=0x0, arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:2664
#21 0x000000000041d804 in vm_run_global (bytecode_p=0x691ab0 <jerry_global_heap+2232>) at jerryscript/jerry-core/vm/vm.c:211
#22 0x0000000000469b92 in jerry_run (func_val=139) at jerryscript/jerry-core/jerry.c:340
#23 0x000000000046d5b5 in main (argc=3, argv=0x7fffffffd2e8) at jerryscript/jerry-main/main-unix.c:711
```
| Assertion 'entry_index != start_entry_index' failed in ecma_property_hashmap_find | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1552/comments | 1 | 2017-01-31T12:09:08Z | 2017-02-10T07:10:21Z | https://github.com/jerryscript-project/jerryscript/issues/1552 | 204,277,624 | 1,552 |
[
"jerryscript-project",
"jerryscript"
] | ###### Jerry version:
```
Checked revision: 7b59c80
Build: debug.linux
```
###### OS:
```
Ubuntu 16.04, x86_64
```
###### Test case:
The test contains characters that GH cannot display. To save the test case run this Python snippet:
```python
with open('test.js', 'wb') as f:
f.write(b"\xef\xbb\xbf")
```
###### Backtrace:
```
ICE: Assertion '(c & LIT_UTF8_3_BYTE_MASK) == LIT_UTF8_3_BYTE_MARKER' failed at jerryscript/jerry-core/lit/lit-strings.c(lit_read_code_unit_from_utf8):425.
Error: ERR_FAILED_INTERNAL_ASSERTION
timeout: the monitored command dumped core
Aborted
bt
#0 0x000000000046daba in syscall_2 () at jerryscript/jerry-libc/target/posix/jerry-asm.S:59
#1 0x0000000000402760 in raise (sig=6) at jerryscript/jerry-libc/target/posix/jerry-libc-target.c:91
#2 0x0000000000402732 in abort () at jerryscript/jerry-libc/target/posix/jerry-libc-target.c:77
#3 0x00000000004113c6 in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/targets/default/jerry-port-default-fatal.c:53
#4 0x000000000042ce6f in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION) at jerryscript/jerry-core/jrt/jrt-fatals.c:61
#5 0x000000000042cec1 in jerry_assert_fail (assertion=0x4746d8 "(c & LIT_UTF8_3_BYTE_MASK) == LIT_UTF8_3_BYTE_MARKER", file=0x474588 "jerryscript/jerry-core/lit/lit-strings.c", function=0x4863f0 <__func__.2059.lto_priv.226> "lit_read_code_unit_from_utf8", line=425) at jerryscript/jerry-core/jrt/jrt-fatals.c:85
#6 0x000000000042718b in lit_read_code_unit_from_utf8 (buf_p=0x712392 <buffer+370> "\277function deferredWithRegex() {\n return /[\\uD800\\uDC00\\uFFFF]/.test(\"\\uFFFF\");\n}\n\nif (deferredWithRegex()) {\n WScript.Echo(\"Pass\");\n}\n", code_point=0x7fffffffcb3e) at jerryscript/jerry-core/lit/lit-strings.c:425
#7 0x0000000000427378 in lit_utf8_peek_next (buf_p=0x712392 <buffer+370> "\277function deferredWithRegex() {\n return /[\\uD800\\uDC00\\uFFFF]/.test(\"\\uFFFF\");\n}\n\nif (deferredWithRegex()) {\n WScript.Echo(\"Pass\");\n}\n") at jerryscript/jerry-core/lit/lit-strings.c:500
#8 0x000000000042da2f in lit_char_is_identifier_start (src_p=0x712392 <buffer+370> "\277function deferredWithRegex() {\n return /[\\uD800\\uDC00\\uFFFF]/.test(\"\\uFFFF\");\n}\n\nif (deferredWithRegex()) {\n WScript.Echo(\"Pass\");\n}\n") at jerryscript/jerry-core/lit/lit-char-helpers.c:219
#9 0x0000000000423ac7 in lexer_next_token (context_p=0x7fffffffcbc0) at jerryscript/jerry-core/parser/js/js-lexer.c:988
#10 0x000000000042a98d in parser_parse_source.lto_priv.202 (source_p=0x712220 <buffer> "//", '-' <repeats 103 times>, "\n// Copyright (C) Microsoft. All rights reserved.\n// Licensed under the MIT license. See LICENS"..., size=510, strict_mode=0, error_location_p=0x7fffffffcd70) at jerryscript/jerry-core/parser/js/js-parser.c:1872
#11 0x00000000004227b1 in parser_parse_script (source_p=0x712220 <buffer> "//", '-' <repeats 103 times>, "\n// Copyright (C) Microsoft. All rights reserved.\n// Licensed under the MIT license. See LICENS"..., size=510, is_strict=false, bytecode_data_p=0x7fffffffcdb0) at jerryscript/jerry-core/parser/js/js-parser.c:2252
#12 0x00000000004699fe in jerry_parse (source_p=0x712220 <buffer> "//", '-' <repeats 103 times>, "\n// Copyright (C) Microsoft. All rights reserved.\n// Licensed under the MIT license. See LICENS"..., source_size=510, is_strict=false) at jerryscript/jerry-core/jerry.c:262
#13 0x000000000046d580 in main (argc=3, argv=0x7fffffffd2e8) at jerryscript/jerry-main/main-unix.c:706
```
| Assertion '(c & LIT_UTF8_3_BYTE_MASK) == LIT_UTF8_3_BYTE_MARKER' failed in lit_read_code_unit_from_utf8 | https://api.github.com/repos/jerryscript-project/jerryscript/issues/1551/comments | 0 | 2017-01-31T11:32:25Z | 2017-02-01T07:47:28Z | https://github.com/jerryscript-project/jerryscript/issues/1551 | 204,270,041 | 1,551 |