issue_owner_repo
listlengths
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
[ "chakra-core", "ChakraCore" ]
Putting this is as a reminder: tc39 proposal tracker needs updating for any new proposals/change in status of proposals since April 2020. Additionally need to update that `??`, `.at` and async iteration are implemented in master and optional chaining is now WIP. https://github.com/chakra-core/org/blob/master/tc39%20Proposals.md
Update tc39 proposal tracker
https://api.github.com/repos/chakra-core/ChakraCore/issues/6614/comments
2
2021-02-20T00:36:59Z
2021-03-15T22:23:33Z
https://github.com/chakra-core/ChakraCore/issues/6614
812,453,995
6,614
[ "chakra-core", "ChakraCore" ]
On Arch linux CC crashes when starting a helper thread with the below stack trace, this crash was confirmed with both 1.11 and master and was likely introduced by changes in Arch linux rather than changes in CC: ``` #0 0x00007ffff510aef5 in raise () at /usr/lib/libc.so.6 #1 0x00007ffff50f4862 in abort () at /usr/lib/libc.so.6 #2 0x00007ffff514cf78 in __libc_message () at /usr/lib/libc.so.6 #3 0x00007ffff514cfaa in __libc_fatal () at /usr/lib/libc.so.6 #4 0x00007ffff4eca70c in __lll_lock_wait () at /usr/lib/libpthread.so.0 #5 0x00007ffff4ec35f0 in pthread_mutex_lock () at /usr/lib/libpthread.so.0 #6 0x00007ffff589847b in JsUtil::BackgroundJobProcessor::Run(JsUtil::ParallelThreadData*) () at /usr/lib/libChakraCore.so #7 0x00007ffff589826a in JsUtil::BackgroundJobProcessor::StaticThreadProc(void*) () at /usr/lib/libChakraCore.so #8 0x00007ffff56328ce in CorUnix::CPalThread::ThreadEntry(void*) () at /usr/lib/libChakraCore.so #9 0x00007ffff4ec1299 in start_thread () at /usr/lib/libpthread.so.0 #10 0x00007ffff51cd153 in clone () at /usr/lib/libc.so.6 ``` (Issue reported by a friend - I don't have a linux setup to verify with myself)
Pal thread handling crashes on latest Arch linux
https://api.github.com/repos/chakra-core/ChakraCore/issues/6613/comments
30
2021-02-16T20:19:35Z
2024-04-20T19:59:52Z
https://github.com/chakra-core/ChakraCore/issues/6613
809,618,500
6,613
[ "chakra-core", "ChakraCore" ]
### Version 1.12.0-master ### Flags -ES6Experimental ### Test code ```js { let i = 0; const proxy = new Proxy({ exec() { return null }, lastIndex: 0 }, { set(target, p) { print(`Should not be called`); print(`Property:`, p, `value:`, value); i++; } }) RegExp.prototype[Symbol.search].call(proxy); print(i); } ``` ### Excepted result ```js 0 ``` ### Actual result ```js Should not be called Property: lastIndex value: 0 Should not be called Property: lastIndex value: 0 2 ``` ### Possible solution It seems like that JavascriptRegExp::EntrySymbolSearch doesn't perform some checks needed by spec. https://github.com/chakra-core/ChakraCore/blob/e6c8f78f505cb332538425b7a9309aee217869ef/lib/Runtime/Library/JavascriptRegularExpression.cpp#L812-L819 Possibly i will open a pr after #6610 is merged and it will also fix #5388
Spec deviation in RegExp.prototype[@@search]()
https://api.github.com/repos/chakra-core/ChakraCore/issues/6612/comments
1
2021-02-15T19:27:23Z
2021-02-15T21:03:12Z
https://github.com/chakra-core/ChakraCore/issues/6612
808,771,260
6,612
[ "chakra-core", "ChakraCore" ]
### Version Chakra - 1.12.0-master and 1.11.24 ### Description The @@unscopables object of Array.prototype doesn't contain the flat and flatMap properties with `true` values. ### Test case 1 ```js print([][Symbol.unscopables].flat); ``` #### Output ```js undefined ``` #### Excepted output ```js true ``` ### Test case 2 ```js print([][Symbol.unscopables].flatMap); ``` #### Output ```js undefined ``` #### Excepted output ```js true ```
The [@@unscopables] object of Array.prototype does not contain flat and flatMap values
https://api.github.com/repos/chakra-core/ChakraCore/issues/6607/comments
1
2021-02-12T21:38:50Z
2021-02-13T10:26:31Z
https://github.com/chakra-core/ChakraCore/issues/6607
807,563,730
6,607
[ "chakra-core", "ChakraCore" ]
We need fuzzing available - particularly for any significant changes to the JIT or type system. I'm planning to look at getting Mozilla FunFuzz to work on ChakraCore: https://github.com/MozillaSecurity/funfuzz Though I'm in interested in any other suggestions or offers to implement a fuzzer. (Marked as Severity 1 as we can't/shouldn't make a release until various of the changes already in Master have been fuzzed)
Set up our own fuzzer
https://api.github.com/repos/chakra-core/ChakraCore/issues/6602/comments
1
2021-02-07T14:31:46Z
2021-04-20T19:58:07Z
https://github.com/chakra-core/ChakraCore/issues/6602
802,965,847
6,602
[ "chakra-core", "ChakraCore" ]
CC fails to build on Ubuntu 20 with the following output, this should be fixed ASAP: ``` [1/690] Building CXX object pal/src/CMakeFiles/Chakra.Pal.dir/cruntime/file.cpp.o FAILED: pal/src/CMakeFiles/Chakra.Pal.dir/cruntime/file.cpp.o /usr/bin/clang++ -DBIT64=1 -DCAN_BUILD_WABT -DCLANG_HAS_DISABLE_TAIL_CALLS=1 -DDBG=1 -DDBG_DUMP=1 -DDEBUG=1 -DFEATURE_PAL -DFEATURE_PAL=1 -DHAS_ICU -DHAS_REAL_ICU=1 -DINTL_ICU=1 -DLINUX64 -DLP64COMPATIBLE=1 -DPIC=1 -DPLATFORM_UNIX=1 -DSTACK_ALIGN=16 -DTARGET_64 -DUNICODE -D_AMD64_ -D_CHAKRACOREBUILD -D_DEBUG=1 -D_FILE_OFFSET_BITS=64 -D_M_AMD64 -D_M_X64 -D_SAFECRT_USE_CPP_OVERLOADS=1 -D_WIN64=1 -D__LINUX__=1 -D__STDC_WANT_LIB_EXT1__=1 -Ipal/src -I../pal/src -I../. -I../lib/Common -I../lib/Common/PlaceHolder -I../pal -I../pal/inc -I../pal/inc/rt -I../pal/src/include -Werror -Wno-ignored-attributes -Wno-parentheses-equality -Wno-reorder -Wno-microsoft -Wno-unused-value -Wno-int-to-void-pointer-cast -Wno-invalid-offsetof -Wno-undefined-inline -Wno-inconsistent-missing-override -Wno-c++14-extensions -Wno-macro-redefined -Wno-pragmas -Wno-invalid-token-paste -Wno-format -Wno-invalid-noreturn -Wno-null-arithmetic -Wno-tautological-constant-out-of-range-compare -Wno-tautological-undefined-compare -Wno-address-of-temporary -Wno-null-conversion -Wno-return-type -Wno-switch -Wno-int-to-pointer-cast -Wno-tautological-constant-compare -Wno-enum-compare-switch -Wno-unknown-warning-option -fno-omit-frame-pointer -fdelayed-template-parsing -g -fdiagnostics-color=always -msse4.2 -fasm-blocks -fms-extensions -fwrapv -fstack-protector -fno-builtin -fPIC -std=gnu++11 -MD -MT pal/src/CMakeFiles/Chakra.Pal.dir/cruntime/file.cpp.o -MF pal/src/CMakeFiles/Chakra.Pal.dir/cruntime/file.cpp.o.d -o pal/src/CMakeFiles/Chakra.Pal.dir/cruntime/file.cpp.o -c ../pal/src/cruntime/file.cpp In file included from ../pal/src/cruntime/file.cpp:23: In file included from ../pal/src/include/pal/palinternal.h:553: In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/stdlib.h:36: In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/cstdlib:75: /usr/include/stdlib.h:112:36: error: exception specification in declaration does not match previous declaration __extension__ extern long long int atoll (const char *__nptr) ^ ../pal/inc/pal.h:6198:33: note: previous declaration is here PALIMPORT long long int __cdecl atoll(const char *); ^ 1 error generated. [2/690] Building CXX object pal/src/CMakeFiles/Chakra.Pal.dir/cruntime/filecrt.cpp.o FAILED: pal/src/CMakeFiles/Chakra.Pal.dir/cruntime/filecrt.cpp.o /usr/bin/clang++ -DBIT64=1 -DCAN_BUILD_WABT -DCLANG_HAS_DISABLE_TAIL_CALLS=1 -DDBG=1 -DDBG_DUMP=1 -DDEBUG=1 -DFEATURE_PAL -DFEATURE_PAL=1 -DHAS_ICU -DHAS_REAL_ICU=1 -DINTL_ICU=1 -DLINUX64 -DLP64COMPATIBLE=1 -DPIC=1 -DPLATFORM_UNIX=1 -DSTACK_ALIGN=16 -DTARGET_64 -DUNICODE -D_AMD64_ -D_CHAKRACOREBUILD -D_DEBUG=1 -D_FILE_OFFSET_BITS=64 -D_M_AMD64 -D_M_X64 -D_SAFECRT_USE_CPP_OVERLOADS=1 -D_WIN64=1 -D__LINUX__=1 -D__STDC_WANT_LIB_EXT1__=1 -Ipal/src -I../pal/src -I../. -I../lib/Common -I../lib/Common/PlaceHolder -I../pal -I../pal/inc -I../pal/inc/rt -I../pal/src/include -Werror -Wno-ignored-attributes -Wno-parentheses-equality -Wno-reorder -Wno-microsoft -Wno-unused-value -Wno-int-to-void-pointer-cast -Wno-invalid-offsetof -Wno-undefined-inline -Wno-inconsistent-missing-override -Wno-c++14-extensions -Wno-macro-redefined -Wno-pragmas -Wno-invalid-token-paste -Wno-format -Wno-invalid-noreturn -Wno-null-arithmetic -Wno-tautological-constant-out-of-range-compare -Wno-tautological-undefined-compare -Wno-address-of-temporary -Wno-null-conversion -Wno-return-type -Wno-switch -Wno-int-to-pointer-cast -Wno-tautological-constant-compare -Wno-enum-compare-switch -Wno-unknown-warning-option -fno-omit-frame-pointer -fdelayed-template-parsing -g -fdiagnostics-color=always -msse4.2 -fasm-blocks -fms-extensions -fwrapv -fstack-protector -fno-builtin -fPIC -std=gnu++11 -MD -MT pal/src/CMakeFiles/Chakra.Pal.dir/cruntime/filecrt.cpp.o -MF pal/src/CMakeFiles/Chakra.Pal.dir/cruntime/filecrt.cpp.o.d -o pal/src/CMakeFiles/Chakra.Pal.dir/cruntime/filecrt.cpp.o -c ../pal/src/cruntime/filecrt.cpp In file included from ../pal/src/cruntime/filecrt.cpp:23: In file included from ../pal/src/include/pal/thread.hpp:24: In file included from ../pal/src/include/pal/corunix.hpp:25: In file included from ../pal/src/include/pal/palinternal.h:553: In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/stdlib.h:36: In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/cstdlib:75: /usr/include/stdlib.h:112:36: error: exception specification in declaration does not match previous declaration __extension__ extern long long int atoll (const char *__nptr) ^ ../pal/inc/pal.h:6198:33: note: previous declaration is here PALIMPORT long long int __cdecl atoll(const char *); ^ 1 error generated. [3/690] Building CXX object pal/src/CMakeFiles/Chakra.Pal.dir/cruntime/finite.cpp.o FAILED: pal/src/CMakeFiles/Chakra.Pal.dir/cruntime/finite.cpp.o /usr/bin/clang++ -DBIT64=1 -DCAN_BUILD_WABT -DCLANG_HAS_DISABLE_TAIL_CALLS=1 -DDBG=1 -DDBG_DUMP=1 -DDEBUG=1 -DFEATURE_PAL -DFEATURE_PAL=1 -DHAS_ICU -DHAS_REAL_ICU=1 -DINTL_ICU=1 -DLINUX64 -DLP64COMPATIBLE=1 -DPIC=1 -DPLATFORM_UNIX=1 -DSTACK_ALIGN=16 -DTARGET_64 -DUNICODE -D_AMD64_ -D_CHAKRACOREBUILD -D_DEBUG=1 -D_FILE_OFFSET_BITS=64 -D_M_AMD64 -D_M_X64 -D_SAFECRT_USE_CPP_OVERLOADS=1 -D_WIN64=1 -D__LINUX__=1 -D__STDC_WANT_LIB_EXT1__=1 -Ipal/src -I../pal/src -I../. -I../lib/Common -I../lib/Common/PlaceHolder -I../pal -I../pal/inc -I../pal/inc/rt -I../pal/src/include -Werror -Wno-ignored-attributes -Wno-parentheses-equality -Wno-reorder -Wno-microsoft -Wno-unused-value -Wno-int-to-void-pointer-cast -Wno-invalid-offsetof -Wno-undefined-inline -Wno-inconsistent-missing-override -Wno-c++14-extensions -Wno-macro-redefined -Wno-pragmas -Wno-invalid-token-paste -Wno-format -Wno-invalid-noreturn -Wno-null-arithmetic -Wno-tautological-constant-out-of-range-compare -Wno-tautological-undefined-compare -Wno-address-of-temporary -Wno-null-conversion -Wno-return-type -Wno-switch -Wno-int-to-pointer-cast -Wno-tautological-constant-compare -Wno-enum-compare-switch -Wno-unknown-warning-option -fno-omit-frame-pointer -fdelayed-template-parsing -g -fdiagnostics-color=always -msse4.2 -fasm-blocks -fms-extensions -fwrapv -fstack-protector -fno-builtin -fPIC -std=gnu++11 -MD -MT pal/src/CMakeFiles/Chakra.Pal.dir/cruntime/finite.cpp.o -MF pal/src/CMakeFiles/Chakra.Pal.dir/cruntime/finite.cpp.o.d -o pal/src/CMakeFiles/Chakra.Pal.dir/cruntime/finite.cpp.o -c ../pal/src/cruntime/finite.cpp In file included from ../pal/src/cruntime/finite.cpp:22: In file included from ../pal/src/include/pal/palinternal.h:553: In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/stdlib.h:36: In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/cstdlib:75: /usr/include/stdlib.h:112:36: error: exception specification in declaration does not match previous declaration __extension__ extern long long int atoll (const char *__nptr) ^ ../pal/inc/pal.h:6198:33: note: previous declaration is here PALIMPORT long long int __cdecl atoll(const char *); ^ In file included from ../pal/src/cruntime/finite.cpp:24: In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/math.h:36: In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/cmath:45: In file included from /usr/include/math.h:307: /usr/include/x86_64-linux-gnu/bits/mathcalls.h:159:1: error: exception specification in declaration does not match previous declaration __MATHCALLX (ceil,, (_Mdouble_ __x), (__const__)); ^ /usr/include/math.h:278:3: note: expanded from macro '__MATHCALLX' __MATHDECLX (_Mdouble_,function,suffix, args, attrib) ^ /usr/include/math.h:280:3: note: expanded from macro '__MATHDECLX' __MATHDECL_1(type, function,suffix, args) __attribute__ (attrib); \ ^ /usr/include/math.h:283:15: note: expanded from macro '__MATHDECL_1' extern type __MATH_PRECNAME(function,suffix) args __THROW ^ /usr/include/math.h:303:34: note: expanded from macro '__MATH_PRECNAME' # define __MATH_PRECNAME(name,r) name##f##r ^ <scratch space>:56:1: note: expanded from here ceilf ^ ../pal/inc/pal.h:6403:25: note: previous declaration is here PALIMPORT float __cdecl ceilf(float); ^ In file included from ../pal/src/cruntime/finite.cpp:24: In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/math.h:36: In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/cmath:45: In file included from /usr/include/math.h:307: /usr/include/x86_64-linux-gnu/bits/mathcalls.h:165:1: error: exception specification in declaration does not match previous declaration __MATHCALLX (floor,, (_Mdouble_ __x), (__const__)); ^ /usr/include/math.h:278:3: note: expanded from macro '__MATHCALLX' __MATHDECLX (_Mdouble_,function,suffix, args, attrib) ^ /usr/include/math.h:280:3: note: expanded from macro '__MATHDECLX' __MATHDECL_1(type, function,suffix, args) __attribute__ (attrib); \ ^ /usr/include/math.h:283:15: note: expanded from macro '__MATHDECL_1' extern type __MATH_PRECNAME(function,suffix) args __THROW ^ /usr/include/math.h:303:34: note: expanded from macro '__MATH_PRECNAME' # define __MATH_PRECNAME(name,r) name##f##r ^ <scratch space>:62:1: note: expanded from here floorf ^ ../pal/inc/pal.h:6401:25: note: previous declaration is here PALIMPORT float __cdecl floorf(float); ^ 3 errors generated. ninja: build stopped: subcommand failed. ##[error]Bash exited with code '1'. ##[section]Finishing: Build ```
Build compatibility with Clang 10 and Ubuntu 20.04
https://api.github.com/repos/chakra-core/ChakraCore/issues/6600/comments
5
2021-02-05T21:52:50Z
2021-02-12T09:40:34Z
https://github.com/chakra-core/ChakraCore/issues/6600
802,499,897
6,600
[ "chakra-core", "ChakraCore" ]
###### Version Chakra-1.11.24 ###### Execution step ``` ./ChakraCore/out/Release/ch testcase.js ``` ###### Testcase ```js target = Function(); handler = { get: function() { print('Run here'); } }; var p= new Proxy(target, handler); new p; ``` ###### Output ``` ``` ###### Expected behavior ``` Run here ``` ###### Description When executing the above test case, the code creates a proxy for an anonymous function named "p" in line 4. When executing the last line of code, other engines (spidermonkey, v8, JavascriptCore, etc.) will call the `get` function defined in line 3, but Chakra did not do so. It seems that the implementation of chakra is incorrect.
Proxy construct method without trap does not use get trap for prototype
https://api.github.com/repos/chakra-core/ChakraCore/issues/6597/comments
3
2021-02-03T05:26:59Z
2021-03-15T08:37:59Z
https://github.com/chakra-core/ChakraCore/issues/6597
799,983,960
6,597
[ "chakra-core", "ChakraCore" ]
The CI Linux and macOS jobs have always been much slower than the windows once. In the past I believed that was because the hosts used were slower. BUT with the fix in #6592 the actual tests now perform at similar speeds - with linux sometimes being faster than windows, this strongly implies that the machines are not significantly slower. However the compile time on macOS and Linux is still 3-4x as long as it is on windows - I'd expect PAL to add 10% - but the difference is so much higher than that. Investigate why this compilation takes so much longer and see if it can be fixed. Things that are not the answer: - optimisation level (Debug which is not optimised and Release which uses `-O3` take similar time to build) - PAL compilation time - prior to #6592 PAL was being built twice, cutting this only took off ~5 minutes online, maybe 2 minutes offline - `#pragma once` the non-standard means for tracking included headers - I was wondering if this was failing and headers were being included multiple times BUT I've checked and that's not the case - make vs ninja - testing offline difference was negligible +/- 8 seconds on a clean ~10.5 minute build - gcc vs clang - testing offline gcc was actually 20% faster but that is again not the size of difference we're looking for
Explore slow linux and macOS compile times
https://api.github.com/repos/chakra-core/ChakraCore/issues/6594/comments
0
2021-01-30T17:28:35Z
2021-01-30T20:33:17Z
https://github.com/chakra-core/ChakraCore/issues/6594
797,483,151
6,594
[ "chakra-core", "ChakraCore" ]
`ch` depends directly on Pal and uses various windows API calls; removing this dependency and using cross platform equivalents would simplify the build process and hopefully made the code slightly easier to work with too.
Remove Pal Dependency from ch
https://api.github.com/repos/chakra-core/ChakraCore/issues/6593/comments
0
2021-01-30T09:03:45Z
2021-01-30T09:03:45Z
https://github.com/chakra-core/ChakraCore/issues/6593
797,371,748
6,593
[ "chakra-core", "ChakraCore" ]
These js files implement certain features used in `ch` currently they are embedded within `ch` as raw strings of javascript, so when launching `ch` with the flags that imply they're needed they have to be parsed and converted to bytecode before execution begins. - There are numerous test cases that use `DbgController.js` and it's fairly long, so converting these into bytecode in advance could result in a measurable speed up in running the testsuite. - `262.js` is much smaller but still could be worth doing. - I'm not sure on `Encode.js` - it may just need deleting, I can't see what it's for. On the back of #6583 this would be fairly easy to do - the script I've written as part of that could be just expanded to include generating these new bytecode files. |Pros|Cons| |---|---| |Speed up test suite|More generated files in the source tree| |Get rid of DbgController build step|Speed up likely small| |Delete jstoc script||
Suggestion: Convert 262.js, DbgController.js and Encode.js into bytecode
https://api.github.com/repos/chakra-core/ChakraCore/issues/6591/comments
1
2021-01-29T17:31:39Z
2021-01-31T08:39:48Z
https://github.com/chakra-core/ChakraCore/issues/6591
797,058,664
6,591
[ "chakra-core", "ChakraCore" ]
###### Version chakra-1.11.24 ###### Test case ```js const x = 'const x'; this.x = 20; delete this.x; print(this.x); print(x); x = 1; print(x); ``` ###### Execution steps ./ChakraCore/out/Release/ch testcase.js ###### Output ``` undefined const x 1 ``` ###### Expected behavior ``` undefined const x testcase.js:6:1 TypeError: invalid assignment to const 'x' ``` ###### Description In the above test case, the value of the constant `x` cannot be modified, but chakra did successfully modify the value of `x`(line 6). Maybe this is a problem with chakra.
An issue about constant
https://api.github.com/repos/chakra-core/ChakraCore/issues/6590/comments
5
2021-01-29T13:29:01Z
2021-02-01T22:32:15Z
https://github.com/chakra-core/ChakraCore/issues/6590
796,882,432
6,590
[ "chakra-core", "ChakraCore" ]
###### Version chakra-1.11.24 ###### Execution step ./ChakraCore/out/Release/ch testcase.js ###### Test case 1 ```js var s = new String('abcd'); print(typeof s); print(s); s.__proto__ = Function.prototype; print(s); ``` ###### Output 1 ``` object abcd abcd ``` ###### Expected behavior 1 ``` object abcd at testcase.js:5:1 TypeError: Function.prototype.toString called on incompatible object ``` ###### Test case 2 ```js var s = new String('abcd'); print(typeof s); print(s); s.__proto__ = Object.prototype; print(s); ``` ###### Output 2 ``` object abcd abcd ``` ###### Expected behavior 2 ``` object abcd [object String] ``` ###### Description When executing the above test case, the prototype chain of the modified object `s` was modified in the line 4. The output of chakra is inconsistent with other engines (spidermonkey, v8, JavascriptCore, etc.). It seems that the implementation of chakra is incorrect.
The prototype chain does not match the object
https://api.github.com/repos/chakra-core/ChakraCore/issues/6589/comments
2
2021-01-29T12:59:36Z
2021-03-14T19:00:01Z
https://github.com/chakra-core/ChakraCore/issues/6589
796,862,558
6,589
[ "chakra-core", "ChakraCore" ]
I have already written about disadvantages of existing packages and gave several recommendations for improving it (see the [“Recommendations for improving an existing NuGet packages for .NET projects”](https://github.com/chakra-core/ChakraCore/issues/6572) issue). In this post, I will write about more radical changes - new structure of NuGet packages. Currently, .NET developers using the ChakraCore library have only one official package available - [Microsoft.ChakraCore](https://www.nuget.org/packages/Microsoft.ChakraCore), which has two significant disadvantages: 1. This package is focused exclusively on Windows and contains assemblies for the following processor architectures: x86, x64 and ARM. Ability to build a library for the ARM64 architecture has existed for at least six months, but nevertheless the corresponding assembly is not included in either [official releases](https://github.com/chakra-core/ChakraCore/releases) or NuGet package. 1. Now this package weighs about 7 MB. If we add assemblies for three most popular platforms (Windows (ARM64), Linux (x64) and OS X (x64)) to it, then it will already weigh more than 40 MB, which may cause problems for some users. These problems can be solved by creating separate packages for each platform and converting the Microsoft.ChakraCore package to a metapackage. Some developers, including me, have done so by publishing their own packages: JavaScriptEngineSwitcher.ChakraCore.Native.\*, BaristaLabs.BaristaCore.ChakraCore.\* and ReactWindows.ChakraCore.ARM64. Appearance of official packages, created according to similar principles, would led to three positive points: 1. Removing additional burden from developers of unofficial packages. 1. Increasing trust of end users to packages. 1. Increasing number of downloads of official packages. I will list the main steps that you need to do to create such packages (examples still use the old package naming system): 1. **Move a source code of each NuGet package to separate directory.** At the moment, all `.nuspec` and `.props` files are located in the same directory. It would be more optimal to [create a separate directory for each package and move these files there](https://github.com/Taritsyn/ChakraCore/commit/f6f99568514bedf65ce287055f9e763a9141186b). In the future, this would make it easier to add new files to packages (for example, PowerShell scripts). 1. **Use a RID's in NuGet package names**. There are already three platform-specific packages, but they just haven't been published. Since we are also planning to create packages for operating systems other than Windows, then we should use a [runtime identifiers](https://docs.microsoft.com/en-us/dotnet/core/rid-catalog) in its names. I suggest [renaming the platform-specific packages](https://github.com/Taritsyn/ChakraCore/commit/64ed4c6d541d43d62ef2a4ae92f9d1373c938290) as follows: * Microsoft.ChakraCore.X86 -> Microsoft.ChakraCore.win-x86 * Microsoft.ChakraCore.X64 -> Microsoft.ChakraCore.win-x64 * Microsoft.ChakraCore.ARM -> Microsoft.ChakraCore.win-arm 1. **Implement in MSBuild scripts of platform-specific packages a same deployment mechanism as in the Microsoft.ChakraCore package.** Currently, platform-specific packages cannot be used together, because their assemblies overwrite each other. To prevent this, in the `.props` files you need to [use a code similar to code from the `Microsoft.ChakraCore.props` file](https://github.com/Taritsyn/ChakraCore/commit/4b7cfe38851a7d7778829b83ec26a4fbe5b5bf09). 1. **Add a platform-specific “symbol” packages.** Having looked at the [NuGet.org](https://www.nuget.org/) site many packages that contain native assemblies, I did not find a no one package for which symbols were loaded. It seems that for packages with native assemblies, can't create symbol packages in either old (`.symbols.nupkg`) or new (`.snupkg`) format. Therefore, to create a platform-specific “symbol” packages, we will use the same approach as in the `Microsoft.ChakraCore.Symbols` package: [create a regular NuGet packages that will deploy the `.pdb` files instead of the `.dll` files](https://github.com/Taritsyn/ChakraCore/commit/906992e451adecf3c7a509459a3fbfab7dd6758c). 1. **Convert a Microsoft.ChakraCore and Microsoft.ChakraCore.symbols packages to metapackages.** Since we now have primary and “symbol” platform-specific packages, then we can convert the Microsoft.ChakraCore and Microsoft.ChakraCore.symbols packages to metapackages. To do this, we will simply [remove the logic from these packages and add references to platform-specific packages as dependencies](https://github.com/Taritsyn/ChakraCore/commit/f9d3d3abfbced64658b47b2bb5830c23bb3a4495). We keep these packages only for backward compatibility and they will always be intended for Windows. 1. **Add to platform-specific packages a PowerShell scripts that are responsible for deploying assemblies and `.pdb` files on ASP.NET 4.X websites.** Unfortunately, MSBuild scripts are not suitable for all use cases of .NET Framework. For example, ASP.NET 4.X web sites don't have project files and need to use a PowerShell scripts to deploy the native assemblies in the `bin` directory. To make it possible to use packages on ASP.NET 4.X web sites, we will [add the `Install.ps1` and `Uninstall.ps1` scripts to platform-specific packages](https://github.com/Taritsyn/ChakraCore/commit/176c1d991460951d4de3c27eaff5edab9c015a25). 1. **Add a support for Windows (ARM64) platform.** To create primary and “symbol” packages oriented on the ARM64 processor architecture, you can [take the Microsoft.ChakraCore.win-arm.* packages as a basis and just add the `64` numbers in right places](https://github.com/Taritsyn/ChakraCore/commit/9b72d1d109aed560c3ba411dc5cb1eafec450a50). In sample code, I also added the created packages to metapackages as dependencies, as this seemed reasonable to me. 1. **Add a Windows batch file that runs the PowerShell script to create NuGet packages (optional).** Since running the `package.ps1` script by using Windows PowerShell requires certain skills, then [I renamed it to the `pack.ps1` and created a batch file (`pack.cmd`)](https://github.com/Taritsyn/ChakraCore/commit/ef008e2a83d05491edf6ecfe31f6449fffddcaac) to simplify this procedure. 1. **Add a NuGet packages for Linux (x64) and OS X (x64).** [Packages containing assemblies for 64-bit Linux and OS X are extremely simple](https://github.com/Taritsyn/ChakraCore/commit/dcade76e9f585057fb34a79aae3c8027ac002220), because they are intended only for .NET Core. Because .NET Framework is not supported on Linux and OS X, then to run the `nuget.exe` need to install the [Mono](https://www.mono-project.com/). A simple Bash script (`pack.sh`) is used to run the packaging process. Ability to create a “symbol” packages is not yet available. There is also an alternative way to run the packaging process, when [using only one script (`pack.ps1`)](https://github.com/Taritsyn/ChakraCore/commit/9217c71d023da170feddc86139cd1a45f35b765c) written for the [cross-platform PowerShell](https://github.com/PowerShell/PowerShell). Running a script by using this version of PowerShell looks much easier: ``` pwsh pack.ps1 ``` Everything described in this post is already available as a ready-made solution for creating a NuGet packages. Moreover, it is available in two variants: [standard](https://github.com/Taritsyn/ChakraCore/tree/nuget-package-reorganization-demo/Build/NuGet) and [one-script](https://github.com/Taritsyn/ChakraCore/tree/nuget-package-reorganization-pwsh-only-demo/Build/NuGet). I am ready to implement each of these recommendations in the form of pull request. **P.S.:** I did not touch the `Microsoft.ChakraCore.SignNuget.proj` and `packages.config` files, because I do not know exactly how they are used. Most likely, they are used to install the [MicroBuild.Core](https://www.nuget.org/packages/MicroBuild.Core/) and [SrcSrv](https://www.nuget.org/packages/SrcSrv/) packages, but it is better to check with Microsoft employees.
Recommendations for new structure of NuGet packages for .NET projects
https://api.github.com/repos/chakra-core/ChakraCore/issues/6586/comments
3
2021-01-27T20:11:49Z
2021-01-28T15:49:58Z
https://github.com/chakra-core/ChakraCore/issues/6586
795,409,483
6,586
[ "chakra-core", "ChakraCore" ]
The folder `bin/rl` contains source and build files for rl.exe this is a windows only test runner application, it is currently built and used by the CI on windows. BUT I can't see anything it does that `test/runtests.py` can't do. Unless anyone has an objection? We should: 1. [x] update `test/runtests.py` to be fully functional on windows (if it isn't) 2. [x] update `test/jenkins.testone.cmd` to call runtests.py instead of `runtests.cmd` 3. [ ] Delete `runtests.cmd` (wrapper script around rl.exe) 4. [ ] Delete `bin/rl` and all references to it The one key reason I could see not to do this is if `rl.exe` is significantly faster than `runtests.py` (if so we should contemplate getting rid of `runtests.py` instead though that would be more work) - best way I can see to test this is to update `runtests.py` to handle windows then change the CI to run on it and see what happens.
Explore deleting rl.exe
https://api.github.com/repos/chakra-core/ChakraCore/issues/6585/comments
8
2021-01-26T18:49:31Z
2021-03-20T09:17:17Z
https://github.com/chakra-core/ChakraCore/issues/6585
794,475,876
6,585
[ "chakra-core", "ChakraCore" ]
`BUILD.gn` in the project root is a build script for use with the GN build system, see: https://gn.googlesource.com/gn/+/master/docs/quick_start.md It redirects to `tools/run_msbuild.py` which only works on windows. I've never heard of the GN build system before is there any clear benefit of having a script for it, particularly a windows only one? If yes should mention it in the building section of our readme if no should delete both these files. Opinions?
Document or delete BUILD.gn
https://api.github.com/repos/chakra-core/ChakraCore/issues/6584/comments
5
2021-01-25T22:19:24Z
2021-01-28T05:06:45Z
https://github.com/chakra-core/ChakraCore/issues/6584
793,768,225
6,584
[ "chakra-core", "ChakraCore" ]
###### Version chakra-1.11.24 ###### Test case ```js var arr = []; Object.defineProperty(Array.prototype, '0', { get: function() { print('get'); return 30; }, set: function() { print('set'); return 60; } }); arr.push(1); print('arr:', arr); print('arr:', arr[0]); ``` ###### Execution steps ./ChakraCore/out/Release/ch testcase.js ###### Output ``` arr: 1 arr: 1 ``` ###### Expected behavior ``` set arr: get 30 get arr: 30 ``` ###### Description When executing the above test case, when executing `arr.push` in line 14, other engines (such as v8, SpiderMonkey, JavascriptCore, etc.) all call the `set` method defined in line 8, and then execute the `get` method defined in line 4. However, chakra does not seem to do this. Is this a bug in chakra implementation?
A question about Array.prototype.push
https://api.github.com/repos/chakra-core/ChakraCore/issues/6582/comments
3
2021-01-22T06:40:31Z
2021-03-03T04:33:48Z
https://github.com/chakra-core/ChakraCore/issues/6582
791,745,374
6,582
[ "chakra-core", "ChakraCore" ]
Google Summer Of Code will start accepting applications soon. As we are (now) an independent organization, we can throw our name in the hat. I believe the minimum requirements are having two mentors. Timeline: https://developers.google.com/open-source/gsoc/timeline
[Community] GSoC
https://api.github.com/repos/chakra-core/ChakraCore/issues/6579/comments
3
2021-01-15T02:25:38Z
2021-02-20T09:30:17Z
https://github.com/chakra-core/ChakraCore/issues/6579
786,481,239
6,579
[ "chakra-core", "ChakraCore" ]
Sooner or later, community will create and publish its own NuGet packages. Most likely, when creating new packages, source code of existing packages, that were developed by Microsoft, will be taken as a basis. Existing packages have certain disadvantages, so in this post I will write how it can be fixed and give examples in the form of Git Diffs. Since I am a .NET developer, I will only write about packages oriented on .NET. There are currently five such packages, but only one of them has been published ([Microsoft.ChakraCore](https://www.nuget.org/packages/Microsoft.ChakraCore)). 1. **Abandon using a temporary files to specify package versions.** Currently, the `compiled.nuspec` temporary file is used to dynamically specify a versions of NuGet packages. I suggest using the [built-in feature](https://docs.microsoft.com/en-us/nuget/reference/nuspec#replacement-tokens) of NuGet package manager instead of creating a temporary file. [Pull request](https://github.com/chakra-core/ChakraCore/pull/6566) has already been created to solve this problem. 1. **Do not specify a target framework for package.** Current versions of packages are targeted to .NET Standard 1.0, because of this, they cannot be used in projects oriented on .NET Framework 4.0 or earlier. For packages that contain only native assemblies, do not need to specify a target framework. Most likely, creators of packages initially generated a sample `.nuspec` file from C# project and simply did not clean up it. Therefore, we can [safely remove the target framework](https://github.com/Taritsyn/ChakraCore/commit/e4610e28b61489ff347f94170fc56290aa0fbab6). 1. **Add to MSBuild scripts a ability to deploy an Windows (ARM) assembly for the `AnyCPU` target platform.** In .NET Framework projects with installed the Microsoft.ChakraCore package, during compilation for the `AnyCPU` target platform, MSBuild script creates two subdirectories (`x86` and `x64`) in the `bin\[Debug|Release]` directory, into which it copies the corresponding assemblies. In my opinion, it is worth [implementing a similar functionality for Windows (ARM) assembly](https://github.com/Taritsyn/ChakraCore/commit/4ca4c05d3efaf58d0aeb514cd0f1dde0765bfffa), but perhaps many will not agree with this. 1. **Simplify a conditions in MSBuild scripts.** Currently, MSBuild scripts contain a large number of long conditions that are difficult not only to read, but also to understand. For example, `Exists('packages.config') Or Exists('packages.$(MSBuildProjectName).config')` condition is intended to disable MSBuild scripts in .NET Core projects, because they use a different deployment mechanism. `Exists('project.json') Or Exists('project.$(MSBuildProjectName).json')` condition doesn't make any sense in the context in which it is used. Therefore, should make [refactoring of conditions](https://github.com/Taritsyn/ChakraCore/commit/ee98fffe127c1bff92773158b07a5e4063465b99). 1. **Use a more general RID's.** In the names of runtime directories are used is quite specific [RID](https://docs.microsoft.com/en-us/dotnet/core/rid-catalog)'s: `win7-x86`, `win7-x64` and `win8-arm`. Usage of such identifiers was justified in early releases of .NET Core 1.0, but for now it's better to [switch to using more general identifiers](https://github.com/Taritsyn/ChakraCore/commit/9a39edb69b13dbf2dc2a222d0bdff8b8e0412925): `win-x86`, `win-x64` and `win-arm`. 1. **Use a `license` element.** Currently, when building packages, the following warning is issued: “WARNING: NU5125: The 'licenseUrl' element will be deprecated. Consider using the 'license' element instead.”. To solve this problem, it is necessary to [replace the `licenseUrl` element by the `license` element](https://github.com/Taritsyn/ChakraCore/commit/9e622429bc1141a8d7d96eb56f85a7c3b9bfd786). 1. **Switch to the new symbol package format.** [NuGet.org](https://www.nuget.org/) only accepts the new symbol package format - `.snupkg`. Therefore, it is necessary to add support for the `.snupkg` format to the `Microsoft.ChakraCore.Symbols.nuspec` file. I will not give an example, because for this it is necessary to make many changes to the `package.ps1` file. I am ready to implement each of these recommendations in the form of pull request. Also in the near future I plan to write recommendations for a new structure of NuGet packages. I have already written [something similar for the ClearScript project](https://github.com/microsoft/ClearScript/issues/209), but in this case I also want to give an example of implementation.
Recommendations for improving an existing NuGet packages for .NET projects
https://api.github.com/repos/chakra-core/ChakraCore/issues/6572/comments
0
2021-01-09T18:30:54Z
2021-01-24T19:25:20Z
https://github.com/chakra-core/ChakraCore/issues/6572
782,661,569
6,572
[ "chakra-core", "ChakraCore" ]
We are using UTF-16, which has some cross platform compatibility issues, starting with different type used on different platforms - `wchar_t` on Windows and `char16_t` everywhere else, with former being a fundamental type (not requiring an include), but latter - defined as an unsigned short. This is thanks to 'nix toolchains picking UTF-32 (which is excessive for most uses) as default Unicode type. UTF-8 is more cross platform, and supported in Windows [since Win10][w]. For prior versions of Windows it should be possible to convert to UTF-16 for things that require it. A quick search shows that V8 might use UTF-8. I am not sure whether or not UTF-8 would be easier for our text-related projects, like RegEx support. @rhuanjl do you have any thoughts? [w]: https://en.wikipedia.org/wiki/Unicode_in_Microsoft_Windows#UTF-8
Consider UTF-8?
https://api.github.com/repos/chakra-core/ChakraCore/issues/6570/comments
12
2021-01-09T03:10:28Z
2021-03-14T19:00:31Z
https://github.com/chakra-core/ChakraCore/issues/6570
782,499,802
6,570
[ "chakra-core", "ChakraCore" ]
###### Version chakra-9e2f198 ###### Test case ```js var a = RegExp(1); RegExp.prototype.toString.call(a); var b = Object(1); RegExp.prototype.toString.call(b); ``` ###### Execution steps ./ChakraCore/out/Release/ch testcase.js ###### Output ``` TypeError: RegExp.prototype.toString: 'this' is not a RegExp object ``` ###### Expected behavior ``` ``` ###### Description I checked the ES standard and found that the standard only stipulates that the `this` value of `RegExp.prototype.toString` must be an object, but chakra requires `this` value to be a regular object. May I know what is the reason? According to ES2019 standard, the steps of `RegExp.prototype.toString` are as follows. > 21.2.5.15RegExp.prototype.toString ( ) > > 1. Let R be the this value. > 2. If [Type](http://www.ecma-international.org/ecma-262/10.0/index.html#sec-ecmascript-data-types-and-values)(R) is not Object, throw a TypeError exception. > 3. Let pattern be ? [ToString](http://www.ecma-international.org/ecma-262/10.0/index.html#sec-tostring)(? [Get](http://www.ecma-international.org/ecma-262/10.0/index.html#sec-get-o-p)(R, `"source"`)). > 4. Let flags be ? [ToString](http://www.ecma-international.org/ecma-262/10.0/index.html#sec-tostring)(? [Get](http://www.ecma-international.org/ecma-262/10.0/index.html#sec-get-o-p)(R, `"flags"`)). > 5. Let result be the [string-concatenation](http://www.ecma-international.org/ecma-262/10.0/index.html#sec-ecmascript-language-types-string-type) of `"/"`, pattern, `"/"`, and flags. > 6. Return result. The ECMAScript standard reference is as follow: http://www.ecma-international.org/ecma-262/10.0/index.html#sec-regexp.prototype.tostring
A question about RegExp.prototype.toString
https://api.github.com/repos/chakra-core/ChakraCore/issues/6569/comments
4
2021-01-09T02:46:22Z
2021-01-09T11:27:10Z
https://github.com/chakra-core/ChakraCore/issues/6569
782,496,635
6,569
[ "chakra-core", "ChakraCore" ]
We have 'Microsoft' in NuGet package IDs (plus in the files describing packages). Need to decide how to rename - right now it is 'Microsoft.ChakraCore', 'ChakraCore.ChakraCore' might be a bit redundant. This falls under the same umbrella as the rest of renaming, though it carries some extra weight as it is externally facing.
Rename NuGet packages
https://api.github.com/repos/chakra-core/ChakraCore/issues/6568/comments
0
2021-01-08T03:31:16Z
2021-01-08T03:31:16Z
https://github.com/chakra-core/ChakraCore/issues/6568
781,814,874
6,568
[ "chakra-core", "ChakraCore" ]
###### Version chakra-9e2f198 ###### Test case ```js TypeError.prototype.toString = function() { return Error; }; var a = 1; a(); ``` ###### Execution steps ./ChakraCore/out/Release/ch testcase.js ###### Output ``` ``` ###### Expected behavior ``` TypeError: a is not a function ``` ###### Description In the above test case, we redefine `TypeError`, but there is an exception in the redefined function (line 2). When executing the code, since `a` is not a function, `TypeError` will be thrown in line 5. Other engines seem to ignore the exception when redefining `TypeError` (line 2) when executing, and throw a `TypeError` exception normally, but chakra didn't . This seems to be incorrect.
An issue about redefining TypeError
https://api.github.com/repos/chakra-core/ChakraCore/issues/6567/comments
12
2021-01-07T07:50:40Z
2021-01-27T10:04:32Z
https://github.com/chakra-core/ChakraCore/issues/6567
781,109,774
6,567
[ "chakra-core", "ChakraCore" ]
Chakra has a lot of useful config options, but it's quite hard to realize if the needed option exists. My proposition is to create such documentation.
Document config options documentation
https://api.github.com/repos/chakra-core/ChakraCore/issues/6565/comments
3
2021-01-04T08:52:37Z
2021-01-06T07:37:01Z
https://github.com/chakra-core/ChakraCore/issues/6565
777,934,382
6,565
[ "chakra-core", "ChakraCore" ]
In the file JavascriptLibrary.cpp various objects (particularly builtin constructors and prototypes) have initialization methods when properties of one of these objects are first accessed the initialization method is called to set them all. Each method begins by doing `typeHandler->Convert(object, mode, slots);` which allocates a row with enough memory for `slots` number of properties to be set on the object. A cursory review shows that many of these are setting the wrong number of slots - normally too few meaning that by the end of the Initialization method the row has to be resized to store all of the properties - though in some cases it's too high so excess memory is being allocated. This has happened because as ChakraCore has been developed more and more properties have been aded and `slots` numbers have not been consistently updated. The file should be updated to have the correct numbers AND assertions should be added to prevent these numbers going wrong in the future. (Note I began this offline BUT the related issue #6562 prevented me completing it - I think that that needs to be done first)
JavascriptLibrary.cpp Initialization methods with wrong property counts
https://api.github.com/repos/chakra-core/ChakraCore/issues/6563/comments
0
2020-12-31T14:40:16Z
2020-12-31T14:41:53Z
https://github.com/chakra-core/ChakraCore/issues/6563
777,049,205
6,563
[ "chakra-core", "ChakraCore" ]
**Currently the file JsBuiltins.js contains:** 1. Several array.prototype methods 2. Two Math methods 3. One Object constructor method **This has a few downsides:** 1. Simply for readability/comprehension this set of methods do not logically belong in the same file 2. Accessing a Math method should not force initialisation of the Array prototype and vice versa (same with the Object constructor) - there is a small runtime memory and performance cost in some instances due to this unnecessary initialisation. 3. As Initialising the Array Prototype, Object Constructor OR Math object forces the initialisation of the other two the order that properties are added to them is unpredictable - this makes maintenance of the Initialization methods harder. **Solution: the file should be split into 3 Array.js, Object.js and Math.js** Hurdles to overcome: 1. Logic for regenerating the bytecode as 3 seperate files - possibly into one header though as 3 arrays to avoid increasing the number of generated files. (in an ideal world they would be created as a build step - but that's not exactly easy see #6410) 2. Logic for loading the code to only load the one that's needed.
Split JsBuiltins by Class
https://api.github.com/repos/chakra-core/ChakraCore/issues/6562/comments
0
2020-12-31T14:34:12Z
2021-02-01T08:51:04Z
https://github.com/chakra-core/ChakraCore/issues/6562
777,047,566
6,562
[ "chakra-core", "ChakraCore" ]
###### Chakra Version Latest Commit 9e2f198 (Release Version) ###### Test case ```js if (1) ``` ###### Execution steps ./ChakraCore/out/Release/ch testcase.js ###### Expected behavior ``` SyntaxError: Unexpected end of script ``` ###### Actual behavior ``` (No exception was thrown) ``` ###### Description Obviously this is a syntax error, however CC does not throw any exceptions. I've tried other engines, and they all throw SyntaxError, So i suspect it's a bug.
A possible issue with CC not throwing syntax exceptions correctly
https://api.github.com/repos/chakra-core/ChakraCore/issues/6553/comments
2
2020-12-26T03:03:52Z
2020-12-26T12:45:29Z
https://github.com/chakra-core/ChakraCore/issues/6553
774,813,341
6,553
[ "chakra-core", "ChakraCore" ]
This warning is thrown when building master on macOS. From lib/Common/Common/NumberUtilities_strtod.cpp line 1602 This should be fixed probably by adding brackets to that line in the correct place.
warning: unsequenced modification and access to 'ib'
https://api.github.com/repos/chakra-core/ChakraCore/issues/6552/comments
0
2020-12-25T15:37:51Z
2021-01-02T10:48:23Z
https://github.com/chakra-core/ChakraCore/issues/6552
774,750,373
6,552
[ "chakra-core", "ChakraCore" ]
###### Chakra Version Latest [1.11.24](https://github.com/chakra-core/ChakraCore/releases) Linux(x64) ###### Test case ```js function func() { this++; } ``` ###### Execution steps ChakraCoreFiles/bin/ch testcase.js ###### Expected behavior ``` SyntaxError: Invalid left-hand side expression in postfix operation ``` ###### Actual behavior ``` (No exception was thrown) ``` ###### Description It is a SyntaxError so it should be thrown whether executed or not. I've tried other engines, and they all throw SyntaxError, So i suspect it's a bug. Looking forward to your reply, thanks! 😆 BTW,I also tried it in the Edge browser , which threw a SyntaxError.
A possible issue with '++' operator apply to 'this' object
https://api.github.com/repos/chakra-core/ChakraCore/issues/6550/comments
1
2020-12-25T02:38:08Z
2020-12-25T15:44:52Z
https://github.com/chakra-core/ChakraCore/issues/6550
774,605,519
6,550
[ "chakra-core", "ChakraCore" ]
The readme could do with an overhaul to make clear that this project is now owned by the community. And to be clearer on inviting involvement. All references to microsoft should be moved to a history/background section.
Update the readme
https://api.github.com/repos/chakra-core/ChakraCore/issues/6549/comments
3
2020-12-24T23:10:39Z
2021-01-09T11:18:03Z
https://github.com/chakra-core/ChakraCore/issues/6549
774,578,942
6,549
[ "chakra-core", "ChakraCore" ]
Now the repository is in community control, files need a new copyright banner. We need to retain the existing one BUT should add an extra piece below it about community contribution as any new code will not be written by Microsoft. Alongside that we probably need a new contributor license agreement.
Update the copyright text
https://api.github.com/repos/chakra-core/ChakraCore/issues/6548/comments
5
2020-12-24T19:31:49Z
2021-01-15T21:40:00Z
https://github.com/chakra-core/ChakraCore/issues/6548
774,544,101
6,548
[ "chakra-core", "ChakraCore" ]
Microsoft have transferred the repository into our control. We now need to activate our own CI. In the first instance this will be largely based on the check in CI microsoft was running. (though we need our own instance of it all as the existing webhooks no longer function)
Enable our own CI
https://api.github.com/repos/chakra-core/ChakraCore/issues/6547/comments
21
2020-12-24T19:26:34Z
2021-02-12T22:19:20Z
https://github.com/chakra-core/ChakraCore/issues/6547
774,543,228
6,547
[ "chakra-core", "ChakraCore" ]
###### Version chakra-1.11.22(release) ###### Test case ```js if (1) { function o() {}; var o = 1; } print(o); ``` ###### Execution steps ./ChakraCore/out/Release/ch testcase.js ###### Output ``` function o() {} ``` ###### Expected behavior ``` throw a SyntaxError about redeclaration of function o ``` ###### Description In above test case, I redeclared `o`, but Chakra neither threw an exception nor redeclared successfully. I think this may be misleading to users, since there is no error, the user will think that the statement was executed successfully. I've tried other engines, and they all throw `SyntaxError`, So i suspect it's a bug. Please let me know the result whether this is a bug or not. Looking forward to your reply, thanks! 😆
A possible issue about variable redeclaration of ChakraCore.
https://api.github.com/repos/chakra-core/ChakraCore/issues/6546/comments
3
2020-12-24T09:57:34Z
2020-12-25T02:38:42Z
https://github.com/chakra-core/ChakraCore/issues/6546
774,305,035
6,546
[ "chakra-core", "ChakraCore" ]
The flag NTBUILD is used to guard various features included in chakra.dll but not in chakracore, I believe that most of the code behind it is not functional without additional code that is not in this repository and is unlikely to be made available. We should therefore review and consider deleting as dead code anything wrapped with `#ifdef NTBUILD`. There is a possibility that some of this code could be usable for some other purpose - hence a review rather than immediate deletion. Additionally the following flags are turned on by enabling NTBUILD - each of these should be individually reviewed and any code behind them considered for deletion as dead, again should consider in each case if the code can be repurposed or used without the additional code this repository does not contain: - [x] ENABLE_PROJECTION - [ ] ENABLE_FOUNDATION_OBJECT - [x] ENABLE_EXPERIMENTAL_FLAGS - [ ] ENABLE_WININET_PROFILE_DATA_CACHE - [ ] ENABLE_COMPRESSION_UTILITIES - [ ] ENABLE_BASIC_TELEMETRY - [x] ENABLE_DOM_FAST_PATH - [ ] EDIT_AND_CONTINUE - [ ] ENABLE_JIT_CLAMP - [ ] ENABLE_SCRIPT_PROFILING
Review flag NTBUILD
https://api.github.com/repos/chakra-core/ChakraCore/issues/6544/comments
8
2020-12-18T16:22:09Z
2021-01-12T11:38:07Z
https://github.com/chakra-core/ChakraCore/issues/6544
771,010,835
6,544
[ "chakra-core", "ChakraCore" ]
Hello, executing following code in ch 1.11.24(debug), an assertion will be thrown. ``` function opt(buffer) { let obj = [2.3023e-320]; var result = buffer.slice(obj.x, obj.x); } function main() { for (let i = 0; i < 1000; i++) { var buffer = new ArrayBuffer(8); opt(buffer); } buffer = new ArrayBuffer(2147483647); opt(buffer); } main(); ``` output: ``` ASSERTION 26608: (c:\users\sunlili\documents\workspace\jsenginesfordebug\chakracore-1.11.24\lib\runtime\library\arraybuffer.cpp, line 569) newLen < MaxArrayBufferLength Failure: (newLen < MaxArrayBufferLength) FATAL ERROR: ch.exe failed due to exception code c0000420 ``` <img width="772" alt="tmp" src="https://user-images.githubusercontent.com/10752186/102328403-fe24e180-3fc1-11eb-831c-f125035e4544.png"> `newLen` is 0x7fffffff, which equals to MaxArrayBufferLength. I think the assertion should be 'newLen <= MaxArrayBufferLength'. ISec Lab. 2020.12.16
Assertion failure in ArrayBuffer::EntrySlice()
https://api.github.com/repos/chakra-core/ChakraCore/issues/6543/comments
1
2020-12-16T09:18:16Z
2020-12-16T20:07:31Z
https://github.com/chakra-core/ChakraCore/issues/6543
768,619,676
6,543
[ "chakra-core", "ChakraCore" ]
Hello, executiong following code in ch 1.11.24(debug), an assertion will be thrown. ``` function opt(obj) { obj.method(); } for(let i = 0; i < 1000; i++) { var obj = { method() { fromA = super['fromA']; } }; opt(obj); } ``` output: ``` ASSERTION 35284: (c:\users\sunlili\documents\workspace\jsenginesfordebug\chakracore-1.11.24\lib\backend\globopt.cpp, line 3228) !profiledValueType.IsDefinite() Failure: (!profiledValueType.IsDefinite()) FATAL ERROR: ch.exe failed due to exception code c0000420 ``` <img width="838" alt="tmp" src="https://user-images.githubusercontent.com/10752186/102326973-07ad4a00-3fc0-11eb-86d0-f275e1982517.png"> There is no Likely tag in profiledValueType, so the assertion fails. I am confused about this crash, however, it should be a JIT compiler bug. ISec Lab. 2020.12.16
Assertion failure in GlobOpt::SetLoopFieldInitialValue()
https://api.github.com/repos/chakra-core/ChakraCore/issues/6542/comments
1
2020-12-16T09:03:45Z
2020-12-16T20:12:35Z
https://github.com/chakra-core/ChakraCore/issues/6542
768,607,118
6,542
[ "chakra-core", "ChakraCore" ]
Hello, executing following code in ch 1.22.24(debug), an assertion will be thrown. ``` var buffer = new Int8Array(8); var func = function (elem) { return elem; }; i = 9007199254740992; Object.defineProperty(buffer, 'length', { value: i }); Array.prototype.find.call(buffer, func); ``` output: ``` ASSERTION 2480: (c:\users\sunlili\documents\workspace\jsenginesfordebug\chakracore-1.11.24\lib\runtime\library\javascriptarray.cpp, line 8558) length <= UINT_MAX Failure: (length <= 0xffffffff) FATAL ERROR: ch.exe failed due to exception code c0000420 ``` <img width="865" alt="tmp" src="https://user-images.githubusercontent.com/10752186/102324112-4e994080-3fbc-11eb-8069-73812b04cb30.png"> 9007199254740992 is larger than Math::MAX_SAFE_INTEGER, so ch modified the `length` to Math::MAX_SAFE_INTEGER(9007199254740991 or 0x1F FFFF FFFF FFFF). Although `length` is modified larger than buffer's size, there is an index checking in `BaseTypedDirectGetItem(__in uint32 index)`, which gets the real size of `buffer`, so the bug will not cause OOB access. ISec Lab. 2020.12.16
Assertion failure in JavascriptArray::FindHelper()
https://api.github.com/repos/chakra-core/ChakraCore/issues/6541/comments
5
2020-12-16T08:45:27Z
2021-01-16T19:26:55Z
https://github.com/chakra-core/ChakraCore/issues/6541
768,591,816
6,541
[ "chakra-core", "ChakraCore" ]
Hello, running following code in ch 1.11.24(debug), an assertion will be thrown. ``` var start; var end; function opt(buffer) { var sc = WScript.LoadScript('', 'samethread'); buffer += 0; var result = buffer.slice(start, end); return sc; } for (var i = 0; i < 2; i++) { var buffer = new ArrayBuffer(8); end = opt(buffer); } ``` output: ``` ASSERTION 25452: (c:\users\sunlili\documents\workspace\jsenginesfordebug\chakracore-1.11.24\lib\runtime\language\javascriptoperators.cpp, line 10982) !RecyclableObject::Is(instance) ? TRUE : ((RecyclableObject*)instance)->GetScriptContext()->GetLibrary() == library Failure: (!RecyclableObject::Is(instance) ? 1 : ((RecyclableObject*)instance)->GetScriptContext()->GetLibrary() == library) FATAL ERROR: ch.exe failed due to exception code c0000420 ``` <img width="873" alt="tmp" src="https://user-images.githubusercontent.com/10752186/102322909-c23a4e00-3fba-11eb-9eeb-bf9c543e36f5.png"> This assertion is triggered in the second time executing `buffer.slice(start, end)`. The `end` is redefined after first calling `opt`, and it becomes a `Js::CrossSiteObject<Js::GlobalObject>`. So when checking in `JavascriptString::EntrySlice()`, the assertion is triggered. ISec Lab. 2020.12.16
Assertion failure in JavascriptOperators::IsUndefinedObject()
https://api.github.com/repos/chakra-core/ChakraCore/issues/6540/comments
1
2020-12-16T08:21:58Z
2020-12-16T20:27:48Z
https://github.com/chakra-core/ChakraCore/issues/6540
768,574,664
6,540
[ "chakra-core", "ChakraCore" ]
Hello, executing following code in ch 1.11.24(debug), an assertion will be thrown. ``` 'use strict'; function func(arr) { var a = new Promise(function() {}); arr.__proto__.__proto__ = a; } for (var i = 0; i < 2; i++) { var arr = [ , {} ]; Object.prototype.toString.call(Array()); func(arr); } ``` output: ``` ASSERTION 14228: (c:\users\sunlili\documents\workspace\jsenginesfordebug\chakracore-1.11.24\lib\runtime\language\inlinecache.h, line 471) *propertyValue == slowPathValue || (RootObjectBase::Is(propertyObject) && *propertyValue == rootObjectValue) || (slowPathValue == requestContext->GetLibrary()->GetNull() && requestContext->GetThreadContext()->IsDisableImplicitCall() && propertyObject->GetType()->IsExternal()) Failure: (*propertyValue == slowPathValue || (RootObjectBase::Is(propertyObject) && *propertyValue == rootObjectValue) || (slowPathValue == requestContext->GetLibrary()->GetNull() && requestContext->GetThreadContext()->IsDisableImplicitCall() && propertyObject->GetType()->IsExternal())) FATAL ERROR: ch.exe failed due to exception code c0000420 ``` <img width="871" alt="tmp" src="https://user-images.githubusercontent.com/10752186/102318625-9a47ec00-3fb4-11eb-876b-603f93825044.png"> The assertion is triggered when the second time executing `Object.prototype.toString.call(Array())`. According to [http://www.ecma-international.org/ecma-262/#sec-object.prototype.tostring], toString should get `@@toStringTag`. https://github.com/microsoft/ChakraCore/blob/7d4bdd821d452d6b91a21936257d7e352ea7dc4b/lib/Runtime/Library/JavascriptObject.cpp#L444-L445 Since Array does not contain `@@toStringTag`, `undefined` is fetched for the first time, and the value is stored in inline cache. After calling `func(arr)`, Array contains `@@toStringTag`, which is inherited by the Promise object. However, the value in inline cache is not invalid. When `Object.prototype.toString.call(Array())` is executed again, the assertion is triggered and the old value `undefined` is fetched. ISec Lab. 2020.12.16
Assertion failure in OutputPropertyValue<T>::impl
https://api.github.com/repos/chakra-core/ChakraCore/issues/6539/comments
1
2020-12-16T08:04:46Z
2020-12-16T20:38:13Z
https://github.com/chakra-core/ChakraCore/issues/6539
768,562,913
6,539
[ "chakra-core", "ChakraCore" ]
Hello, running following code in ch 1.11.24(debug), an assertion will be thrown. ``` function opt(start) { ' ' == String.fromCodePoint(start); } for(let i = 0; i < 1000; i++) opt(0); opt(2147483647); ``` output: ``` ASSERTION 13460: (c:\users\sunlili\documents\workspace\jsenginesfordebug\chakracore-1.11.24\lib\common\common\numberutilities_strtod.cpp, line 2711) codePointValue <= 0x10FFFF Failure: (codePointValue <= 0x10FFFF) FATAL ERROR: ch.exe failed due to exception code c0000420 ``` <img width="861" alt="tmp" src="https://user-images.githubusercontent.com/10752186/102316536-0e809080-3fb1-11eb-9f53-a822d7c065d3.png"> `2147483647` is 0x7fffffff, which is an invalid code point value. `String.fromCodePoint()` should throw an Range Error when handling an invalid code point. It seems that the jitted code needs more checks before call `GetStringForCharCodePoint()`. ISec Lab. 2020.12.16
An Assertion triggered by Js::NumberUtilities::IsInSupplementaryPlane() in jitted code
https://api.github.com/repos/chakra-core/ChakraCore/issues/6538/comments
1
2020-12-16T07:21:13Z
2020-12-16T20:42:12Z
https://github.com/chakra-core/ChakraCore/issues/6538
768,534,452
6,538
[ "chakra-core", "ChakraCore" ]
Hello, executing following code, an assertion will be throw. ``` var eval = WScript.LoadScript('', 'samethread').eval; for (let i = 0; i < 1; i++) { eval('for(var x in [1,2,3,4])( /x/ );'); } ``` output: ``` ASSERTION 23500: (c:\users\sunlili\documents\workspace\jsenginesfordebug\chakracore-1.11.24\lib\runtime\types\activationobject.h, line 65) BlockActivationObject::Is(value) Failure: (BlockActivationObject::Is(value)) FATAL ERROR: ch.exe failed due to exception code c0000420 ``` <img width="870" alt="tmp" src="https://user-images.githubusercontent.com/10752186/102315366-01fb3880-3faf-11eb-8ce0-ef0c0f7cd875.png"> When handling the bytecode CloneBlockScope of eval, it will get `scope` variable, which is the `value` in assertion. The `value` object is Js::CrossSiteObject<Js::BlockActivationObject>, which fails the assertion. ISec Lab. 2020.12.16
Assertion failure in BlockActivationObject* FromVar(Var value)
https://api.github.com/repos/chakra-core/ChakraCore/issues/6537/comments
1
2020-12-16T07:05:40Z
2020-12-16T20:43:35Z
https://github.com/chakra-core/ChakraCore/issues/6537
768,522,896
6,537
[ "chakra-core", "ChakraCore" ]
Hi, execution following code in ch 1.11.24(debug), an assertion will be thrown. ``` var arr = [1,2,3,4]; var handler = {}; Object.defineProperty(arr, 'length', { writable:false }); p = new Proxy(arr, handler); Object.prototype.push = Array.prototype.push; p.push(1); ``` output: ``` ASSERTION 7624: (c:\users\sunlili\documents\workspace\jsenginesfordebug\chakracore-1.11.24\lib\runtime\language\javascriptoperators.cpp, line 9023) TypedArrayBase::Is(obj) Failure: (TypedArrayBase::Is(obj)) FATAL ERROR: ch.exe failed due to exception code c0000420 ``` <img width="888" alt="tmp" src="https://user-images.githubusercontent.com/10752186/102314174-f73fa400-3fac-11eb-9358-9bae5db4d004.png"> After redefining the property 'length' of `arr` unwritable, `arr` convert into an ES5Array. However, the assertion think it should handle a TypedArray object. ISec Lab. 2020.12.16
Assertion failure in JavascriptOperators::ValidateAndApplyPropertyDescriptor()
https://api.github.com/repos/chakra-core/ChakraCore/issues/6536/comments
1
2020-12-16T06:48:52Z
2020-12-16T20:51:43Z
https://github.com/chakra-core/ChakraCore/issues/6536
768,510,699
6,536
[ "chakra-core", "ChakraCore" ]
Hi, executing following code in ch 1.11.24(debug), an assertion will be thrown. ``` array = []; proxy = new Proxy(array, { get(t, pk, r) { if (pk === 'length') { return 2 ** 53; } return Reflect.get(t, pk, r); } }); proxy.copyWithin(3); ``` output: ``` ASSERTION 5676: (c:\users\sunlili\documents\workspace\jsenginesfordebug\chakracore-1.11.24\lib\common\exceptions\throw.cpp, line 103) Js reentrancy error!! Failure: (false) FATAL ERROR: ch.exe failed due to exception code c0000420 ``` <img width="868" alt="tmp" src="https://user-images.githubusercontent.com/10752186/102312632-096c1300-3faa-11eb-9411-eb8ad3849da3.png"> I guess this bug can be fixed by adding JS_REENTRANT() to wrap `OP_DeleteElementI()`, and I find it has been added in master branch. You can recheck whether this poc still crash in master. ISec Lab. 2020.12.16
Assertion failure in JavascriptArray::CopyWithinHelper
https://api.github.com/repos/chakra-core/ChakraCore/issues/6535/comments
1
2020-12-16T06:33:36Z
2020-12-16T21:25:17Z
https://github.com/chakra-core/ChakraCore/issues/6535
768,500,202
6,535
[ "chakra-core", "ChakraCore" ]
Hello, running following code in ch1.11.24(debug), an assertion will be thrown. ``` vdate = new Date(1234567890123).getVarDate(); JSON.stringify(vdate, true); ``` output: ``` ASSERTION 28300: (c:\users\sunlili\documents\workspace\jsenginesfordebug\chakracore-1.11.24\lib\runtime\library\jsonstringifier.cpp, line 745) UNREACHED Failure: ((0)) FATAL ERROR: ch.exe failed due to exception code c0000420 ``` <img width="865" alt="tmp" src="https://user-images.githubusercontent.com/10752186/102300951-dbc6a000-3f90-11eb-85b3-3ed55d70c71a.png"> `vdate` is a Js::JavascriptVariantDate object, whose typeID is 10. Since TypeIds_VariantDate (10) < TypeIds_LastJavascriptPrimitiveType (21), it isn't be treated as object type in `JavascriptOperators::IsObject(_In_ RecyclableObject* instance)`. https://github.com/microsoft/ChakraCore/blob/7d4bdd821d452d6b91a21936257d7e352ea7dc4b/lib/Runtime/Library/JSONStringifier.cpp#L888-L899 Finally, it fails to pass the check in JSONStringifier.cpp:888, and go into line 897. In ReadData(), the assertion is triggered. ISec Lab. 2020.12.16
Assertion failure in JSONStringifier.cpp caused by incorrect type checking
https://api.github.com/repos/chakra-core/ChakraCore/issues/6534/comments
2
2020-12-16T03:29:16Z
2021-01-02T10:48:23Z
https://github.com/chakra-core/ChakraCore/issues/6534
768,415,917
6,534
[ "chakra-core", "ChakraCore" ]
New Mac computers now come with ARM processors; ChakraCore should support them natively and currently does not. Fixing this will involve some small code changes and some make file work. Note, currently ChakraCore does not support linux on ARM either - there is a separate issue for linux.
macOS arm support
https://api.github.com/repos/chakra-core/ChakraCore/issues/6532/comments
1
2020-12-12T15:29:58Z
2023-01-13T16:45:20Z
https://github.com/chakra-core/ChakraCore/issues/6532
763,960,205
6,532
[ "chakra-core", "ChakraCore" ]
Hi, I'm working on fuzz testing, and now i have a batch of js testcases, i want to get the **code coverage of ChakraCore** by executing testcases. (not coverage of testcases, i don't care it.). Because I want to use the increase of engine coverage as one of my performance metrics. I've looked at a lot of info, and it looks like it can be done with some C/C++ tools, but I'm not familiar with C/C++, So could you tell if there is such a feature built in ChakraCore? If not, can you give me some advice about how to meet my needs? Thanks guys, I'll be waiting for your reply. :laughing:
How to get the code coverage of ChakraCore by executing js testcases?
https://api.github.com/repos/chakra-core/ChakraCore/issues/6529/comments
3
2020-11-18T03:19:59Z
2020-11-24T04:51:01Z
https://github.com/chakra-core/ChakraCore/issues/6529
745,292,588
6,529
[ "chakra-core", "ChakraCore" ]
When I create an Error object and give it two parameters, the value of the second parameter will be output when the object is output. But like other engines, such as V8, spidermonkey, the output is the first parameter. Therefore, I think there may be a problem here. **Version** chakra-1_11_22 **command** ```javascript ./ChakraCore/out/Debug/ch testcase.js ``` **testcase** ```javascript var NISLFuzzingFunc = function(){ return new Error("1","2"); }; var NISLCallingResult = NISLFuzzingFunc(); print(NISLCallingResult); ``` **Output** ```javascript Error: 2 ``` **Expected behavior** ```javascript Error: 1 ``` Contributor : @Haobin-Lee
An issue about the new Error().
https://api.github.com/repos/chakra-core/ChakraCore/issues/6527/comments
3
2020-11-09T02:35:44Z
2020-11-10T02:28:50Z
https://github.com/chakra-core/ChakraCore/issues/6527
738,627,333
6,527
[ "chakra-core", "ChakraCore" ]
As is likely obvious to anyone looking at this repository it's not very active. There has been a hope that a community team could keep ChakraCore going BUT without some more contributors with more time it's unlikely to go far. So - is anyone else: a) interested in contributing to chakracore AND b) able to actually write code Let us know and we'll see what we can plan. CC @ppenzin
Chakracore Future - Volunteers wanted
https://api.github.com/repos/chakra-core/ChakraCore/issues/6526/comments
29
2020-11-04T23:06:20Z
2021-02-12T09:43:36Z
https://github.com/chakra-core/ChakraCore/issues/6526
736,481,856
6,526
[ "chakra-core", "ChakraCore" ]
Hello, executing following code in ch 1.11.22 (debug), an assertion will be thrown. ``` function opt() { var eval = WScript.LoadScript('', 'samethread').eval; eval(''); } opt(); opt(); ``` output: ``` ASSERTION 17636: (c:\users\sunlili\documents\workspace\jsenginesfordebug\chakracore-1.11.22\lib\runtime\library\argumentsobject.cpp, line 43) !frameObject || ActivationObject::Is(frameObject) Failure: (!frameObject || ActivationObject::Is(frameObject)) FATAL ERROR: ch.exe failed due to exception code c0000420 ``` When `eval('')` in the first `opt()` is called, `this->localClosure`, which is `frameObject`, is Marshaled into CrossSiteObject type. However, when the latter `opt()` is called, `ActivationObject::Is(frameObject)` does not take the `Js::CrossSiteObject<T>` type into consideration. ISec Lab 2020.10.11
Assertion fail in HeapArgumentsObject's contructor
https://api.github.com/repos/chakra-core/ChakraCore/issues/6525/comments
1
2020-10-11T07:51:01Z
2020-11-06T02:54:40Z
https://github.com/chakra-core/ChakraCore/issues/6525
718,781,948
6,525
[ "chakra-core", "ChakraCore" ]
Consider the following Wasm module with two mutually recursive functions: ``` (module (type $0 (func (result i32))) (type $1 (func (result i32))) (func $0 (type 0) (call 1) ) (func $1 (type 1) (i32.const 0) (if (result i32) (then (i32.const 0) (br 1)) (else (call 0)) ) (unreachable) ) (export "runi32" (func 0)) ) ``` This can be wrapped as follows in a corresponding, self-contained JS-program: ```javascript let buffer = new Uint8Array([ 0,97,115,109,1,0,0,0,1,9,2,96,0,1,127,96,0,1,127,3,3,2,0,1,7,10,1,6,114,117,110,105,51,50,0,0,10,22,2,4,0,16,1,11,15,0,65,0,4,127,65,0,12,1,5,16,0,11,0,11 ]); let m = new WebAssembly.Instance(new WebAssembly.Module(buffer)); try { m.exports.runi32() } catch (e) { print("caught ", e.name, e.message) } ``` This consistently crashes Chakra v1.11.22.0 under both Linux and Mac OS X with a segmentation fault: ``` $ ch example.js Segmentation fault (core dumped) ``` In comparison V8, SpiderMonkey, and JavaScriptCore all throw an exception: ``` $ v8 example.js caught RangeError Maximum call stack size exceeded $ sm example.js caught InternalError too much recursion $ jsc example.js caught RangeError Maximum call stack size exceeded. ``` Note: I'm running the pre-built Chakra binaries installed via [jsvu](https://github.com/GoogleChromeLabs/jsvu). I've not tried the above in an Edge browser yet.
WebAssembly stack overflow crash
https://api.github.com/repos/chakra-core/ChakraCore/issues/6524/comments
2
2020-10-09T22:18:32Z
2021-10-30T07:59:15Z
https://github.com/chakra-core/ChakraCore/issues/6524
718,452,075
6,524
[ "chakra-core", "ChakraCore" ]
###### Version chakra-1_11_22 ###### Test case ```js var o = { get x(){} }; Object. assign(o,o); ``` ###### Execution steps ```js ./ChakraCore/out/Debug/ch testcase.js ``` ###### Output ``` ``` ###### Expected behavior ```js TypeError: Cannot set property x of [object Object] which has only a getter ``` ###### Description When the source object and target object of `Object.assign` are both objects that only contain getter properties, other engines (such as v8, spiderMonkey, JavaScriptCore, etc.) threw a `TypeError `exception, but chakra passed it normally.
An issue about Object.assign
https://api.github.com/repos/chakra-core/ChakraCore/issues/6523/comments
6
2020-10-09T12:48:12Z
2022-10-14T22:05:19Z
https://github.com/chakra-core/ChakraCore/issues/6523
718,119,063
6,523
[ "chakra-core", "ChakraCore" ]
Hello, running following code in ch 1.11.22(debug), an assertion will be thrown. ``` class MyObject_7 { constructor(v0) { this.toString = v0; } } var sc0_198 = WScript.LoadScript(new MyObject_7('', 'samethread')); ``` output: ``` ASSERTION 40340: (c:\users\sunlili\documents\workspace\jsenginesfordebug\chakracore-1.11.22\lib\runtime\base\scriptcontext.cpp, line 2742) this->threadContext->GetRecordedException() == nullptr || GetThreadContext()->HasUnhandledException() Failure: (this->threadContext->GetRecordedException() == nullptr || GetThreadContext()->HasUnhandledException()) FATAL ERROR: ch.exe failed due to exception code c0000420 ``` In release version, ch will throw an Error as expected. In debug version, value of `this->threadContext->GetRecordedException()` is not null, but the value of `GetThreadContext()->HasUnhandledException()` is false, and the contradictory conditions trigger the assertion. ISec Lab 2020.10.9
An assertion is triggered when an exception is thrown in WScript.LoadScript()
https://api.github.com/repos/chakra-core/ChakraCore/issues/6522/comments
1
2020-10-09T09:51:45Z
2020-11-06T02:55:07Z
https://github.com/chakra-core/ChakraCore/issues/6522
718,011,945
6,522
[ "chakra-core", "ChakraCore" ]
When I executed the try-catch statement without adding a parameter list to the catch, ChakraCore caused a syntax error. According to the ES10 standard, the parameter list can be omitted after the catch statement. So I think there may be a problem here. **version** chakra-1_11_22 **command** ```javascript ChakraCore/out/Debug/ch testcase.js ``` **testcase** ```javascript var NISLFuzzingFunc = function(){ try{ }catch{ } }; NISLFuzzingFunc(); ``` **Output** ```javascript SyntaxError:Expected '('. ``` **Expected behavior** ```javascript No SyntaxError occurred. ``` Contributor : @Haobin-Lee
An issue about the try statement.
https://api.github.com/repos/chakra-core/ChakraCore/issues/6520/comments
1
2020-10-08T02:52:23Z
2020-11-04T22:55:25Z
https://github.com/chakra-core/ChakraCore/issues/6520
716,978,989
6,520
[ "chakra-core", "ChakraCore" ]
When I passed NaN and an object with the "valueOf" attribute value as a callable function to the first and second parameters of Math.max, chakra did not execute this function. According to the ES10 standard, the ToNumber operation is performed on each parameter of Math.max, and the "valueOf" attribute value function of the second parameter will be executed. **version** chakra-1_11_22 **command** ```javascript ChakraCore/out/Debug/ch testcase.js ``` **testcase** ```javascript var NISLFuzzingFunc = function(){ var a = { valueOf: function(){ print(1); } }; var b = Math.max(NaN,a); }; NISLFuzzingFunc(); ``` **Output** ```javascript No output. ``` **Expected behavior** ```javascript Output 1. ``` Contributor : @Haobin-Lee
An issue about the Math.max().
https://api.github.com/repos/chakra-core/ChakraCore/issues/6519/comments
14
2020-10-08T02:18:28Z
2022-10-07T21:39:49Z
https://github.com/chakra-core/ChakraCore/issues/6519
716,968,053
6,519
[ "chakra-core", "ChakraCore" ]
When I performed a freeze operation on an initialized TypedArray, ChakraCore did not report an error, but other engines, such as SpiderMonkey and JavascriptCore, all reported errors.So I think there may be something wrong here. **version** chakra-1_11_22 **command** ```javascript ChakraCore/out/Debug/ch testcase.js ``` **testcase** ```javascript var NISLFuzzingFunc = function(){ Object.freeze(new Int8Array(1)); } NISLFuzzingFunc(); ``` **Output** ```javascript No output. ``` **Expected behavior** ```javascript TypeError:cannot redefine non-configurable property 0. ``` Contributor : @Haobin-Lee
An issue about the Object.freeze()
https://api.github.com/repos/chakra-core/ChakraCore/issues/6518/comments
2
2020-10-07T15:33:23Z
2020-12-18T14:30:52Z
https://github.com/chakra-core/ChakraCore/issues/6518
716,637,711
6,518
[ "chakra-core", "ChakraCore" ]
Hello, executing following code in ch 1.11.22(debug), an assertion will be thrown. ``` function opt() { var eval = WScript.LoadScript('', 'samethread').eval; eval('function foo() { return {x:1}; }; [...foo()[\'x\']] = [10];'); } opt(); ``` output: ``` ASSERTION 2196: (c:\users\sunlili\documents\workspace\jsenginesfordebug\chakracore-1.11.22\lib\runtime\language\interpreterstackframe.cpp, line 7724) !CrossSite::NeedMarshalVar(value, GetScriptContext()) Failure: (!CrossSite::NeedMarshalVar(value, GetScriptContext())) FATAL ERROR: ch.exe failed due to exception code c0000420 ``` When executing `SetReg(playout->Value2, thisVar)` in line 7746, the value of `thisVar` is undefined. https://github.com/microsoft/ChakraCore/blob/861a276c346746f3b87347bb094988563d7ee0a7/lib/Runtime/Language/InterpreterStackFrame.cpp#L7738-L7747 `ValidateRegValue(value)` is called in `SetReg()`, https://github.com/microsoft/ChakraCore/blob/861a276c346746f3b87347bb094988563d7ee0a7/lib/Runtime/Language/InterpreterStackFrame.cpp#L7963-L7969 and assert the `value` does not `NeedMarshal`, but the `NeedMarshalVar()` return true. https://github.com/microsoft/ChakraCore/blob/861a276c346746f3b87347bb094988563d7ee0a7/lib/Runtime/Language/InterpreterStackFrame.cpp#L7940-L7951 ISec Lab 2020.10.7
Assertion failure in interpreterstackframe.cpp when handling eval()
https://api.github.com/repos/chakra-core/ChakraCore/issues/6517/comments
2
2020-10-07T10:04:12Z
2021-01-27T09:03:29Z
https://github.com/chakra-core/ChakraCore/issues/6517
716,387,217
6,517
[ "chakra-core", "ChakraCore" ]
###### Version chakra-1_11_22 ###### Test case ```js var h = function f(a0 = function () { a2; }(), a2) { }; h(); ``` ###### Execution steps ```js ./ChakraCore/out/Debug/ch testcase.js ``` ###### Output ``` ``` ###### Expected behavior ```js ReferenceError: can't access lexical declaration `a2' before initialization ``` ###### Description When executing this test case, `a2` is not initialized before the call, other engines (such as v8, spiderMonkey, JavaScriptCore, etc.) threw a `ReferenceError`, but chakra did not do so. Is this a different implementation of chakra?
A question about uninitialized variables
https://api.github.com/repos/chakra-core/ChakraCore/issues/6516/comments
5
2020-10-05T15:46:50Z
2020-12-17T02:52:14Z
https://github.com/chakra-core/ChakraCore/issues/6516
714,956,349
6,516
[ "chakra-core", "ChakraCore" ]
###### Version chakra-1_11_22 ###### Test case ```js RegExp.prototype.exec=()=>{ print('run here'); return null; }; print(String.prototype.match()); ``` ###### Execution steps ```js ./ChakraCore/out/Debug/ch testcase.js ``` ###### Output ``` ``` ###### Expected behavior ```js run here null ``` ###### Description When executing this test case, other engines (such as v8, spiderMonkey, JavaScriptCore, etc.) seemed to associate it with RegExp.prototype.exec when calling the String.prototype.match method, but chakra did not do so. May I know what is the reason?
A question about String.prototype.match
https://api.github.com/repos/chakra-core/ChakraCore/issues/6515/comments
1
2020-10-04T16:32:19Z
2020-12-16T21:52:09Z
https://github.com/chakra-core/ChakraCore/issues/6515
714,351,110
6,515
[ "chakra-core", "ChakraCore" ]
#### Description When I try to get the flags of a regExp object, chakra returns `undefined`. Then I found that chakra not fully implements regular expression prototype at [here](https://github.com/microsoft/ChakraCore/issues/6390). Maybe RegExp.prototype.flags should be added too. #### Testcase ~~~javascript function f0(){ return /abc/igm.flags; } print(f0()); ~~~ #### Version ``` chakra-_1_11_22(release) ``` #### Output ~~~javascript undefined ~~~ #### Expected Output ~~~javascript gim ~~~ Contributor:@QuXing9
Implement RegExp.prototype.flags
https://api.github.com/repos/chakra-core/ChakraCore/issues/6514/comments
1
2020-10-03T03:27:03Z
2020-11-04T23:02:07Z
https://github.com/chakra-core/ChakraCore/issues/6514
713,993,702
6,514
[ "chakra-core", "ChakraCore" ]
## Description When using the function `RegExp()` to create a RegExp object. The object's `lastIndex` property should be 0 and the property descriptor `writable` should be true. But when i use the function `Object.defineProperty` to redefine the property `lastIndex` . Chakra failed to change its value while all other engines such as V8, SpiderMonkey, and JavascriptCore changed successfully. Is this a normal behavior of Chakra? ## Version chakra 1.11.22 ## Run Command `chakra-1_11_22/bin/ch testcase.js` ## Testcase ~~~javascript var regexp5 = new RegExp(/abc/); print(regexp5.lastIndex); Object.defineProperty(regexp5, "lastIndex", { value: "\w?\B", writable: false }); print(regexp5.lastIndex); ~~~ ## Output ~~~javascript 0 0 ~~~ ## Expected output ~~~javascript 0 w?B ~~~
RegExp.prototype.lastIndex cannot be set properly via Object.defineProperty
https://api.github.com/repos/chakra-core/ChakraCore/issues/6512/comments
1
2020-09-30T07:39:43Z
2020-12-06T10:27:59Z
https://github.com/chakra-core/ChakraCore/issues/6512
711,712,890
6,512
[ "chakra-core", "ChakraCore" ]
Git Commit: 861a276c346746f3b87347bb094988563d7ee0a7 Ubuntu 18.04 PoC: ``` const obj = { }; var a = { toString: ()=> {} }; function opt(o, zz) { function foo () { String.prototype.replace.call(o, zz, obj); } foo (); } opt({}, "zzz"); for (let xi = 0; xi < 500; xi++) { opt({}, "kkkk"); } opt(a, "llll") ``` **Assertion failed in debug and segfault in release (possible null pointer dereference)** ``` ByteCode Updward Exposed mismatch after DeadStore Mismatch Instr: s32.var = Coerce_StrOrRegex s21[LikelyCanBeTaggedValue_String].var! #0029 ByteCode Updward Exposed mismatch after DeadStore Mismatch Instr: Bailout: #0029 (BailOutOnImplicitCallsPreOp) ByteCode Register list present before Backward pass missing in DeadStore pass: s53 R5 ASSERT.ION var26087: ( /tmp/media/code/ChakraCore/lib/Backend/BackwardPass.cpp, line 8936) ByteCode Updward Exposed Used Mismatch Failure: (false) Illegal instruction ``` stack: ``` #0 0x000055555a82bd66 in BackwardPass::VerifyByteCodeUpwardExposed (this=0x154d4dbf4e00, block=0x15554ea562b0, func=0x154d4dbf6d00, trackingByteCodeUpwardExposedUsed=0x15554ea584a0, instr=0x15554ea5ac40, bytecodeOffset=41) at /tmp/media/code/ChakraCore/lib/Backend/BackwardPass.cpp:8936 #1 0x000055555a820c0f in BackwardPass::ProcessBailOutInfo (this=0x154d4dbf4e00, instr=0x15554ea5ac40, bailOutInfo=0x15554ea5ab20) at /tmp/media/code/ChakraCore/lib/Backend/BackwardPass.cpp:2714 #2 0x000055555a82b0bd in BackwardPass::ProcessPendingPreOpBailOutInfo (this=0x154d4dbf4e00, currentInstr=0x15554ea5ac40) at /tmp/media/code/ChakraCore/lib/Backend/BackwardPass.cpp:2612 #3 0x000055555a812e4a in BackwardPass::ProcessBlock (this=0x154d4dbf4e00, block=0x15554ea562b0) at /tmp/media/code/ChakraCore/lib/Backend/BackwardPass.cpp:3886 #4 0x000055555a7f5f25 in BackwardPass::OptBlock (this=0x154d4dbf4e00, block=0x15554ea562b0) at /tmp/media/code/ChakraCore/lib/Backend/BackwardPass.cpp:1711 #5 0x000055555a7f5168 in BackwardPass::Optimize (this=0x154d4dbf4e00) at /tmp/media/code/ChakraCore/lib/Backend/BackwardPass.cpp:430 #6 0x000055555a1a20fb in GlobOpt::BackwardPass (this=0x154d4dbf5aa0, tag=Js::Phase::DeadStorePhase) at /tmp/media/code/ChakraCore/lib/Backend/GlobOpt.cpp:159 #7 0x000055555a1a3087 in GlobOpt::Optimize (this=0x154d4dbf5aa0) at /tmp/media/code/ChakraCore/lib/Backend/GlobOpt.cpp:212 #8 0x000055555a13a586 in Func::TryCodegen (this=0x154d4dbf6d00) at /tmp/media/code/ChakraCore/lib/Backend/Func.cpp:456 #9 0x000055555a138da2 in Func::Codegen (alloc=0x154d4dbf75a0, workItem=0x15554ea41030, threadContextInfo=0x623000000198, scriptContextInfo=0x622000000158, outputData=0x154d4dbf7b90, epInfo=0x15554ec381b0, runtimeInfo=0x0, polymorphicInlineCacheInfo=0x15554ea88420, codeGenAllocators=0x61a0000006d8, codeGenProfiler=0x0, isBackgroundJIT=true) at /tmp/media/code/ChakraCore/lib/Backend/Func.cpp:324 #10 0x0000555559b323c3 in NativeCodeGenerator::CodeGen (this=0x613000000798, pageAllocator=0x615000002678, workItemData=0x612000000540, jitWriteData=..., foreground=false, epInfo=0x15554ec381b0) at /tmp/media/code/ChakraCore/lib/Backend/NativeCodeGenerator.cpp:894 #11 0x0000555559b3658f in NativeCodeGenerator::CodeGen (this=0x613000000798, pageAllocator=0x615000002678, workItem=0x612000000518, foreground=false) at /tmp/media/code/ChakraCore/lib/Backend/NativeCodeGenerator.cpp:1011 #12 0x0000555559b3d6d8 in NativeCodeGenerator::Process (this=0x613000000798, job=0x612000000520, threadData=0x615000002658) at /tmp/media/code/ChakraCore/lib/Backend/NativeCodeGenerator.cpp:1911 #13 0x0000555559c800b4 in JsUtil::BackgroundJobProcessor::Process (this=0x612000000218, job=0x612000000520, threadData=0x615000002658) at /tmp/media/code/ChakraCore/lib/Common/Common/Jobs.cpp:1037 #14 0x0000555559c810ca in JsUtil::BackgroundJobProcessor::Run (this=0x612000000218, threadData=0x615000002658) at /tmp/media/code/ChakraCore/lib/Common/Common/Jobs.cpp:1135 #15 0x0000555559c77f3f in JsUtil::BackgroundJobProcessor::StaticThreadProc (lpParam=0x615000002658) at /tmp/media/code/ChakraCore/lib/Common/Common/Jobs.cpp:1319 #16 0x000055555666c87d in CorUnix::CPalThread::ThreadEntry (pvParam=0x61c000001880) at /tmp/media/code/ChakraCore/pal/src/thread/pal_thread.cpp:1605 #17 0x00001555548bb6db in start_thread (arg=0x154d4dbf9700) at pthread_create.c:463 #18 0x0000155553c22a3f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95 ```
ByteCode Updward Exposed mismatch after DeadStore
https://api.github.com/repos/chakra-core/ChakraCore/issues/6511/comments
13
2020-09-28T13:40:12Z
2024-05-02T18:13:39Z
https://github.com/chakra-core/ChakraCore/issues/6511
710,274,767
6,511
[ "chakra-core", "ChakraCore" ]
Hi, running following code in ch (1.11.22, debug), the program will be terminated with segment fault. ``` var arr = [1, 2, 3, 4, 5]; Array.prototype.push.call(arr); ``` output: ``` FATAL ERROR: ch.exe failed due to exception code c0000005 ``` crash reason: `arr` is a `Js::JavascriptCopyOnAccessNativeIntArray` instance, the value of `head` field is `1`, which is the index to `CacheForCopyOnAccessArraySegments`. In `JavascriptArray::EntryPushJavascriptArrayNoFastPath()`, `JavascriptNativeIntArray::ValidateArray()` will be called, which will use `head` as a pointer. This is a type confusion bug and trigger segment fault. ISec Lab 2020.9.27
segment fault in JavascriptArray::EntryPushJavascriptArrayNoFastPath()
https://api.github.com/repos/chakra-core/ChakraCore/issues/6510/comments
4
2020-09-27T06:32:46Z
2020-11-06T04:23:41Z
https://github.com/chakra-core/ChakraCore/issues/6510
709,679,408
6,510
[ "chakra-core", "ChakraCore" ]
Assertion Failure in JavascriptArray.cpp
https://api.github.com/repos/chakra-core/ChakraCore/issues/6509/comments
0
2020-09-25T06:53:35Z
2020-09-25T07:08:14Z
https://github.com/chakra-core/ChakraCore/issues/6509
708,693,302
6,509
[ "chakra-core", "ChakraCore" ]
Hi, running following code in ch (1.11.22, debug), an assertion will be thrown. ``` function func(b, c) { b[0] = c; } function main(o, ua) { var b = new Uint32Array(0); func(b, { valueOf: () => { ua.__proto__ = new Array(4294967295); return 0; } }); Array.prototype.includes.call(ua, 6); } var o = {}; var ua = new Uint32Array(16); main(o, ua); ``` output: ``` ASSERTION 21980: (c:\users\sunlili\documents\workspace\jsenginesfordebug\chakracore-1.11.22\lib\runtime\library\javascriptarray.cpp, line 10956) IsSmallIndex() Failure: (IsSmallIndex()) FATAL ERROR: ch.exe failed due to exception code c0000420 ``` The root cause of this assertion is the condition in L4020 is inconsistent to the usage of `length.GetSmallIndex()` in L4022 https://github.com/microsoft/ChakraCore/blob/861a276c346746f3b87347bb094988563d7ee0a7/lib/Runtime/Library/JavascriptArray.cpp#L4020-L4023 ISec Lab 2020.9.25
Assertion Failure in JavascriptArray.cpp
https://api.github.com/repos/chakra-core/ChakraCore/issues/6508/comments
3
2020-09-25T06:53:14Z
2020-11-06T02:48:07Z
https://github.com/chakra-core/ChakraCore/issues/6508
708,693,102
6,508
[ "chakra-core", "ChakraCore" ]
According to ES10.0, If an object does not define or inherit `@@hasInstance` it uses the default `instanceof` semantics. When changing the value of `__proto__` of an object into `String`, the algorithm to be used will be `Function.prototype [ @@hasInstance ]` instead of the default semantics. So the output of the testcase below is `false` as other engines do. This may be an issue of chakra. #### version ``` v1.11.19 ``` #### command ``` chakra/cc_linux_x64_1_11_19/ChakraCoreFiles/bin/ch testcase.js ``` #### testcase ```javascript var obj = {__proto__:String}; var result = "hello" instanceof obj; print(result); ``` #### output ``` TypeError: obj is not a function. (evaluating '"hello" instanceof obj') ``` #### expected output ``` false ``` contributor:[@YuanWangC](https://github.com/YuanWangC)
An issue about evaluating instanceof
https://api.github.com/repos/chakra-core/ChakraCore/issues/6507/comments
8
2020-09-25T03:23:58Z
2022-11-09T16:49:50Z
https://github.com/chakra-core/ChakraCore/issues/6507
708,610,684
6,507
[ "chakra-core", "ChakraCore" ]
Hi, I running following code in ch(v1.11.22, debug) , an assertion will be thrown. ``` indent_363 = 'a'; let x = 1; this.x = []; for (let i = 0; i < 65536; i++) { this['a' + i] = 1; } indent_363 = 'b'; ``` output: ``` ASSERTION 17328: (c:\users\sunlili\documents\workspace\jsenginesfordebug\chakracore-1.11.22\lib\runtime\language\inlinecache.inl, line 232) !isRoot || RootObjectBase::FromVar(object)->GetRootPropertyIndex(propertyId) == DynamicObject::FromVar(object)->GetTypeHandler()->InlineOrAuxSlotIndexToPropertyIndex(u.local.slotIndex, false) Failure: (!isRoot || RootObjectBase::FromVar(object)->GetRootPropertyIndex(propertyId) == DynamicObject::FromVar(object)->GetTypeHandler()->InlineOrAuxSlotIndexToPropertyIndex(u.local.slotIndex, false)) FATAL ERROR: ch.exe failed due to exception code c0000420 ``` crash point: https://github.com/microsoft/ChakraCore/blob/861a276c346746f3b87347bb094988563d7ee0a7/lib/Runtime/Language/InlineCache.inl#L232 In crash point, the left GetRootPropertyIndex(propertyId) will call following method, then return 0xffff which is not equal to right value, and trigger the assertion. https://github.com/microsoft/ChakraCore/blob/861a276c346746f3b87347bb094988563d7ee0a7/lib/Runtime/Types/DictionaryTypeHandler.cpp#L361-L364 I think the realization of `DictionaryTypeHandlerBase<BigPropertyIndex>::GetRootPropertyIndex()` is inappropriate, may be it should call `DictionaryTypeHandlerBase<BigPropertyIndex>::GetPropertyIndex_Internal(PropertyRecord const* propertyRecord)` just like another similar method `SimpleDictionaryTypeHandlerBase<TPropertyIndex, TMapKey, IsNotExtensibleSupported>::GetRootPropertyIndex` do. ISec Lab 2020.9.25
Assertion Fail in inlinecache.inl
https://api.github.com/repos/chakra-core/ChakraCore/issues/6506/comments
1
2020-09-25T01:56:13Z
2020-11-04T03:27:42Z
https://github.com/chakra-core/ChakraCore/issues/6506
708,580,925
6,506
[ "chakra-core", "ChakraCore" ]
When calling `Object.defineProperty` as below, the internal method `[[DefineOwnProperty]]` will be invoked. According to ES10.0, when invoking the internal method `[[DefineOwnProperty]]` of the proxy object, the method `defineProperty` of proxy handler is called. So the overwritten property `defineProperty ` below is called. And a false will be returned after using `ToBoolean` dealing with its return value, because the method's default return value is undefined. Finally, a TypeError will be thrown as other engines(like V8,spiderMonkey and quickjs) do. But Chakra didn't throw any error as my expection, Is there any information I have missed? #### version ``` 1.11.19 ``` #### command ``` chakra/cc_linux_x64_1_11_19/ChakraCoreFiles/bin/ch testcase.js ``` #### testcase ```javascript function main() { var handler = {defineProperty:function(){ print("overwrite definedProperty"); } }; var target = {"a":3}; var descBefore = Object.getOwnPropertyDescriptor(target,"a"); for(var j in descBefore){ print(j,descBefore[j]); } var p = new Proxy(target,handler); var desc = {value:200}; var v21 = Object.defineProperty(p,"a",desc); print(v21); var descAfter = Object.getOwnPropertyDescriptor(target,"a"); for(var i in descAfter){ print(i,descAfter[i]); } } main(); ``` #### output ``` value 3 writable true enumerable true configurable true overwrite definedProperty [object Object] value 3 writable true enumerable true configurable true ``` #### expected output ``` value 3 writable true enumerable true configurable true overwrite definedProperty TypeError: proxy defineProperty handler returned false for property '"a"' ``` contributor:[@YuanWangC](https://github.com/YuanWangC)
A question about defineProperty of Proxy object
https://api.github.com/repos/chakra-core/ChakraCore/issues/6505/comments
2
2020-09-22T07:59:20Z
2023-01-25T22:14:57Z
https://github.com/chakra-core/ChakraCore/issues/6505
706,162,016
6,505
[ "chakra-core", "ChakraCore" ]
Hi, I am using ReactJS.net (v5.2.5) with JavaScriptEngineSwitcher.ChakraCore (v3.7.2) in .netcore 3.1 on linux. My application terminates randomly with Segmentation fault. I don't know much about `gdb` but running basic commands on the `core` dump generated by Segmentation fault gives the following output: ``` > gdb carwaleweb/Carwale.UI core Reading symbols from carwaleweb/Carwale.UI...(no debugging symbols found)...done. [New LWP 16056] [New LWP 28234] [New LWP 29708] [New LWP 22062] [New LWP 29709] ... [New LWP 27109] [New LWP 26219] [New LWP 31207] [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". Core was generated by `./Carwale.UI'. Program terminated with signal SIGSEGV, Segmentation fault. #0 0x00007ff14396324e in Memory::RecyclerWriteBarrierManager::WriteBarrier(void*) () from /home/consul/carwaleweb/libChakraCore.so [Current thread is 1 (Thread 0x7fe81896d700 (LWP 16056))] ``` ``` (gdb) where #0 0x00007ff14396324e in Memory::RecyclerWriteBarrierManager::WriteBarrier(void*) () from /home/consul/carwaleweb/libChakraCore.so #1 0x00007ff143aad715 in Js::FunctionCodeGenRuntimeData::GetInlinee(unsigned short) const () from /home/consul/carwaleweb/libChakraCore.so #2 0x00007ff1439894dc in void Js::FunctionCodeGenRuntimeData::MapInlineCaches<void Js::FunctionBody::CleanUpInlineCaches<false>()::{lambda(Js::InlineCache*)#1}>(void Js::FunctionBody::CleanUpInlineCaches<false>()::{lambda(Js::InlineCache*)#1}) const () from /home/consul/carwaleweb/libChakraCore.so #3 0x00007ff143985bd7 in void Js::FunctionBody::CleanUpInlineCaches<false>() () from /home/consul/carwaleweb/libChakraCore.so #4 0x00007ff14397bc48 in Js::FunctionBody::CleanupRecyclerData(bool, bool) () from /home/consul/carwaleweb/libChakraCore.so #5 0x00007ff143972fd0 in Js::FunctionBody::Cleanup(bool) () from /home/consul/carwaleweb/libChakraCore.so #6 0x00007ff143972b9b in Js::FunctionBody::RedeferFunction() () from /home/consul/carwaleweb/libChakraCore.so #7 0x00007ff14398e338 in Js::ScriptContext::RedeferFunctionBodies(BVSparse<Memory::ArenaAllocator>*, unsigned int) () from /home/consul/carwaleweb/libChakraCore.so #8 0x00007ff1439a5597 in ThreadContext::TryRedeferral() () from /home/consul/carwaleweb/libChakraCore.so #9 0x00007ff1439a53e5 in ThreadContext::PostSweepRedeferralCallBack() () from /home/consul/carwaleweb/libChakraCore.so #10 0x00007ff143959859 in Memory::Recycler::Sweep(unsigned long, bool, bool) () from /home/consul/carwaleweb/libChakraCore.so #11 0x00007ff14395ab6a in Memory::Recycler::CollectOnConcurrentThread() () from /home/consul/carwaleweb/libChakraCore.so #12 0x00007ff14395a439 in Memory::Recycler::DoCollect(Memory::CollectionFlags) () from /home/consul/carwaleweb/libChakraCore.so #13 0x00007ff1439a4135 in ThreadContext::ExecuteRecyclerCollectionFunction(Memory::Recycler*, int (Memory::Recycler::*)(Memory::CollectionFlags), Memory::CollectionFlags) () from /home/consul/carwaleweb/libChakraCore.so #14 0x00007ff14373f7bc in _JsErrorCode JsCollectGarbageCommon<(Memory::CollectionFlags)536907776>(void*)::{lambda()#1}::operator()() const () from /home/consul/carwaleweb/libChakraCore.so #15 0x00007ff14373f64e in _JsErrorCode GlobalAPIWrapper_Core<_JsErrorCode GlobalAPIWrapper_NoRecord<_JsErrorCode JsCollectGarbageCommon<(Memory::CollectionFlags)536907776>(void*)::{lambda()#1}>(_JsErrorCode JsCollectGarbageCommon<(Memory::CollectionFlags)536907776>(void*)::{lambda()#1})::{lambda()#1}>(_JsErrorCode JsCollectGarbageCommon<(Memory::CollectionFlags)536907776>(void*)::{lambda()#1}) () from /home/consul/carwaleweb/libChakraCore.so #16 0x00007ff14372263d in JsCollectGarbage () from /home/consul/carwaleweb/libChakraCore.so #17 0x00007ff1b7b85252 in ?? () #18 0x00007ff189095228 in ?? () #19 0x0000000000871157 in ?? () #20 0x00007ff21c706718 in vtable for InlinedCallFrame () from /home/consul/carwaleweb/libcoreclr.so #21 0x00007fe81896cd50 in ?? () #22 0x00007ff1b2adc028 in ?? () #23 0x00000fb300000000 in ?? () #24 0x00007fe818969960 in ?? () ... ``` ``` (gdb) bt full #0 0x00007ff14396324e in Memory::RecyclerWriteBarrierManager::WriteBarrier(void*) () from /home/consul/carwaleweb/libChakraCore.so No symbol table info available. #1 0x00007ff143aad715 in Js::FunctionCodeGenRuntimeData::GetInlinee(unsigned short) const () from /home/consul/carwaleweb/libChakraCore.so No symbol table info available. #2 0x00007ff1439894dc in void Js::FunctionCodeGenRuntimeData::MapInlineCaches<void Js::FunctionBody::CleanUpInlineCaches<false>()::{lambda(Js::InlineCache*)#1}>(void Js::FunctionBody::CleanUpInlineCaches<false>()::{lambda(Js::InlineCache*)#1}) const () from /home/consul/carwaleweb/libChakraCore.so No symbol table info available. #3 0x00007ff143985bd7 in void Js::FunctionBody::CleanUpInlineCaches<false>() () from /home/consul/carwaleweb/libChakraCore.so No symbol table info available. #4 0x00007ff14397bc48 in Js::FunctionBody::CleanupRecyclerData(bool, bool) () from /home/consul/carwaleweb/libChakraCore.so No symbol table info available. #5 0x00007ff143972fd0 in Js::FunctionBody::Cleanup(bool) () from /home/consul/carwaleweb/libChakraCore.so No symbol table info available. #6 0x00007ff143972b9b in Js::FunctionBody::RedeferFunction() () from /home/consul/carwaleweb/libChakraCore.so No symbol table info available. #7 0x00007ff14398e338 in Js::ScriptContext::RedeferFunctionBodies(BVSparse<Memory::ArenaAllocator>*, unsigned int) () from /home/consul/carwaleweb/libChakraCore.so No symbol table info available. #8 0x00007ff1439a5597 in ThreadContext::TryRedeferral() () from /home/consul/carwaleweb/libChakraCore.so No symbol table info available. #9 0x00007ff1439a53e5 in ThreadContext::PostSweepRedeferralCallBack() () from /home/consul/carwaleweb/libChakraCore.so No symbol table info available. #10 0x00007ff143959859 in Memory::Recycler::Sweep(unsigned long, bool, bool) () from /home/consul/carwaleweb/libChakraCore.so No symbol table info available. #11 0x00007ff14395ab6a in Memory::Recycler::CollectOnConcurrentThread() () from /home/consul/carwaleweb/libChakraCore.so No symbol table info available. #12 0x00007ff14395a439 in Memory::Recycler::DoCollect(Memory::CollectionFlags) () from /home/consul/carwaleweb/libChakraCore.so No symbol table info available. #13 0x00007ff1439a4135 in ThreadContext::ExecuteRecyclerCollectionFunction(Memory::Recycler*, int (Memory::Recycler::*)(Memory::CollectionFlags), Memory::CollectionFlags) () from /home/consul/carwaleweb/libChakraCore.so No symbol table info available. #14 0x00007ff14373f7bc in _JsErrorCode JsCollectGarbageCommon<(Memory::CollectionFlags)536907776>(void*)::{lambda()#1}::operator()() const () from /home/consul/carwaleweb/libChakraCore.so No symbol table info available. #15 0x00007ff14373f64e in _JsErrorCode GlobalAPIWrapper_Core<_JsErrorCode GlobalAPIWrapper_NoRecord<_JsErrorCode JsCollectGarbageCommon<(Memory::CollectionFlags)536907776>(void*)::{lambda()#1}>(_JsErrorCode JsCollectGarbageCommon<(Memory::CollectionFlags)536907776>(void*)::{lambda()#1})::{lambda()#1}>(_JsErrorCode JsCollectGarbageCommon<(Memory::CollectionFlags)536907776>(void*)::{lambda()#1}) () from /home/consul/carwaleweb/libChakraCore.so No symbol table info available. #16 0x00007ff14372263d in JsCollectGarbage () from /home/consul/carwaleweb/libChakraCore.so No symbol table info available. #17 0x00007ff1b7b85252 in ?? () No symbol table info available. #18 0x00007ff189095228 in ?? () No symbol table info available. ---Type <return> to continue, or q <return> to quit--- #19 0x0000000000871157 in ?? () No symbol table info available. #20 0x00007ff21c706718 in vtable for InlinedCallFrame () from /home/consul/carwaleweb/libcoreclr.so No symbol table info available. #21 0x00007fe81896cd50 in ?? () No symbol table info available. #22 0x00007ff1b2adc028 in ?? () No symbol table info available. #23 0x00000fb300000000 in ?? () No symbol table info available. #24 0x00007fe818969960 in ?? () No symbol table info available. #25 0x00007ff1b7b85252 in ?? () No symbol table info available. ... ``` Also `lldb` output : ``` (lldb) bt * thread #1: tid = 0, 0x00007f7665166cee libChakraCore.so`Memory::RecyclerWriteBarrierManager::WriteBarrier(void*) + 14, name = 'Carwale.UI', stop reason = signal SIGSEGV * frame #0: 0x00007f7665166cee libChakraCore.so`Memory::RecyclerWriteBarrierManager::WriteBarrier(void*) + 14 frame #1: 0x00007f76652b11b5 libChakraCore.so`Js::FunctionCodeGenRuntimeData::GetInlinee(unsigned short) const + 37 frame #2: 0x00007f766518cf7c libChakraCore.so`void Js::FunctionCodeGenRuntimeData::MapInlineCaches<void Js::FunctionBody::CleanUpInlineCaches<false>()::{lambda(Js::InlineCache*)#1}>(void Js::FunctionBody::CleanUpInlineCaches<false>()::{lambda(Js::InlineCache*)#1}) const + 236 frame #3: 0x00007f7665189677 libChakraCore.so`void Js::FunctionBody::CleanUpInlineCaches<false>() + 1063 frame #4: 0x00007f766517f6e8 libChakraCore.so`Js::FunctionBody::CleanupRecyclerData(bool, bool) + 40 frame #5: 0x00007f7665176a70 libChakraCore.so`Js::FunctionBody::Cleanup(bool) + 48 frame #6: 0x00007f766517663b libChakraCore.so`Js::FunctionBody::RedeferFunction() + 43 frame #7: 0x00007f7665191dd8 libChakraCore.so`Js::ScriptContext::RedeferFunctionBodies(BVSparse<Memory::ArenaAllocator>*, unsigned int) + 968 frame #8: 0x00007f76651a9037 libChakraCore.so`ThreadContext::TryRedeferral() + 215 frame #9: 0x00007f76651a8e85 libChakraCore.so`ThreadContext::PostSweepRedeferralCallBack() + 53 frame #10: 0x00007f766515d2f9 libChakraCore.so`Memory::Recycler::Sweep(unsigned long, bool, bool) + 329 frame #11: 0x00007f766515e60a libChakraCore.so`Memory::Recycler::CollectOnConcurrentThread() + 298 frame #12: 0x00007f766515ded9 libChakraCore.so`Memory::Recycler::DoCollect(Memory::CollectionFlags) + 745 frame #13: 0x00007f766515e1ed libChakraCore.so`Memory::Recycler::FinishConcurrentCollect(Memory::CollectionFlags) + 525 frame #14: 0x00007f76651a7bd5 libChakraCore.so`ThreadContext::ExecuteRecyclerCollectionFunction(Memory::Recycler*, int (Memory::Recycler::*)(Memory::CollectionFlags), Memory::CollectionFlags) + 437 frame #15: 0x00007f7664f428ac libChakraCore.so`_JsErrorCode JsCollectGarbageCommon<(Memory::CollectionFlags)536907776>(void*)::{lambda()#1}::operator()() const + 188 frame #16: 0x00007f7664f4273e libChakraCore.so`_JsErrorCode GlobalAPIWrapper_Core<_JsErrorCode GlobalAPIWrapper_NoRecord<_JsErrorCode JsCollectGarbageCommon<(Memory::CollectionFlags)536907776>(void*)::{lambda()#1}>(_JsErrorCode JsCollectGarbageCommon<(Memory::CollectionFlags)536907776>(void*)::{lambda()#1})::{lambda()#1}>(_JsErrorCode JsCollectGarbageCommon<(Memory::CollectionFlags)536907776>(void*)::{lambda()#1}) + 14 frame #17: 0x00007f7664f2572d libChakraCore.so`JsCollectGarbage + 29 frame #18: 0x00007f76cb9260d2 frame #19: 0x00007f76cb306749 frame #20: 0x00007f76cb2bc901 frame #21: 0x00007f76b7ce3dbc frame #22: 0x00007f76b7ce376f .... frame #135: 0x00007f7730d6f5ff libcoreclr.so`CallDescrWorkerInternal + 124 frame #136: 0x00007f7730c9f445 libcoreclr.so`CallDescrWorkerWithHandler(CallDescrData*, int) + 117 frame #137: 0x00007f7730c9ff20 libcoreclr.so`MethodDescCallSite::CallTargetWorker(unsigned long const*, unsigned long*, int) + 1264 frame #138: 0x00007f7730de9c2a libcoreclr.so`QueueUserWorkItemManagedCallback(void*) + 74 frame #139: 0x00007f7730c71645 libcoreclr.so`ManagedThreadBase_DispatchOuter(ManagedThreadCallState*) + 341 frame #140: 0x00007f7730c71cad libcoreclr.so`ManagedThreadBase::ThreadPool(void (*)(void*), void*) + 45 frame #141: 0x00007f7730dd557e libcoreclr.so`ManagedPerAppDomainTPCount::DispatchWorkItem(bool*, bool*) + 270 frame #142: 0x00007f7730c90999 libcoreclr.so`ThreadpoolMgr::WorkerThreadStart(void*) + 1241 frame #143: 0x00007f7730fa371d libcoreclr.so`CorUnix::CPalThread::ThreadEntry(void*) + 349 frame #144: 0x00007f77325d96ba libpthread.so.0`start_thread + 202 frame #145: 0x00007f773186a4dd libc.so.6`__clone + 109 at clone.S:109 ``` Please let me know if more info is needed. Thankyou.
Program terminated with signal SIGSEGV, Segmentation fault
https://api.github.com/repos/chakra-core/ChakraCore/issues/6504/comments
11
2020-09-20T13:57:11Z
2021-01-09T15:48:25Z
https://github.com/chakra-core/ChakraCore/issues/6504
705,114,747
6,504
[ "chakra-core", "ChakraCore" ]
A typeerror occurred in ChakraCore when I passed an undefined parameter in TypedArray.prototype.sort(), but other engines, such as V8 and quickjs, did not throw an error. Therefore, I think there may be a problem here. **version** 1.11.19 **command** ```javascript ChakraCore/out/Debug/ch testcase.js ``` **testcase** ```javascript var NISLFuzzingFunc = function(){ var a = new Uint32Array(1); var b = a.sort(undefined); } NISLFuzzingFunc(); ``` **output** ```javascript TypeError:[TypedArray].prototype.sort: argument is not a Function object. ``` **expected behavior** ```javascript No error occurred. ``` Contributor : @Haobin-Lee
An issue about the TypedArray.prototype.sort().
https://api.github.com/repos/chakra-core/ChakraCore/issues/6503/comments
7
2020-09-18T01:25:25Z
2022-09-30T23:52:20Z
https://github.com/chakra-core/ChakraCore/issues/6503
704,011,321
6,503
[ "chakra-core", "ChakraCore" ]
When I converted Symbol.split into a string and output it, chakra output "undefined",which is different from other engines,like V8,rhino,etc.According to ES standard,the initial value of Symbol.split is "Symbol.split". So I think there may be a problem here. **version** 1.11.19 **Command** ```javascript ChakraCore/out/Debug/ch testcase.js ``` **Test case** ```javascript var NISLFuzzingFunc = function(){ print(String(Symbol.split)); } NISLFuzzingFunc(); ``` **Output** ```javascript undefined ``` **Expected behavior** ```javascript Symbol(Symbol.split) ```
An issue about the Symbol.split.
https://api.github.com/repos/chakra-core/ChakraCore/issues/6502/comments
1
2020-09-16T14:14:48Z
2020-11-04T23:02:18Z
https://github.com/chakra-core/ChakraCore/issues/6502
702,803,627
6,502
[ "chakra-core", "ChakraCore" ]
./build.sh Searching for Clang... Clang++ found at /usr/bin/clang++ Compile Target : amd64 Generating Release makefiles -- Configuring done -- Generating done -- Build files have been written to: /home/lenovo/Desktop/ChakraCore-1.4.1/BuildLinux/Release [ 0%] Building CXX object pal/src/CMakeFiles/Chakra.Pal.dir/cruntime/file.cpp.o In file included from /home/lenovo/Desktop/ChakraCore-1.4.1/pal/src/cruntime/file.cpp:23: In file included from /home/lenovo/Desktop/ChakraCore-1.4.1/pal/src/include/pal/palinternal.h:334: /home/lenovo/Desktop/ChakraCore-1.4.1/pal/inc/pal.h:3382:59: error: unknown type name 'KNONVOLATILE_CONTEXT_POINTERS' PALIMPORT BOOL PALAPI PAL_VirtualUnwind(CONTEXT *context, KNONVOLATILE_CONTEXT_POINTERS *contextPointers); ^ /home/lenovo/Desktop/ChakraCore-1.4.1/pal/inc/pal.h:3385:50: error: unknown type name 'KNONVOLATILE_CONTEXT_POINTERS' KNONVOLATILE_CONTEXT_POINTERS *contextPointers, ^ /home/lenovo/Desktop/ChakraCore-1.4.1/pal/inc/pal.h:6999:36: error: implicit conversion from 'unsigned long long' to 'const SIZE_T' (aka 'const unsigned long') changes value from 18446744073709551615 to 4294967295 [-Werror,-Wconstant-conversion] const SIZE_T NoTargetFrameSp = SIZE_MAX; ~ ^~~~~~~~ /home/lenovo/Desktop/ChakraCore-1.4.1/pal/inc/pal_mstypes.h:327:18: note: expanded from macro 'SIZE_MAX' #define SIZE_MAX _UI64_MAX ^~~~~~~~~ /home/lenovo/Desktop/ChakraCore-1.4.1/pal/inc/pal.h:394:23: note: expanded from macro '_UI64_MAX' #define _UI64_MAX UI64(0xffffffffffffffff) ^~~~~~~~~~~~~~~~~~~~~~~~ /home/lenovo/Desktop/ChakraCore-1.4.1/pal/inc/pal_mstypes.h:160:24: note: expanded from macro 'UI64' #define UI64(x) UI64_HELPER(x) ^~~~~~~~~~~~~~ /home/lenovo/Desktop/ChakraCore-1.4.1/pal/inc/pal_mstypes.h:159:24: note: expanded from macro 'UI64_HELPER' #define UI64_HELPER(x) x ## ULL ^~~~~~~~ <scratch space>:2:1: note: expanded from here 0xffffffffffffffffULL ^~~~~~~~~~~~~~~~~~~~~ In file included from /home/lenovo/Desktop/ChakraCore-1.4.1/pal/src/cruntime/file.cpp:25: /home/lenovo/Desktop/ChakraCore-1.4.1/pal/src/include/pal/file.h:279:16: error: functions that differ only in their return type cannot be overloaded size_t __cdecl PAL_fwrite(const void *pvBuffer, size_t nSize, size_t nCount, PAL_FILE *pf); ~~~~~~ ^ /home/lenovo/Desktop/ChakraCore-1.4.1/pal/inc/pal.h:6703:26: note: previous declaration is here PALIMPORT size_t __cdecl PAL_fwrite(const void *, size_t, size_t, PAL_FILE *); ~~~~~~ ^ 4 errors generated. pal/src/CMakeFiles/Chakra.Pal.dir/build.make:62: recipe for target 'pal/src/CMakeFiles/Chakra.Pal.dir/cruntime/file.cpp.o' failed make[2]: *** [pal/src/CMakeFiles/Chakra.Pal.dir/cruntime/file.cpp.o] Error 1 CMakeFiles/Makefile2:103: recipe for target 'pal/src/CMakeFiles/Chakra.Pal.dir/all' failed make[1]: *** [pal/src/CMakeFiles/Chakra.Pal.dir/all] Error 2 Makefile:127: recipe for target 'all' failed make: *** [all] Error 2 See error details above. Exit code was 2
build problems:What should I do? can you give me some suggestions?
https://api.github.com/repos/chakra-core/ChakraCore/issues/6501/comments
2
2020-09-15T01:54:20Z
2024-04-25T04:51:33Z
https://github.com/chakra-core/ChakraCore/issues/6501
701,544,232
6,501
[ "chakra-core", "ChakraCore" ]
/ChakraCore/lib/Backend/arm/LowerMD.h:220:63: error: use of undeclared identifier 'RegSP'; did you mean 'RegRSP'? static RegNum GetRegStackPointer() { return RegSP; } /ChakraCore/lib/Backend/amd64/RegList.h:64:1: note: 'RegRSP' declared here REGDAT(RSP, rsp, 4, TyInt64, RA_DONTALLOCATE)
[android_armv7-a]undefined RegSP, RegR0
https://api.github.com/repos/chakra-core/ChakraCore/issues/6498/comments
3
2020-09-03T03:14:12Z
2020-12-06T22:01:57Z
https://github.com/chakra-core/ChakraCore/issues/6498
691,597,571
6,498
[ "chakra-core", "ChakraCore" ]
Running in Debug x64 configuration the GCStress tool occasionally crashes on https://github.com/microsoft/ChakraCore/blob/2422941b3755a49a73de8a7588208fe1d1c80bda/bin/GCStress/GCStress.cpp#L105 The object seems to have been corrupted since the virtual table pointer is no longer valid. ![image](https://user-images.githubusercontent.com/1618796/91327410-23e96900-e7ce-11ea-855a-f6670165aee1.png) The repro rate seems to be increased if a `::Sleep(2000);` is added in the initialization of the `Recycler`, just before: https://github.com/microsoft/ChakraCore/blob/2422941b3755a49a73de8a7588208fe1d1c80bda/lib/Common/Memory/Recycler.cpp#L841 It is reproducible in 1.9 and 1.11.21. Any help on resolving that would be great.
Crash in GCStress with concurrent GC enabled
https://api.github.com/repos/chakra-core/ChakraCore/issues/6495/comments
0
2020-08-26T16:01:00Z
2020-08-26T16:01:00Z
https://github.com/chakra-core/ChakraCore/issues/6495
686,438,020
6,495
[ "chakra-core", "ChakraCore" ]
Hello I have a customer that was having some issues with his web application hosted on App Service, there was slowness coming from one instance (VM) in particular they captured a dump: 0:1089> !mex.t DbgID ThreadID User Kernel Create Time (UTC) 1089 397c (0n14716) 78ms 125ms 08/02/2020 02:50:27.237 PM # Child-SP Return Call Site Info Source 0 000000e3e77af638 00007fffd69d581f ntdll!ZwWaitForAlertByThreadId+0x14 d:\rs1.obj.amd64fre\minkernel\ntdll\daytona\objfre\amd64\usrstubs.asm @ 3731 1 000000e3e77af640 00007fffd69d5726 ntdll!RtlpWaitOnAddressWithTimeout+0x43 d:\rs1\minkernel\ntos\rtl\waitaddr.c @ 817 2 000000e3e77af670 00007fffd69d55b7 ntdll!RtlpWaitOnAddress+0xb2 d:\rs1\minkernel\ntos\rtl\waitaddr.c @ 1060 3 000000e3e77af6e0 00007fffd6994c64 ntdll!RtlpWaitOnCriticalSection+0xdb d:\rs1\minkernel\ntdll\resource.c @ 1471 4 000000e3e77af7b0 00007fffd6994b90 ntdll!RtlpEnterCriticalSectionContended+0xcc Critical Section: Chakra!Js::FunctionProxy::GlobalLock Owning Thread ID: 0x2d9c d:\rs1\minkernel\ntdll\resource.c @ 2147 5 000000e3e77af7e0 00007fffb0c1e36b ntdll!RtlEnterCriticalSection+0x40 d:\rs1\minkernel\ntdll\resource.c @ 1766 6 (Inline) ---------------- Chakra!CriticalSection::Enter+0xd d:\rs1\onecoreuap\inetcore\jscript\core\lib\common\core\criticalsection.h @ 17 7 (Inline) ---------------- Chakra!AutoCriticalSection::{ctor}+0xd d:\rs1\onecoreuap\inetcore\jscript\core\lib\common\core\criticalsection.h @ 44 8 000000e3e77af810 00007fffb0c22f42 Chakra!Js::FunctionProxy::GetAuxPtrWithLock+0x2b d:\rs1\onecoreuap\inetcore\jscript\core\lib\runtime\base\functionbody.cpp @ 97 9 (Inline) ---------------- Chakra!Js::FunctionBody::GetLoopHeaderArrayWithLock+0xc d:\rs1\onecoreuap\inetcore\jscript\core\lib\runtime\base\functionbody.h @ 2445 a (Inline) ---------------- Chakra!Js::FunctionBody::GetLoopNumberWithLock+0xc d:\rs1\onecoreuap\inetcore\jscript\core\lib\runtime\base\functionbody.cpp @ 3282 b 000000e3e77af840 00007fffb0bd6d44 Chakra!Js::FunctionBody::SetLoopBodyEntryPoint+0x4e d:\rs1\onecoreuap\inetcore\jscript\core\lib\runtime\base\functionbody.cpp @ 3229 c 000000e3e77af880 00007fffb0b0ef43 Chakra!NativeCodeGenerator::JobProcessed+0x144 d:\rs1\onecoreuap\inetcore\jscript\core\lib\backend\nativecodegenerator.cpp @ 1612 d (Inline) ---------------- Chakra!JsUtil::JobProcessor::JobProcessed+0x16 d:\rs1\onecoreuap\inetcore\jscript\core\lib\common\common\jobs.cpp @ 334 e 000000e3e77af8f0 00007fffb0c71ce4 Chakra!JsUtil::BackgroundJobProcessor::Run+0x11f d:\rs1\onecoreuap\inetcore\jscript\core\lib\common\common\jobs.cpp @ 1073 f 000000e3e77af9d0 00007fffd42db2ca Chakra!JsUtil::BackgroundJobProcessor::StaticThreadProc+0x54 d:\rs1\onecoreuap\inetcore\jscript\core\lib\common\common\jobs.cpp @ 1236 10 000000e3e77afa20 00007fffd42db39c msvcrt!_callthreadstartex+0x1e d:\rs1\minkernel\crts\crtw32\startup\threadex.c @ 381 11 000000e3e77afa50 00007fffd41c84d4 msvcrt!_threadstartex+0x7c d:\rs1\minkernel\crts\crtw32\startup\threadex.c @ 361 12 000000e3e77afa80 00007fffd69de871 kernel32!BaseThreadInitThunk+0x14 d:\rs1\base\win32\client\thread.c @ 64 13 000000e3e77afab0 0000000000000000 ntdll!RtlUserThreadStart+0x21 d:\rs1\minkernel\ntdll\rtlstrt.c @ 997 research on the above stack frames and could not find which frame owned the AutoOptionalCriticalSection lock(Processor()->GetCriticalSection()), suspect it is orphaned critical section? finally located the frame owned the lock which is Chakra!JsUtil::BackgroundJobProcessor::Run 0:1089> .frame /r 0xe; !mex.x 0e 000000e3`e77af8f0 00007fff`b0c71ce4 Chakra!JsUtil::BackgroundJobProcessor::Run+0x11f [d:\rs1\onecoreuap\inetcore\jscript\core\lib\common\common\jobs.cpp @ 1073] rax=00000000000001bc rbx=0000000000000801 rcx=00007fffb1133558 rdx=0000000000000000 rsi=0000022bddbb7c80 rdi=00000229d9820e10 rip=00007fffb0b0ef43 rsp=000000e3e77af8f0 rbp=000000e3e77af969 r8=0000000000000000 r9=0000000000000000 r10=0000000000000000 r11=0000000000000246 r12=00000229d9820e48 r13=0000000000000000 r14=0000022c158ee6f8 r15=0000022f4d685c90 iopl=0 nv up ei pl zr na po nc cs=0033 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00000246 Chakra!JsUtil::BackgroundJobProcessor::Run+0x11f: 00007fff`b0b0ef43 ff4e20 dec dword ptr [rsi+20h] ds:0000022b`ddbb7ca0=0000000a 000000e3`e77af9d0 this = 0x00000229`d9820e10 @r15 threadData = 0x0000022f`4d685c90 000000e3`e77af930 threadArena = class Memory::ArenaAllocator 000000e3`e77af918 autoDecommit = struct JsUtil::BackgroundJobProcessor::Run::__l3::AutoDecommit @bl succeeded = true @rsi manager = 0x0000022b`ddbb7c80 0:1089> !mex.ddt -n this dt -n this () Recursive: [ -r1 -r2 -r ] Verbose dx Normal dt ================================================================================== Local var @ 0xe3e77af9d0 Type JsUtil::BackgroundJobProcessor* 0x00000229`d9820e10 +0x000 __VFN_table : 0x00007fff`b0f8cbd0 +0x008 processesInBackground : 1 +0x010 managers : JsUtil::DoublyLinkedList<JsUtil::JobManager> +0x020 jobs : JsUtil::DoublyLinkedList<JsUtil::Job> +0x030 isClosed : 0 +0x038 criticalSection : CriticalSection +0x060 jobReady : Event +0x068 wakeAllBackgroundThreads : Event +0x070 numJobs : 0x47 (0n71) +0x078 threadId : 0x0000022b`dd81ccf0 Void [thread] +0x080 threadService : 0x0000022b`dd81d098 JsUtil::ThreadService +0x088 threadCount : 2 +0x08c maxThreadCount : 2 +0x090 parallelThreadData : 0x0000022a`0efa5dd0 -> 0x0000022f`4d685c90 JsUtil 0:1089> !mex.ddt 00000229d9820e10+0x038 Chakra!CriticalSection dt 00000229d9820e10+0x038 Chakra!CriticalSection () Recursive: [ -r1 -r2 -r ] Verbose Normal dt ================================================================================== +0x000 cs : _RTL_CRITICAL_SECTION !mex.cs 0:1089> !mex.ddt 00000229d9820e48+0x000 Chakra!_RTL_CRITICAL_SECTION dt 00000229d9820e48+0x000 Chakra!_RTL_CRITICAL_SECTION () Recursive: [ -r1 -r2 -r ] Verbose Normal dt ================================================================================== +0x000 DebugInfo : 0x0000021c`69989950 _RTL_CRITICAL_SECTION_DEBUG +0x008 LockCount : 0n-10 (0xfffffff6) +0x00c RecursionCount : 0n1 +0x010 OwningThread : 0x00000000`0000397c Void [thread] +0x018 LockSemaphore : 0xffffffff`ffffffff Void [handle] +0x020 SpinCount : 0x20007d0 (0n33556432)
Deadlock in Chakra!JsUtil::BackgroundJobProcessor::Run
https://api.github.com/repos/chakra-core/ChakraCore/issues/6492/comments
0
2020-08-12T16:36:15Z
2020-08-12T16:50:29Z
https://github.com/chakra-core/ChakraCore/issues/6492
677,829,175
6,492
[ "chakra-core", "ChakraCore" ]
**Revision** rhino-1.7.12 **Test case** ```javascript var NISLFuzzingFunc = function(e,t){ return Object.setPrototypeOf(e,t); }; var NISLParameter0 = null; var NISLParameter1 = new Object(); var NISLCallingResult = NISLFuzzingFunc(NISLParameter0, NISLParameter1); print(NISLCallingResult); ``` **Execution steps** ```javascript java -jar rhino-1.7.12.jar -debug -version 200 testcase.js ``` **Output** ```javascript null ``` **Expected behavior** ```javascript Throw a TypeError exception. ``` **Description** According to ES standard, it should throw a TypeError exception when the first parameter is null.But in the above test case, Rhino returns null.
An issue about the Object.setPrototypeOf().
https://api.github.com/repos/chakra-core/ChakraCore/issues/6489/comments
0
2020-07-21T03:07:36Z
2020-07-21T13:25:03Z
https://github.com/chakra-core/ChakraCore/issues/6489
662,517,111
6,489
[ "chakra-core", "ChakraCore" ]
Version: `ch version 1.12.0.0-beta` Git hash: `33db8efd9f02cd528a7305391d7d10765a2e85f3` POC : ```javascript var a = [1]; a[import(a)++]; ``` In release build, the stack dump is: ``` #0 0x000055555579bb41 in ReportFatalException () #1 0x000055555579bc49 in OutOfMemory_unrecoverable_error() () #2 0x0000555555ce902c in Js::Exception::RaiseIfScriptActive(Js::ScriptContext*, unsigned int, void*) () #3 0x000055555579bde9 in Js::Throw::OutOfMemory() () #4 0x0000555555790df9 in Math::DefaultOverflowPolicy() () #5 0x0000555555871c71 in FuncInfo::AcquireLoc(ParseNode*) () #6 0x0000555555cf3689 in Emit(ParseNode*, ByteCodeGenerator*, FuncInfo*, int, bool, bool) () #7 0x0000555555cf0aea in ByteCodeGenerator::EmitTopLevelStatement(ParseNode*, FuncInfo*, int) () #8 0x0000555555cfa1bc in ByteCodeGenerator::EmitGlobalBody(FuncInfo*) () #9 0x0000555555cfbaa3 in ByteCodeGenerator::EmitOneFunction(ParseNodeFnc*) () #10 0x0000555555cfa571 in ByteCodeGenerator::EmitScopeList(ParseNode*, ParseNode*) () #11 0x000055555582e284 in ByteCodeGenerator::Generate(ParseNodeProg*, unsigned int, ByteCodeGenerator*, Js::ParseableFunctionInfo**, unsigned int, bool, Parser*, Js::ScriptFunction**) () #12 0x000055555582fcbf in GenerateByteCode(ParseNodeProg*, unsigned int, Js::ScriptContext*, Js::ParseableFunctionInfo**, unsigned int, bool, Parser*, CompileScriptException*, Js::ScopeInfo*, Js::ScriptFunction**) () #13 0x00005555558079dc in Js::ScriptContext::LoadScriptInternal(Parser*, unsigned char const*, unsigned long, SRCINFO const*, CompileScriptException*, Js::Utf8SourceInfo**, char16_t const*, LoadScriptFlag, void*) () #14 0x0000555555807c6e in Js::ScriptContext::LoadScript(unsigned char const*, unsigned long, SRCINFO const*, CompileScriptException*, Js::Utf8SourceInfo**, char16_t const*, LoadScriptFlag, void*) () #15 0x0000555555733472 in RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**) () #16 0x0000555555736eab in JsRun () #17 0x00005555556d4c19 in RunScript(char const*, char const*, unsigned long, void (*)(void*), void*, char*, void*) () #18 0x00005555556d5c05 in ExecuteTest(char const*) () #19 0x00005555556d62ab in main () #20 0x00007ffff67d3b97 in __libc_start_main (main=0x5555556d5c90 <main>, argc=0x2, argv=0x7fffffffe518, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffe508) at ../csu/libc-start.c:310 #21 0x00005555556d3c8a in _start () ```
ASSERTION Failure: (tmpReg == this->curTmpReg - 1)
https://api.github.com/repos/chakra-core/ChakraCore/issues/6488/comments
1
2020-07-18T20:05:46Z
2020-11-12T03:04:45Z
https://github.com/chakra-core/ChakraCore/issues/6488
660,351,797
6,488
[ "chakra-core", "ChakraCore" ]
Version: `ch version 1.12.0.0-beta` Git hash: `33db8efd9f02cd528a7305391d7d10765a2e85f3` POC that causes the assertion: ```javascript function a() { class b extends Array {} a(); } a() ``` POC that causes a segfault in release build: ```javascript function a() { class b extends 'x'.match (Array) {} a() } a() ```
Assertion `ByteCode Updward Exposed Used Mismatch` failed
https://api.github.com/repos/chakra-core/ChakraCore/issues/6487/comments
3
2020-07-14T19:14:36Z
2021-04-02T15:52:12Z
https://github.com/chakra-core/ChakraCore/issues/6487
656,838,601
6,487
[ "chakra-core", "ChakraCore" ]
Version: `ch version 1.12.0.0-beta` Git hash: `33db8efd9f02cd528a7305391d7d10765a2e85f3` POC: ```javascript function a(b) { c = {...b, __proto__ : Intl } } a() ``` Stack dump: ``` #0 0x000055555579bb41 in ReportFatalException () #1 0x000055555579bdc7 in Js::Throw::FatalJsReentrancyError() () #2 0x0000555555a2ae79 in void* Js::JavascriptFunction::CallFunction<true>(Js::RecyclableObject*, void* (*)(Js::RecyclableObject*, Js::CallInfo, ...), Js::Arguments, bool) () #3 0x0000555555a26f5e in Js::JavascriptFunction::CallRootFunctionInScript(Js::JavascriptFunction*, Js::Arguments) () #4 0x0000555555d30d3d in Js::IntlEngineInterfaceExtensionObject::InjectIntlLibraryCode(Js::ScriptContext*, Js::DynamicObject*, Js::IntlInitializationType) () #5 0x0000555555a4b40f in Js::JavascriptLibrary::InitializeIntlObject(Js::DynamicObject*, Js::DeferredTypeHandlerBase*, Js::DeferredInitializeMode) () #6 0x0000555555ae67c0 in Js::DeferredTypeHandler<&Js::JavascriptLibrary::InitializeIntlObject, Js::DefaultDeferredTypeFilter, true, (unsigned short)0, (unsigned short)0>::GetProperty(Js::DynamicObject*, void*, int, void**, Js::PropertyValueInfo*, Js::ScriptContext*) () #7 0x0000555555bafda2 in Js::DynamicObject::GetInternalProperty(void*, int, void**, Js::PropertyValueInfo*, Js::ScriptContext*) () #8 0x0000555555bbe933 in Js::PathTypeHandlerBase::SetPrototype(Js::DynamicObject*, Js::RecyclableObject*) () #9 0x0000555555b28069 in Js::JavascriptObject::ChangePrototype(Js::RecyclableObject*, Js::RecyclableObject*, bool, Js::ScriptContext*) () #10 0x0000555555981fb5 in Js::JavascriptOperators::OP_InitProto(void*, int, void*) () #11 0x00005555558fdaec in Js::InterpreterStackFrame::ProcessProfiledExtendedOpcodePrefix(unsigned char const*) () #12 0x000055555590dece in Js::InterpreterStackFrame::ProcessProfiled() () #13 0x00005555558ee5d3 in Js::InterpreterStackFrame::Process() () #14 0x00005555558eddab in Js::InterpreterStackFrame::InterpreterHelper(Js::ScriptFunction*, Js::ArgumentReader, void*, void*, Js::InterpreterStackFrame::AsmJsReturnStruct*) () #15 0x00005555558ed865 in Js::InterpreterStackFrame::InterpreterThunk(Js::JavascriptCallStackLayout*) () ```
Assertion fail: Js reentrancy error
https://api.github.com/repos/chakra-core/ChakraCore/issues/6486/comments
1
2020-07-14T16:37:27Z
2020-12-16T22:12:31Z
https://github.com/chakra-core/ChakraCore/issues/6486
656,748,412
6,486
[ "chakra-core", "ChakraCore" ]
Version: `ch version 1.12.0.0-beta` Git hash: `33db8efd9f02cd528a7305391d7d10765a2e85f3` POC: ```javascript function opt ( arr , arr2 ) { arr [ 0 ] = 1.100000 ; Math . max . apply ( Math , arr2 ) ; arr [ 0 ] = 0.000000 ; } function main ( ) { let arr = [ 1.100000 , 2.200000 , 3.300000 , 4.400000 ] ; for ( let i = 0 ; i < 10000 ; i ++ ) { opt ( arr , [ 1 , 2 , 3 , 4 ] ) ; } Math . max = 1 . toLocaleString ; opt ( arr , new Int16Array ( 150000 ) ) ; print ( arr [ 0 ] ) ; } main ( ) ; ```
Assertion ArgList too large failed in ChakraCore/lib/Runtime/Base/CallInfo.cpp
https://api.github.com/repos/chakra-core/ChakraCore/issues/6485/comments
0
2020-07-12T21:36:31Z
2020-07-12T21:36:31Z
https://github.com/chakra-core/ChakraCore/issues/6485
655,481,188
6,485
[ "chakra-core", "ChakraCore" ]
POC: ```javascript function a() { try { for (; Error << Error;) try { } finally { continue } } finally { } } for (;;) a() ``` ch version: `ch version 1.12.0.0-beta`, git hash `33db8efd9f02cd528a7305391d7d10765a2e85f3`
ASSERTION : (/home/yongheng/ChakraCore/lib/Backend/FlowGraph.cpp, line 1814) !this->func->DoGlobOpt()
https://api.github.com/repos/chakra-core/ChakraCore/issues/6483/comments
0
2020-07-04T17:28:05Z
2020-07-04T17:28:05Z
https://github.com/chakra-core/ChakraCore/issues/6483
650,927,670
6,483
[ "chakra-core", "ChakraCore" ]
POC: ```javascript function a() { for (b = 0; b;) try { for (;;) if (b) try { } finally { continue } } finally { } } for (;;) a() ``` ch version: `ch version 1.12.0.0-beta`, git hash `33db8efd9f02cd528a7305391d7d10765a2e85f3` In release build, it triggers a segmentation fault. Stack dump: ``` #0 0x0000555555d88259 in GlobOptBlockData::CloneBlockData(BasicBlock*, BasicBlock*) () #1 0x0000555555ec5ec2 in BasicBlock::MergePredBlocksValueMaps(GlobOpt*) () #2 0x0000555555d55569 in GlobOpt::OptBlock(BasicBlock*) () #3 0x0000555555d56dfa in GlobOpt::OptLoops(Loop*) () #4 0x0000555555d5553b in GlobOpt::OptBlock(BasicBlock*) () #5 0x0000555555d56dfa in GlobOpt::OptLoops(Loop*) () #6 0x0000555555d5553b in GlobOpt::OptBlock(BasicBlock*) () #7 0x0000555555d546a1 in GlobOpt::ForwardPass() () #8 0x0000555555d53ffc in GlobOpt::Optimize() () #9 0x0000555555d4cbef in Func::TryCodegen() () #10 0x0000555555d4c913 in Func::Codegen(Memory::JitArenaAllocator*, JITTimeWorkItem*, ThreadContextInfo*, ScriptContextInfo*, JITOutputIDL*, Js::EntryPointInfo*, FunctionJITRuntimeInfo const*, JITTimePolymorphicInlineCacheInfo*, void*, Js::ScriptContextProfiler*, bool) () #11 0x0000555555ccb334 in NativeCodeGenerator::CodeGen(Memory::PageAllocatorBase<Memory::VirtualAllocWrapper, Memory::SegmentBase<Memory::VirtualAllocWrapper>, Memory::PageSegmentBase<Memory::VirtualAllocWrapper> >*, CodeGenWorkItemIDL*, JITOutputIDL&, bool, Js::EntryPointInfo*) () #12 0x0000555555ccb5cd in NativeCodeGenerator::CodeGen(Memory::PageAllocatorBase<Memory::VirtualAllocWrapper, Memory::SegmentBase<Memory::VirtualAllocWrapper>, Memory::PageSegmentBase<Memory::VirtualAllocWrapper> >*, CodeGenWorkItem*, bool) () #13 0x0000555555ccbe43 in NativeCodeGenerator::Process(JsUtil::Job*, JsUtil::ParallelThreadData*) () #14 0x0000555555cdf48e in JsUtil::BackgroundJobProcessor::Process(JsUtil::Job*, JsUtil::ParallelThreadData*) () #15 0x0000555555cdf5a5 in JsUtil::BackgroundJobProcessor::Run(JsUtil::ParallelThreadData*) () #16 0x0000555555cde4e7 in JsUtil::BackgroundJobProcessor::StaticThreadProc(void*) () #17 0x000055555571faa0 in CorUnix::CPalThread::ThreadEntry(void*) () #18 0x00007ffff73646db in start_thread (arg=0x7ff7f2d9e700) at pthread_create.c:463 #19 0x00007ffff68d388f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95 ```
ASSERTION 19984: (/home/yongheng/ChakraCore/lib/Backend/FlowGraph.cpp, line 3959) succ->loop == nullptr || succ->loop->IsDescendentOrSelf(loop)
https://api.github.com/repos/chakra-core/ChakraCore/issues/6482/comments
0
2020-07-04T17:25:41Z
2020-07-14T03:42:08Z
https://github.com/chakra-core/ChakraCore/issues/6482
650,927,293
6,482
[ "chakra-core", "ChakraCore" ]
Hi, when using the JSRT API, a call to `JsGetOwnPropertyNames()` returns an array which length property is undefined. This is different from `Object.getOwnPropertyNames()`, which returns an array with the appropriate array. Chakracore version 1.11.20 windows x64 see [repository](https://github.com/manxboy/chakra-get-length-bug) for example when run, the type is reported as undefined and the conversion from number to int fails.
JsGetOwnPropertyNames returns an array with a undefined length
https://api.github.com/repos/chakra-core/ChakraCore/issues/6481/comments
1
2020-07-04T02:44:42Z
2020-07-05T20:30:21Z
https://github.com/chakra-core/ChakraCore/issues/6481
650,814,646
6,481
[ "chakra-core", "ChakraCore" ]
When the `obj` is `this` and the method `Object.prototype.hasOwnProperty` has no arguments, other engines like V8, spiderMonkey, and javascriptCore pass a default value and get an output with a value of `true`, while chakraCore gets a `false`. Is this an issue about the default parameter? #### version ``` v1.11.8 ``` #### command ``` ChakraCore/out/Debug/ch testcase.js ``` #### testcase ```javascript var NISLFuzzingFunc = function(){ var obj = this; var res1 = obj.hasOwnProperty(); print(res1); var res2 = obj.hasOwnProperty(undefined); print(res2); }; NISLFuzzingFunc(); ``` #### output ``` false true ``` #### expected output ``` true true ``` Contributor:[@YuanWangC](https://github.com/YuanWangC)
A question about Object.prototype.hasOwnProperty
https://api.github.com/repos/chakra-core/ChakraCore/issues/6477/comments
1
2020-07-01T12:23:41Z
2020-09-05T01:02:14Z
https://github.com/chakra-core/ChakraCore/issues/6477
648,939,722
6,477
[ "chakra-core", "ChakraCore" ]
Hello, running following code in ch 1.11.19 debug version. An Assertion will be throw. ``` 'use strict'; function func(b, c) { b[0] = c; } function main() { let b = new Uint32Array(100); for (let i = 0; i < 1000; i++) { i += 1; i += 0; func(b, {}); } } main(); ``` Output: ``` ASSERTION 19136: (...\chakracore-1.11.19\lib\backend\globopt.cpp, line 2325) !instr->GetDst() || instr->m_opcode == Js::OpCode::IncrLoopBodyCount || !loop->memOpInfo || (instr->m_opcode == Js::OpCode::Ld_I4 && prevInstr && (prevInstr->m_opcode == Js::OpCode::Add_I4 || prevInstr->m_opcode == Js::OpCode::Sub_I4) && instr->GetSrc1()->IsRegOpnd() && instr->GetDst()->IsRegOpnd() && prevInstr->GetDst()->IsRegOpnd() && instr->GetDst()->GetStackSym() == prevInstr->GetSrc1()->GetStackSym() && instr->GetSrc1()->GetStackSym() == prevInstr->GetDst()->GetStackSym()) || !loop->memOpInfo->inductionVariableChangeInfoMap->ContainsKey(GetVarSymID(instr->GetDst()->GetStackSym())) Failure: (!instr->GetDst() || instr->m_opcode == Js::OpCode::IncrLoopBodyCount || !loop->memOpInfo || (instr->m_opcode == Js::OpCode::Ld_I4 && prevInstr && (prevInstr->m_opcode == Js::OpCode::Add_I4 || prevInstr->m_opcode == Js::OpCode::Sub_I4) && instr->GetSrc1()->IsRegOpnd() && instr->GetDst()->IsRegOpnd() && prevInstr->GetDst()->IsRegOpnd() && instr->GetDst()->GetStackSym() == prevInstr->GetSrc1()->GetStackSym() && instr->GetSrc1()->GetStackSym() == prevInstr->GetDst()->GetStackSym()) || !loop->memOpInfo->inductionVariableChangeInfoMap->ContainsKey(GetVarSymID(instr->GetDst()->GetStackSym()))) FATAL ERROR: ch.exe failed due to exception code c0000420 ``` I think this is likely just a wrong assertion since the assumption strict too much, may miss some cases. https://github.com/microsoft/ChakraCore/blob/33db8efd9f02cd528a7305391d7d10765a2e85f3/lib/Backend/GlobOpt.cpp#L2360-2374 ISec Lab 2020.7.1
Wrong Assertion in GlobOpt::CollectMemOpInfo
https://api.github.com/repos/chakra-core/ChakraCore/issues/6476/comments
1
2020-07-01T04:09:48Z
2020-11-03T14:03:14Z
https://github.com/chakra-core/ChakraCore/issues/6476
648,656,072
6,476
[ "chakra-core", "ChakraCore" ]
Hello, I run following code in ch 1.11.19(debug) in Ubuntu, it will cause a crash by an assertion. ``` options_945 = { maximumSignificantDigits: 1 }; const pr_069 = new Intl.PluralRules('en', options_945); expected_486 = pr_069.select(12); ``` Assertion output: ``` ASSERTION 28665: (/.../ChakraCore-1.11.19/lib/Runtime/Library/IntlEngineInterfaceExtensionObject.cpp, line 3071) roundtripDiff <= 1.0 && roundtripDiff >= -1.0 Failure: (roundtripDiff <= 1.0 && roundtripDiff >= -1.0) Illegal instruction ``` I read the code in IntlEngineInterfaceExtensionObject.cpp, it seems that the variable 'n' is the argument of select(), whose value is 12 in poc. After unum_formatDouble(), formattedN wil store '10'. After unum_parseDouble(), nWithOptions will be assigned 10. https://github.com/microsoft/ChakraCore/blob/c848d4d8d50c0dfb4a23540a9ee6cd023fa029c1/lib/Runtime/Library/IntlEngineInterfaceExtensionObject.cpp#L3139-L3146 I think the logic upon is right, this is just a wrong ICU_ASSERT(), I do not know why the coder assume n and nWithOptions's diff should be less than 1. ISec Lab 2020.7.1
ASSERTION fails in Intl.PluralRules.select()
https://api.github.com/repos/chakra-core/ChakraCore/issues/6475/comments
1
2020-07-01T03:55:01Z
2021-03-23T02:30:48Z
https://github.com/chakra-core/ChakraCore/issues/6475
648,651,488
6,475
[ "chakra-core", "ChakraCore" ]
POC: ```javascript function c ( d , e ) { d . b = {4 : 1 }; d . a = e; } for(;;) { let d = { get f () { eval ( undefined ) } , b : 2 } c ( d, d) } ``` ch version: `ch version 1.12.0.0-beta`, git hash `33db8efd9f02cd528a7305391d7d10765a2e85f3`
ASSERTION 17123: (/home/yongheng/ChakraCore/lib/Backend/Lower.cpp, line 7229) false Failure: (false)
https://api.github.com/repos/chakra-core/ChakraCore/issues/6474/comments
1
2020-06-30T00:09:59Z
2020-07-26T23:31:35Z
https://github.com/chakra-core/ChakraCore/issues/6474
647,749,252
6,474
[ "chakra-core", "ChakraCore" ]
POC: ```javascript function a() { for (; 0;) switch (b) { case c: try { try { for (;;) try { } finally { switch (2) { case d: try { } catch { break } default: c } } } catch { } } catch { } } } for (;;) a() ``` ch version: `ch version 1.12.0.0-beta`, git hash `33db8efd9f02cd528a7305391d7d10765a2e85f3` In release build, it triggers a segmentation fault. Stack dump: ``` #0 0x00007ffff34eec32 in FlowGraph::Build() () from /home/yongheng/ChakraCore/out/Release/libChakraCore.so #1 0x00007ffff3508871 in Func::TryCodegen() () from /home/yongheng/ChakraCore/out/Release/libChakraCore.so #2 0x00007ffff3508360 in Func::Codegen(Memory::JitArenaAllocator*, JITTimeWorkItem*, ThreadContextInfo*, ScriptContextInfo*, JITOutputIDL*, Js::EntryPointInfo*, FunctionJITRuntimeInfo const*, JITTimePolymorphicInlineCacheInfo*, void*, Js::ScriptContextProfiler*, bool) () from /home/yongheng/ChakraCore/out/Release/libChakraCore.so #3 0x00007ffff36ce5d4 in NativeCodeGenerator::CodeGen(Memory::PageAllocatorBase<Memory::VirtualAllocWrapper, Memory::SegmentBase<Memory::VirtualAllocWrapper>, Memory::PageSegmentBase<Memory::VirtualAllocWrapper> >*, CodeGenWorkItemIDL*, JITOutputIDL&, bool, Js::EntryPointInfo*) () from /home/yongheng/ChakraCore/out/Release/libChakraCore.so #4 0x00007ffff36cebf0 in NativeCodeGenerator::CodeGen(Memory::PageAllocatorBase<Memory::VirtualAllocWrapper, Memory::SegmentBase<Memory::VirtualAllocWrapper>, Memory::PageSegmentBase<Memory::VirtualAllocWrapper> >*, CodeGenWorkItem*, bool) () from /home/yongheng/ChakraCore/out/Release/libChakraCore.so #5 0x00007ffff36cfbfc in NativeCodeGenerator::Process(JsUtil::Job*, JsUtil::ParallelThreadData*) () from /home/yongheng/ChakraCore/out/Release/libChakraCore.so #6 0x00007ffff371e46e in JsUtil::BackgroundJobProcessor::Process(JsUtil::Job*, JsUtil::ParallelThreadData*) () from /home/yongheng/ChakraCore/out/Release/libChakraCore.so #7 0x00007ffff371e81e in JsUtil::BackgroundJobProcessor::Run(JsUtil::ParallelThreadData*) () from /home/yongheng/ChakraCore/out/Release/libChakraCore.so #8 0x00007ffff371d189 in JsUtil::BackgroundJobProcessor::StaticThreadProc(void*) () from /home/yongheng/ChakraCore/out/Release/libChakraCore.so #9 0x00007ffff340ba5f in CorUnix::CPalThread::ThreadEntry(void*) () from /home/yongheng/ChakraCore/out/Release/libChakraCore.so #10 0x00007ffff73646db in start_thread (arg=0x7ff7f26e0700) at pthread_create.c:463 #11 0x00007ffff654a88f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95 ```
ASSERTION 31891: (/home/yongheng/ChakraCore/lib/Backend/FlowGraph.cpp, line 2090) this->func->IsLoopBodyInTry() Failure: (this->func->IsLoopBodyInTry())
https://api.github.com/repos/chakra-core/ChakraCore/issues/6473/comments
1
2020-06-30T00:02:14Z
2020-06-30T02:36:09Z
https://github.com/chakra-core/ChakraCore/issues/6473
647,746,595
6,473
[ "chakra-core", "ChakraCore" ]
POC: ```javascript function Module() { 'use asm'; function f() { } return f; } function recur() { try { recur(); } catch (e) { Module(1); } } recur(); ``` ch version: `ch version 1.12.0.0-beta`, git hash `33db8efd9f02cd528a7305391d7d10765a2e85f3` Stack dump: ``` #0 DBG_DebugBreak () at /home/yongheng/ChakraCore/pal/src/arch/i386/debugbreak.S:18 #1 0x00007ffff26f1c31 in DebugBreak () at /home/yongheng/ChakraCore/pal/src/debug/debug.cpp:408 #2 0x00007ffff2d5f279 in ReportFatalException (context=0x0, exceptionCode=0x80004005, reasonCode=Fatal_Internal_Error, scenario=0x2) at /home/yongheng/ChakraCore/lib/Common/Exceptions/ReportError.cpp:20 #3 0x00007ffff2d5f84d in Js::Throw::FatalInternalError (hr=0x80004005) at /home/yongheng/ChakraCore/lib/Common/Exceptions/Throw.cpp:72 #4 0x00007ffff37893e8 in Js::JavascriptFunction::ReparseAsmJsModule (functionRef=0x7fffff814020) at /home/yongheng/ChakraCore/lib/Runtime/Library/JavascriptFunction.cpp:1716 #5 0x00007ffff336bfb0 in Js::InterpreterStackFrame::ProcessLinkFailedAsmJsModule (this=0x7fffff8146c0) at /home/yongheng/ChakraCore/lib/Runtime/Language/InterpreterStackFrame.cpp:2926 #6 0x00007ffff336ab41 in Js::InterpreterStackFrame::ProcessAsmJsModule (this=0x7fffff8146c0) at /home/yongheng/ChakraCore/lib/Runtime/Language/InterpreterStackFrame.cpp:2672 #7 0x00007ffff3347aae in Js::InterpreterStackFrame::Process (this=0x7fffff8146c0) at /home/yongheng/ChakraCore/lib/Runtime/Language/InterpreterStackFrame.cpp:3463 #8 0x00007ffff334678b in Js::InterpreterStackFrame::InterpreterHelper (function=0x7ffff7ef6730, args=..., returnAddress=0x7ffff7e50f92, addressOfReturnAddress=0x7fffff814bf8, asmJsReturn=0x0) at /home/yongheng/ChakraCore/lib/Runtime/Language/InterpreterStackFrame.cpp:2165 #9 0x00007ffff3345858 in Js::InterpreterStackFrame::InterpreterThunk (layout=0x7fffff814c10) at /home/yongheng/ChakraCore/lib/Runtime/Language/InterpreterStackFrame.cpp:1845 #10 0x00007ffff7e50f92 in ?? () #11 0x00007fffff814c30 in ?? () #12 0x00007ffff3a9851e in amd64_CallFunction () at /home/yongheng/ChakraCore/lib/Runtime/Library/amd64/JavascriptFunctionA.S:100 ```
FatalInternalError in ReparseAsmJsModule
https://api.github.com/repos/chakra-core/ChakraCore/issues/6472/comments
3
2020-06-29T06:17:56Z
2020-06-29T19:51:05Z
https://github.com/chakra-core/ChakraCore/issues/6472
647,145,500
6,472
[ "chakra-core", "ChakraCore" ]
What would be the procedure to simply build the library statically, so I don't have to distribute the DLL with the executable? I tried opening the the provided solution file, going to the ChakraCore project's property pages and changing the Configuration Type from Dynamic Library (.DLL) to Static Library (.LIB). It did not work, I got errors. Any way I can build it as a static library? Or if possible are there any existing prebuilt static binaries for Windows?
Building Chakra-Core statically through VS 2019 under Windows
https://api.github.com/repos/chakra-core/ChakraCore/issues/6471/comments
2
2020-06-26T03:56:24Z
2020-06-30T02:42:10Z
https://github.com/chakra-core/ChakraCore/issues/6471
645,989,049
6,471
[ "chakra-core", "ChakraCore" ]
According to ES10, it is a Syntax Error if`IsCharacterClass` of [ClassAtomNoDash](https://tc39.es/ecma262/#prod-ClassAtomNoDash) is true or `IsCharacterClass` of [ClassAtom](https://tc39.es/ecma262/#prod-ClassAtom) is true. But when executing the testcase below, I get the output `h,e,l,l,o,w,o,r,l,d`. So I wonder if there is anything wrong in my understanding of this testcase? How does this regular expression match? #### version ``` v1.11.8 ``` #### command ``` ChakraCore/out/Debug/ch testcase.js ``` #### testcase ```javascript var NISLFuzzingFunc = function(){ var res = "hello world!".match(/[#-\w]/g); print(res); }; NISLFuzzingFunc(); ``` #### output ``` h,e,l,l,o,w,o,r,l,d ```
A question about Regular Expression ClassRanges match
https://api.github.com/repos/chakra-core/ChakraCore/issues/6470/comments
1
2020-06-22T10:18:55Z
2020-12-14T18:37:46Z
https://github.com/chakra-core/ChakraCore/issues/6470
642,944,527
6,470
[ "chakra-core", "ChakraCore" ]
```cpp // Project2.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 // #include <iostream> #include <string> #include "ChakraCore.h" using namespace std; int main() { JsRuntimeHandle runtime; JsContextRef context; JsValueRef result; unsigned currentSourceContext = 0; // Your script, try replace the basic hello world with something else wstring script = L"123aaaa"; // Create a runtime. JsCreateRuntime(JsRuntimeAttributeNone, nullptr, &runtime); // Create an execution context. JsCreateContext(runtime, &context); // Now set the execution context as being the current one on this thread. JsSetCurrentContext(context); // Run the script. JsRunScript(script.c_str(), currentSourceContext++, L"", &result); JsValueRef exception; JsPropertyIdRef messageName; JsGetAndClearException(&exception); JsCreatePropertyId("stack", strlen("stack"), &messageName); JsGetProperty(exception, messageName, &result); // Convert your script result to String in JavaScript; redundant if your script returns a String JsValueRef resultJSString; JsConvertValueToString(result, &resultJSString); // Project script result in JS back to C++. const wchar_t* resultWC; size_t stringLength; JsStringToPointer(resultJSString, &resultWC, &stringLength); wstring resultW(resultWC); cout << string(resultW.begin(), resultW.end()) << endl; system("pause"); // Dispose runtime JsSetCurrentContext(JS_INVALID_REFERENCE); JsDisposeRuntime(runtime); return 0; } ``` ```javascript console.log(new Error().stack) ```
Why does the exception object have no stack attribute
https://api.github.com/repos/chakra-core/ChakraCore/issues/6469/comments
3
2020-06-22T09:24:31Z
2020-12-14T18:37:29Z
https://github.com/chakra-core/ChakraCore/issues/6469
642,905,792
6,469
[ "chakra-core", "ChakraCore" ]
Does ChakraCore now support linux arm or arm64 architecture compilation? ![1](https://user-images.githubusercontent.com/20411721/85120535-f32d0680-b255-11ea-91c8-924a14fbd3f7.png)
ubuntu16.04 aarch64, not found makefile
https://api.github.com/repos/chakra-core/ChakraCore/issues/6468/comments
9
2020-06-19T09:55:56Z
2020-12-05T17:37:27Z
https://github.com/chakra-core/ChakraCore/issues/6468
641,851,189
6,468
[ "chakra-core", "ChakraCore" ]
When performing a differential test about the testcase below, When`setFloat64` only has one argument, other engines like V8, spiderMonkey, and javascriptCore pass a default value as the second argument, while chakraCore throws a TypeError. Will this situation cause code portability issues? #### version ``` v1.11.8 ``` #### command ``` ChakraCore/out/Debug/ch testcase.js ``` #### testcase ```javascript var NISLFuzzingFunc = function(){ var a = new DataView(new ArrayBuffer(256)); print(a.getFloat64(1)); a.setFloat64(1); print(a.getFloat64(1)); }; NISLFuzzingFunc(); ``` #### output ``` 0 TypeError: Required argument offset or value in DataView method is not specified ``` #### expected output ``` 0 NaN ``` Contributor:[@YuanWangC](https://github.com/YuanWangC)
A question about Data.prototype.setFloat64
https://api.github.com/repos/chakra-core/ChakraCore/issues/6467/comments
1
2020-06-16T13:11:44Z
2020-06-16T16:54:57Z
https://github.com/chakra-core/ChakraCore/issues/6467
639,653,254
6,467
[ "chakra-core", "ChakraCore" ]
I tried to compile ChakraCore in Ubuntu 20.04 following the build instructions for Linux. I got below error. I follow same procedure in Ubuntu 16.04 and I was able to compile without any issue. Any clue about below error? Thank you! -- Configuring done -- Generating done -- Build files have been written to: /home/AzureUser/Desarrollo/ChakraCore/out/Debug [ 1%] Building CXX object pal/src/CMakeFiles/Chakra.Pal.Singular.dir/cruntime/file.cpp.o In file included from /home/AzureUser/Desarrollo/ChakraCore/pal/src/cruntime/file.cpp:23: In file included from /home/AzureUser/Desarrollo/ChakraCore/pal/src/include/pal/palinternal.h:553: In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/stdlib.h:36: In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/cstdlib:75: /usr/include/stdlib.h:112:36: error: exception specification in declaration does not match previous declaration __extension__ extern long long int atoll (const char *__nptr) ^ /home/AzureUser/Desarrollo/ChakraCore/pal/inc/pal.h:6198:33: note: previous declaration is here PALIMPORT long long int __cdecl atoll(const char *); ^ 1 error generated. make[2]: *** [pal/src/CMakeFiles/Chakra.Pal.Singular.dir/build.make:63: pal/src/CMakeFiles/Chakra.Pal.Singular.dir/cruntime/file.cpp.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:757: pal/src/CMakeFiles/Chakra.Pal.Singular.dir/all] Error 2 make: *** [Makefile:84: all] Error 2 See error details above. Exit code was 2
Ubuntu 20.04, Clang 10 build failure
https://api.github.com/repos/chakra-core/ChakraCore/issues/6466/comments
8
2020-06-12T21:46:37Z
2021-02-12T09:41:26Z
https://github.com/chakra-core/ChakraCore/issues/6466
638,018,772
6,466
[ "chakra-core", "ChakraCore" ]
In _test/Error/errorNum.js_ the numvar.toPrecision(0) should have an argument at least 1, but here it has 0. ![image](https://user-images.githubusercontent.com/22259701/84071649-bb60cc00-a9d6-11ea-8733-0f5e5d8ebf88.png)
toPrecision() with incorrect argument
https://api.github.com/repos/chakra-core/ChakraCore/issues/6462/comments
1
2020-06-08T19:26:00Z
2020-06-08T22:57:56Z
https://github.com/chakra-core/ChakraCore/issues/6462
634,876,174
6,462
[ "chakra-core", "ChakraCore" ]
###### Version chakra-1.11.8 ###### Test case ```js var NISLFuzzingFunc = function(){ print(typeof Symbol()); print(Symbol().valueOf()); }; NISLFuzzingFunc(); ``` ###### Execution steps ./ChakraCore/out/Debug/ch testcase.js ###### Output ``` symbol TypeError: No implicit conversion of Symbol to String ``` ###### Expected behavior ``` symbol Symbol() ``` ###### Description According to ES2019 standard, the steps of `Symbol.prototype.valueOf()` are as follows. > **19.4.3.4 Symbol.prototype.valueOf ()** > > The following steps are taken: > > 1. Return ? **thisSymbolValue(`this value`).** And > The abstract operation **thisSymbolValue(`value`)** performs the following steps: > > 1. **If Type(`value`) is Symbol, return `value`.** > ... For this test case, `this value` is `Symbol()`, and it should be returned. So the final output should be `Symbol()`, but chakra threw a TypeError: No implicit conversion of Symbol to String. Is my understanding wrong or chakra implementation incorrect? ###### Reference http://www.ecma-international.org/ecma-262/10.0/index.html#sec-symbol.prototype.valueof
A question about Symbol().valueOf
https://api.github.com/repos/chakra-core/ChakraCore/issues/6461/comments
1
2020-06-08T14:33:27Z
2020-06-08T23:17:44Z
https://github.com/chakra-core/ChakraCore/issues/6461
634,670,967
6,461
[ "chakra-core", "ChakraCore" ]
Hello, This regexp is not valid, but chakra pass without throw a syntax error. version: 1.11.19 OS: Linux Ubuntu 19.10 x64 steps to reproduce: ``` var x = /[\u{61}-b]b]/u; ^ ``` Actual results: ``` pass without errors ``` Expected results: ``` SyntaxError: raw bracket is not allowed in regular expression with unicode flag ``` V8, SpiderMonkey, Hermes and JavaScriptCore works as expected. cinfuzz
Raw bracket is not allowed in regular expression with unicode flag
https://api.github.com/repos/chakra-core/ChakraCore/issues/6460/comments
0
2020-06-08T04:45:58Z
2020-06-08T22:59:37Z
https://github.com/chakra-core/ChakraCore/issues/6460
634,129,951
6,460
[ "chakra-core", "ChakraCore" ]
Hi everyone, I found a case of redeclaration of a generator function inside a block definition. version: 1.11.19 OS: Linux Ubuntu 19.10 x64 steps to reproduce: { function* f() { yield 1 } function f() { print(2) } } f() Actual results: 2 Expected results: SyntaxError: Identifier 'f' has already been declared V8, SpiderMonkey works as expected. cinfuzz
Redeclaration of a function* inside a block definition
https://api.github.com/repos/chakra-core/ChakraCore/issues/6459/comments
2
2020-06-08T03:06:01Z
2020-06-09T01:59:08Z
https://github.com/chakra-core/ChakraCore/issues/6459
634,042,906
6,459
[ "chakra-core", "ChakraCore" ]
Hello, I run following code in ch 1.11.19(debug),and it will crash by an assertion. ``` let b = [1.1, 2.2, 3.3]; b[4294967294] = 3; Array.prototype.copyWithin.call(b, 0, 1); ``` Crash output: ``` ASSERTION 7690: (/.../ChakraCore-1.11.19/lib/Runtime/Library/JavascriptArray.cpp, line 9309) direction == -1 || (fromVal + count < MaxArrayLength && toVal + count < MaxArrayLength) Failure: (direction == -1 || (fromVal + count < MaxArrayLength && toVal + count < MaxArrayLength)) Illegal instruction ``` When reading the source code, I find that the if-condition and the asserts in else-branch are not mutually complemental. https://github.com/microsoft/ChakraCore/blob/c848d4d8d50c0dfb4a23540a9ee6cd023fa029c1/lib/Runtime/Library/JavascriptArray.cpp#L9286 The asserts in else-branch should be : Assert((fromVal + count) <= MaxArrayLength && (toVal + count) <= MaxArrayLength ) ISec Lab 2020.6.8
ASSERTION fails in Array.prototype.copyWithin
https://api.github.com/repos/chakra-core/ChakraCore/issues/6458/comments
7
2020-06-08T01:32:22Z
2024-07-29T23:51:18Z
https://github.com/chakra-core/ChakraCore/issues/6458
633,963,925
6,458
[ "chakra-core", "ChakraCore" ]
###### ChakraCore version: version 1.12.0.0-beta ###### Build Commond ./build.sh --debug ###### OS Ubuntu 16.04.6 LTS (Linux 4.4.0-142-generic x86_64) ###### Test case ``` function opt(arr, start, end) { for (let i = start; i < end; i++) { if (i === 10) { i += 0; } arr[i] = 2.3023e-320; } } let arr = new Array(100); function main() { arr.fill(1.1); for (let i = 0; i < 1000; i += 0) i++; opt(arr, 0, 100000); } main(); ``` ###### Output ``` ASSERTION 163874: (ChakraCore/lib/Backend/GlobOpt.cpp, line 2374) !instr->GetDst() || instr->m_opcode == Js::OpCode::IncrLoopBodyCount || !loop->memOpInfo || (instr->m_opcode == Js::OpCode::Ld_I4 && prevInstr && (prevInstr->m_opcode == Js::OpCode::Add_I4 || prevInstr->m_opcode == Js::OpCode::Sub_I4) && instr->GetSrc1()->IsRegOpnd() && instr->GetDst()->IsRegOpnd() && prevInstr->GetDst()->IsRegOpnd() && instr->GetDst()->GetStackSym() == prevInstr->GetSrc1()->GetStackSym() && instr->GetSrc1()->GetStackSym() == prevInstr->GetDst()->GetStackSym()) || !loop->memOpInfo->inductionVariableChangeInfoMap->ContainsKey(GetVarSymID(instr->GetDst()->GetStackSym())) Failure: (!instr->GetDst() || instr->m_opcode == Js::OpCode::IncrLoopBodyCount || !loop->memOpInfo || (instr->m_opcode == Js::OpCode::Ld_I4 && prevInstr && (prevInstr->m_opcode == Js::OpCode::Add_I4 || prevInstr->m_opcode == Js::OpCode::Sub_I4) && instr->GetSrc1()->IsRegOpnd() && instr->GetDst()->IsRegOpnd() && prevInstr->GetDst()->IsRegOpnd() && instr->GetDst()->GetStackSym() == prevInstr->GetSrc1()->GetStackSym() && instr->GetSrc1()->GetStackSym() == prevInstr->GetDst()->GetStackSym()) || !loop->memOpInfo->inductionVariableChangeInfoMap->ContainsKey(GetVarSymID(instr->GetDst()->GetStackSym()))) Illegal instruction ``` Credits: This vulnerability is detected by chong from OWL337.
ASSERTION failed in GlobOpt::CollectMemOpInfo
https://api.github.com/repos/chakra-core/ChakraCore/issues/6455/comments
1
2020-06-02T02:44:35Z
2020-06-09T03:20:28Z
https://github.com/chakra-core/ChakraCore/issues/6455
628,857,361
6,455
[ "chakra-core", "ChakraCore" ]
###### ChakraCore version: version 1.12.0.0-beta ###### Build Commond ./build.sh --debug ###### OS Ubuntu 16.04.6 LTS (Linux 4.4.0-142-generic x86_64) ###### Test case ``` function foo() { 'use asm'; function f(d0) { d0 = +d0; return 1 % (~~d0 >>> 0) | 0; } return f; } foo(); WScript.Attach((this, {bar: function(){}}, new ArrayBuffer(1 << 20)).toLocaleString); WScript.Detach(foo); WScript.Attach(foo); ``` ###### Output ``` ASSERTION 127791: (ChakraCore/lib/Runtime/./Types/RecyclableObject.h, line 520) VarIs<T>(obj) Failure: (VarIs<T>(obj)) Illegal instruction ``` Credits: This vulnerability is detected by chong from OWL337.
ASSERTION (VarIs<T>(obj)) failed in Js::VarTo
https://api.github.com/repos/chakra-core/ChakraCore/issues/6454/comments
1
2020-06-01T09:18:24Z
2020-06-09T03:11:07Z
https://github.com/chakra-core/ChakraCore/issues/6454
628,281,297
6,454