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"
] |
ChakraCore fails [this test262 test](https://github.com/tc39/test262/blob/master/test/language/expressions/object/method-definition/name-prototype-prop.js)
This is because ChakraCore defines a prototype property in methods that are inside object literals:
```
var o = {
f(){},
}
o.f.hasOwnProperty("prototype"); //true, when should be false
```
|
Functions declared as methods define a `prototype` property
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5701/comments
| 0 |
2018-09-12T18:54:23Z
|
2018-09-24T17:30:37Z
|
https://github.com/chakra-core/ChakraCore/issues/5701
| 359,608,635 | 5,701 |
[
"chakra-core",
"ChakraCore"
] |
Hey!
I'm looking at running Chakra under seccomp on Linux. Generally speaking, when does the VM need to allocate executable memory (ex. `mmap` with `PROT_EXEC`)?
I'm assuming most of that is limited to the JIT, but are there other cases?
Thanks!
|
When does Chakra require executable pages?
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5700/comments
| 3 |
2018-09-12T15:23:51Z
|
2018-09-25T22:02:51Z
|
https://github.com/chakra-core/ChakraCore/issues/5700
| 359,533,315 | 5,700 |
[
"chakra-core",
"ChakraCore"
] |
Git Head: d1524ebc936a11e45125650fc92c9ab635b4f395
To reproduce: `ch so.js`
Crashing payload:
```js
let limit = (1 << 16) - 4;
function test0() {
return arguments[limit - 1];
}
while (true) {
try {
const txt = `test/(${Array(limit).fill(0).map((_, i) => i).join(",")})`;
var val1 = eval(txt);
console.log(`arguments[${limit - 1}] == ${val1}`);
break;
} catch (e) {
console.log(e)
console.log(`${limit} is too many arguments`);
limit--;
}
}
console.log(`Arguments limit: ${limit}`);
```
Extract from Valgrind log (full log available here: https://gist.github.com/fumfel/3c246644270ce2d6f486283a6b570347):
```
==21642== Stack overflow in thread #1: can't grow stack to 0x1ffe801000
==21642== Stack overflow in thread #1: can't grow stack to 0x1ffe801000
==21642== Can't extend stack to 0x1ffe801068 during signal delivery for thread 1:
==21642== no stack segment
==21642==
==21642== Process terminating with default action of signal 11 (SIGSEGV)
==21642== Access not within mapped region at address 0x1FFE801068
==21642== Stack overflow in thread #1: can't grow stack to 0x1ffe801000
==21642== at 0x2106D9F: ParseNode::Grfnop() (ptree.h:176)
==21642== If you believe this happened as a result of a stack
==21642== overflow in your program's main thread (unlikely but
==21642== possible), you can try to increase the size of the
==21642== main thread stack using the --main-stacksize= flag.
==21642== The main thread stack size used in this run was 8388608.
==21642== Stack overflow in thread #1: can't grow stack to 0x1ffe801000
==21642==
==21642== Process terminating with default action of signal 11 (SIGSEGV)
==21642== Access not within mapped region at address 0x1FFE801F28
==21642== Stack overflow in thread #1: can't grow stack to 0x1ffe801000
==21642== at 0x8296650: _vgnU_freeres (in /usr/lib/valgrind/vgpreload_core-amd64-linux.so)
==21642== If you believe this happened as a result of a stack
==21642== overflow in your program's main thread (unlikely but
==21642== possible), you can try to increase the size of the
==21642== main thread stack using the --main-stacksize= flag.
==21642== The main thread stack size used in this run was 8388608.
```
|
Stack overflow in ParseNode::Grfnop()
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5699/comments
| 2 |
2018-09-12T07:42:18Z
|
2020-04-24T03:42:27Z
|
https://github.com/chakra-core/ChakraCore/issues/5699
| 359,353,664 | 5,699 |
[
"chakra-core",
"ChakraCore"
] |
Consider:
```js
let obj = Object('asdf');
obj.a = 1;
console.log(Reflect.ownKeys(obj).map(x => x.toString()).join(','));
```
Per the overload for [`[[OwnPropertyKeys]]` for String exotic objects](https://tc39.github.io/ecma262/#sec-string-exotic-objects-ownpropertykeys), and in accord with every other browser, this should print
```
0,1,2,3,length,a
```
But in fact it prints
```
0,1,2,3,a,length
```
See also [this open spec PR](https://github.com/tc39/ecma262/pull/1242) about very large integer indices and [this related ChakraCore issue](https://github.com/Microsoft/ChakraCore/issues/3396) about enumeration order for classes.
|
Property enumeration order of String exotic objects is wrong
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5697/comments
| 1 |
2018-09-12T01:20:41Z
|
2018-09-26T23:20:31Z
|
https://github.com/chakra-core/ChakraCore/issues/5697
| 359,280,149 | 5,697 |
[
"chakra-core",
"ChakraCore"
] |
#5477 showed that ChakraCore does not throw an error when an assignment expression that is not allowed in strict mode is used as the computed property name of a member function within a class.
#5689 fixed many cases that arise from the issue stated above.
A case that is not fixed is when the invalid strict mode assignment expression is within a call to eval:
```
class C {
[eval("a = 5")]() { }
}
```
Testing against other engines:
```
eshost -x -t bug.js
βββββββββββ¬ββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β jsvu-ch β β
βββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β jsvu-d8 β β
β β ReferenceError: a is not defined β
βββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β jsvu-sm β β
β β ReferenceError: assignment to undeclared variable a β
βββββββββββ΄ββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
Error not thrown when calling eval() on an assignment expression that is not valid in strict mode within a computed property name within a class
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5696/comments
| 0 |
2018-09-11T23:55:30Z
|
2018-09-26T23:23:10Z
|
https://github.com/chakra-core/ChakraCore/issues/5696
| 359,265,612 | 5,696 |
[
"chakra-core",
"ChakraCore"
] |
Stepping out from callbacks called by JsBuiltIn functions results in some frame information from the built in being visible.
Repro: change the ```every``` call to ```forEach``` in DebuggerCommon/returnvaluetest1.js
|
Debugger: stepping out into JsBuiltIn functions
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5694/comments
| 3 |
2018-09-11T22:58:19Z
|
2019-06-07T18:32:30Z
|
https://github.com/chakra-core/ChakraCore/issues/5694
| 359,254,137 | 5,694 |
[
"chakra-core",
"ChakraCore"
] |
Writing to __proto__ can leave the TypeHandler::protoCachesWereInvalidated set, and writing to __proto__ again with the same type on the RHS object can skip proto cache invalidation.
|
Missing proto cache invalidation on repeated setting of new prototype
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5692/comments
| 1 |
2018-09-11T21:51:15Z
|
2018-09-26T19:38:08Z
|
https://github.com/chakra-core/ChakraCore/issues/5692
| 359,237,683 | 5,692 |
[
"chakra-core",
"ChakraCore"
] |
Ported from OS#18780560
Stage 3 Proposal: https://github.com/tc39/proposal-string-left-right-trim
We already have implementations of trimLeft and trimRight, so we simply need to add trimStart and trimEnd as aliases to those.
```
>es --tags jsvu-web -is E:\work\bugs\19h1\trimStart-trimEnd\trimStart-trimEnd.js
## Source
let stringToTrim = ' hello '
function trimIt(trimmerFn) {
return '.' + trimmerFn.call(stringToTrim) + '.';
}
function has(funcName) {
let doesHave = String.prototype.hasOwnProperty(funcName);
let doesHaveString = doesHave ? '++ yes ++' : '-- NO --'
print(`has ${funcName}? ${doesHaveString}`);
if (doesHave) {
print(trimIt(String.prototype[funcName]))
}
}
has('trimLeft')
has('trimRight')
has('trimStart')
has('trimEnd')
#### jsvu-ch
has trimLeft? ++ yes ++
.hello .
has trimRight? ++ yes ++
. hello.
has trimStart? -- NO --
has trimEnd? -- NO --
#### jsvu-jsc, jsvu-sm, jsvu-v8
has trimLeft? ++ yes ++
.hello .
has trimRight? ++ yes ++
. hello.
has trimStart? ++ yes ++
.hello .
has trimEnd? ++ yes ++
. hello.
```
|
Implement trimStart/trimEnd
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5690/comments
| 1 |
2018-09-11T21:29:17Z
|
2018-09-15T01:59:21Z
|
https://github.com/chakra-core/ChakraCore/issues/5690
| 359,231,289 | 5,690 |
[
"chakra-core",
"ChakraCore"
] |
Chakra failed with error C2440 when build with permissive- by msvc on Windows, I use latest version a3737b0 on master branch. Could you please help take a look at this? Noted that this issue only found when compiles with unreleased vctoolset, that next release of MSVC will have this behavior.
**You can repro this issue as the steps below:**
1. git clone -c core.autocrlf=true https://github.com/microsoft/ChakraCore D:\Chakra\src
2. open a clean x86 prompt (C:\windows\syswow64\cmd.exe) and browse to D:\Chakra\src
3. set _CL_=/d1ParseTrees:identErrors- /permissive-
4. msbuild /m /p:Platform=x86 /p:Configuration=Test /p:WindowsTargetPlatformVersion=10.0.17134.0 Build\Chakra.Core.sln /t:Rebuild
**Error info:**
d:\chakra\src\bin\nativetests\biguinttest.cpp(235): error C2440: '=': cannot convert from 'const char [11]' to 'char *'
d:\chakra\src\bin\nativetests\biguinttest.cpp(235): note: Conversion from string literal loses const qualifier (see /Zc:strictStrings)
d:\chakra\src\bin\nativetests\biguinttest.cpp(247): error C2440: '=': cannot convert from 'const char [11]' to 'char *'
d:\chakra\src\bin\nativetests\biguinttest.cpp(247): note: Conversion from string literal loses const qualifier (see /Zc:strictStrings)
d:\chakra\src\bin\nativetests\biguinttest.cpp(261): error C2440: '=': cannot convert from 'const char [21]' to 'char *' d:\chakra\src\bin\nativetests\biguinttest.cpp(261): note: Conversion from string literal loses const qualifier (see /Zc:strictStrings)
|
Chakra failed with error C2440 when build with permissive- by msvc on Windows
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5681/comments
| 3 |
2018-09-10T09:15:57Z
|
2018-09-10T21:15:35Z
|
https://github.com/chakra-core/ChakraCore/issues/5681
| 358,535,490 | 5,681 |
[
"chakra-core",
"ChakraCore"
] |
Hello, executing following code:
```
let arg_0 = {};
let arg_2 = {};
var i = 1;
let handler_0 = {
defineProperty : function (oTarget, sKey, oDesc) {
return Reflect.defineProperty(oTarget, sKey, oDesc);
}
};
let handler_2 = {
has : function (oTarget, sKey) {
print(i++);
print(sKey.toString());
return Reflect.has(oTarget, sKey);
}
}
let p_0 = new Proxy(arg_0, handler_0);
let p_2 = new Proxy(arg_2, handler_2);
Object.defineProperty(p_0,"c",p_2);
```
Output of ch:
```
1
enumerable
2
configurable
3
value
4
writable
5
get
6
set
7
enumerable
8
configurable
9
value
10
writable
11
get
12
set
```
However, the output should be:
```
1
enumerable
2
configurable
3
value
4
writable
5
get
6
set
```
It seems that chakracore call [ToPropertyDescriptor](https://www.ecma-international.org/ecma-262/9.0/index.html#sec-object.defineproperty) twice.
BT group
2018.09.10
|
Wrong realization of Object.defineProperty
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5680/comments
| 2 |
2018-09-10T06:49:45Z
|
2018-09-24T17:59:20Z
|
https://github.com/chakra-core/ChakraCore/issues/5680
| 358,489,566 | 5,680 |
[
"chakra-core",
"ChakraCore"
] |
Hello, executing following code:
```
let arg_0 = /(.)\1/i;
let handler_0 = {get:function (oTarget, sKey) {
print(sKey.toString());
return Reflect.get(oTarget, sKey);
}};
var p_0 = new Proxy(arg_0, handler_0);
(0 + "\u1234\0").split(p_0);
```
In [ecma-262](https://www.ecma-international.org/ecma-262/9.0/index.html#sec-string.prototype.split), seperator's Symbol.split should be got firstly. However, ch get Symbol.toPrimitive firstly.
Output of ch:
```
Symbol(Symbol.toPrimitive)
toString
TypeError: RegExp.prototype.toString: 'this' is not a RegExp object
```
Output of other engines:
```
Symbol(Symbol.split)
constructor
flags
Symbol(Symbol.match)
source
```
BT group
2018.09.10
|
Realization of String.prototype.split is inconsistent with ecma-262
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5679/comments
| 7 |
2018-09-10T03:41:59Z
|
2020-03-25T08:53:06Z
|
https://github.com/chakra-core/ChakraCore/issues/5679
| 358,457,286 | 5,679 |
[
"chakra-core",
"ChakraCore"
] |
Hello, executing following code:
```
var a = [1,,...[3]];
Object.defineProperty(a, "1", {configurable:false, value:10});
print(JSON.stringify(Object.getOwnPropertyDescriptor(a, "1")));
```
Since 'enumerable' and 'writable' default to false, the output should be:
`{"value":10,"writable":false,"enumerable":false,"configurable":false}`
However, output of ch is:
`{"value":10,"writable":true,"enumerable":true,"configurable":false}`
BT group
2018.09.10
|
Wrong property setting of Array's element
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5678/comments
| 1 |
2018-09-10T02:48:57Z
|
2020-04-12T00:34:46Z
|
https://github.com/chakra-core/ChakraCore/issues/5678
| 358,448,109 | 5,678 |
[
"chakra-core",
"ChakraCore"
] |
Hi, executing following code, ChakraCore will throw a TypeError. It seems that ch treats the empty array as undefined or null.
```
function f(...[]) {return 23};
f();
print("BT_FLAG");
```
The output of ChakraCore:
`TypeError: Unable to get property 'Symbol.iterator' of undefined or null reference`
However, the output should be:
`BT_FLAG`
BT group
2018.09.10
|
TypeError shouldn't be thrown when function's argument is an empty array using spread operator
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5677/comments
| 6 |
2018-09-10T01:37:18Z
|
2020-04-08T22:04:21Z
|
https://github.com/chakra-core/ChakraCore/issues/5677
| 358,436,710 | 5,677 |
[
"chakra-core",
"ChakraCore"
] |
V8 relies on ICU for seemingly the same things that we do, and we both fail a lot of test262 tests because of it.
|
Implement spec-compliant CanonicalizeLanguageTag
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5674/comments
| 3 |
2018-09-07T23:42:42Z
|
2019-06-07T18:36:56Z
|
https://github.com/chakra-core/ChakraCore/issues/5674
| 358,242,168 | 5,674 |
[
"chakra-core",
"ChakraCore"
] |
When defining a class with ES6, if you define the class in the window object, the class name is not set:
```
<script>
test1 = class Foo {};
window.test2 = class Bar {};
console.log(window.test1.name);
console.log(window.test2.name);
</script>
```
Expected output:
```
Foo
Bar
```
Actual output:
```
Foo
```
Tested in Microsoft Edge 42.17134.1.0 / EdgeHTML 17.17134
|
ES6 class name not set when defined in window object
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5672/comments
| 1 |
2018-09-07T10:36:24Z
|
2018-09-07T14:56:17Z
|
https://github.com/chakra-core/ChakraCore/issues/5672
| 358,014,184 | 5,672 |
[
"chakra-core",
"ChakraCore"
] |
While porting mono to wasm, it's really unproductive to have to deal with this sort of errors:
```
wasm-function[744]:801: RuntimeError: function signature mismatch
RuntimeError: function signature mismatch
at _mini_init (wasm-function[744]:801)
at _mono_jit_init_version (wasm-function[415]:63)
at _mono_wasm_load_runtime (wasm-function[150]:78)
at Module._mono_wasm_load_runtime (mono.js:10812:51)
at ccall (mono.js:504:18)
at mono.js:512:12
at test.js:110:1
```
It would be AMAZING if a call_indirect failure message included: the table slot, the expected signature, the signature found and what function exists at the slot used.
This can be hidden under a debug flag that would be accessible under the release mode shell:
```
#~/.jsvu/ch -h
Usage: ch [-v|-version] [-h|-help|-?] <source file>
Note: [flaglist] is not supported in Release builds; try a Debug or Test build to enable these flags.
-v|-version Displays version info
-h|-help|-? Displays this help message
```
|
[WebAssembly] Improve abort exception messages
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5668/comments
| 2 |
2018-09-06T15:21:10Z
|
2018-09-10T14:14:38Z
|
https://github.com/chakra-core/ChakraCore/issues/5668
| 357,706,639 | 5,668 |
[
"chakra-core",
"ChakraCore"
] |
Run the below script with eshost on macOS and it will throw in Ch but pass in all other engines - from reading CC's source there is a different sort algorithm used on xplat for arrays > 512 elements in length than on windows and I think there's an error in it's logic.
```js
const arr = [];
for (let i = 0; i < 600; ++i)
{
arr[i] = Math.random() * 100 | 0;
}
arr.sort(function (a, b){ return a - b;});
for (let i = 1; i < 600; ++i)
{
if (arr[i] < arr[i - 1]) // i.e. sort has not completed correctly
{
throw new Error (arr.slice(0, i + 5));
}
}
```
|
BUG: xplat Array.prototype.sort produces incorrect results when length > 512
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5667/comments
| 5 |
2018-09-05T22:26:34Z
|
2018-09-08T01:18:27Z
|
https://github.com/chakra-core/ChakraCore/issues/5667
| 357,426,705 | 5,667 |
[
"chakra-core",
"ChakraCore"
] |
Now that V8 has patched their `Array#sort` to be stable _(see [here](https://twitter.com/mathias/status/1036626116654637057))_ it appears that Chakra may be one of the last _(or the last)_ of the browser JS engines _(JS Core, SpiderMonkey, V8, etc.)_ to [perform a **non**-stable sort](https://twitter.com/mathias/status/1036629033583345670) _(see [demo](https://mathiasbynens.be/demo/sort-stability-512))_.
https://github.com/Microsoft/ChakraCore/blob/0f40413d2e29863edf5f82de14fac41843deb79f/lib/Runtime/Library/JavascriptArray.cpp#L6640-L6675
While not a spec violation, if all engines perform a stable sort we can work towards standardizing it in the TC39.
|
Stable sort for Array#sort.
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5661/comments
| 27 |
2018-09-03T18:15:12Z
|
2018-11-01T19:05:48Z
|
https://github.com/chakra-core/ChakraCore/issues/5661
| 356,576,944 | 5,661 |
[
"chakra-core",
"ChakraCore"
] |
First I just want to congratulate on your work on Chakra, thank you for making it available to us. We recently switched from v8 to chakra as our main driver in [Krom](https://github.com/Kode/Krom) / [Armory](https://armory3d.org/) game engine and we are quite excited!
With our [current setup](https://github.com/Kode/Krom/blob/master/Sources/main.cpp#L2476) I am able to print out this error message after an exception, which is almost perfect:
```
Uncaught exception:
scene.raw.name = "test";
^
TypeError
at Anonymous function (krom.js:333:3)
at iron_App.render (krom.js:1293:5)
at kha_System.render (krom.js:23463:3)
at kha_SystemImpl.renderCallback (krom.js:23588:2)
```
The last bit I want to add is an exception message, something like:
> `Cannot read property 'raw' of null`
I am using [JsGetAndClearExceptionWithMetadata](https://github.com/Microsoft/ChakraCore/wiki/JsGetAndClearExceptionWithMetadata) to retrieve the metadata object. Accessing the `metadata.exception.name` property reads `TypeError` like I expect, however accessing `metadata.exception.message` gives me an empty string.
I am sure I am missing something obvious here, will appreciate any pointers.
|
Unable to print exception message
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5660/comments
| 9 |
2018-09-02T12:59:55Z
|
2018-09-08T00:12:46Z
|
https://github.com/chakra-core/ChakraCore/issues/5660
| 356,280,653 | 5,660 |
[
"chakra-core",
"ChakraCore"
] |
Executing following code in ch 1.10 :
```
Uint8Array.prototype.toLocaleString.call(0)
```
The output is ""
However, in [specific](https://www.ecma-international.org/ecma-262/9.0/index.html#sec-%typedarray%.prototype.tolocalestring) :
"ValidateTypedArray is applied to the this value prior to evaluating the algorithm. "
So, a TypeError should be thrown.
BT group
2018.08.29
|
Wrong realization of TypedArray's toLocaleString()
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5653/comments
| 3 |
2018-08-29T13:22:19Z
|
2018-09-05T23:14:14Z
|
https://github.com/chakra-core/ChakraCore/issues/5653
| 355,158,198 | 5,653 |
[
"chakra-core",
"ChakraCore"
] |
See https://github.com/tc39/ecma402/issues/256. A test262 issue has already been created as well.
|
Chakra does not respect `usage` option for Intl.Collator/String.prototype.toLocaleString
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5648/comments
| 0 |
2018-08-28T16:24:38Z
|
2018-09-06T20:47:33Z
|
https://github.com/chakra-core/ChakraCore/issues/5648
| 354,807,383 | 5,648 |
[
"chakra-core",
"ChakraCore"
] |
Works on built-in functions and other non ECMAScript forms:
```js
var x = function() {};
Object.getOwnPropertyDescriptor(x, "length").configurable; // true
delete x.length; // expected true, received false
Object.getOwnPropertyDescriptor(x, "length"); // expected undefined, received the previous descriptor for 'length'
```
Same works for __some__ built-in functions, not all of them.
```
eshost -s -x 'var x = Array.prototype.forEach; print(Object.getOwnPropertyDescriptor(x, "length").configurable); print(delete x.length); print(Object.getOwnPropertyDescriptor(x, "length"));'
#### ch, d8, jsc, jsshell, node
true
true
undefined
eshost -s -x 'var x = Array.prototype.filter; print(Object.getOwnPropertyDescriptor(x, "length").configurable); print(delete x.length); print(Object.getOwnPropertyDescriptor(x, "length"));'
#### d8, jsc, jsshell, node
true
true
undefined
#### ch
true
false
[object Object]
```
|
Functions 'length' is configurable but can't be deleted.
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5646/comments
| 7 |
2018-08-27T19:41:07Z
|
2018-08-27T20:50:03Z
|
https://github.com/chakra-core/ChakraCore/issues/5646
| 354,450,439 | 5,646 |
[
"chakra-core",
"ChakraCore"
] |
```js
[1, 2, 3].flatMap(() => { throw new Error() })
```
This shows a line for `FlattenArrayIntoMapped (native code)`, which should be excluded from the stack trace.
|
JsBuiltIn internal functions are shown in stack traces
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5644/comments
| 0 |
2018-08-27T18:22:47Z
|
2018-09-17T20:56:28Z
|
https://github.com/chakra-core/ChakraCore/issues/5644
| 354,424,198 | 5,644 |
[
"chakra-core",
"ChakraCore"
] |
```js
try {
[1, 2, 3].forEach(() => { throw new Error(); });
} catch (e) {
print(e.stack);
}
```
This shows a line for `forEach (native code)` with jsbuiltins enabled, while it shows `Array.prototype.forEach (native code)` with jsbuiltins disabled. Same for .filter.
|
JsBuiltIns show as `funcName` rather than `Constructor.prototype.funcName` in stack traces
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5643/comments
| 2 |
2018-08-27T18:20:49Z
|
2018-09-17T20:56:28Z
|
https://github.com/chakra-core/ChakraCore/issues/5643
| 354,423,557 | 5,643 |
[
"chakra-core",
"ChakraCore"
] |
```js
[1, 2, 3].forEach(function () { arguments.callee.caller; })
```
This throws with Array.prototype.forEach as a JsBuiltIn, but passes with the native version. Same thing for .filter and .flatMap. V8 and SpiderMonkey do not throw.
|
Accessing `arguments.callee.caller` in sloppy callback to JsBuiltIn throws
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5642/comments
| 13 |
2018-08-27T18:03:12Z
|
2018-09-06T21:35:47Z
|
https://github.com/chakra-core/ChakraCore/issues/5642
| 354,417,726 | 5,642 |
[
"chakra-core",
"ChakraCore"
] |
### html
`<button id="upload">upload</button>`
### js
`let button = document.getElementById('upload');`
`let input = document.createElement('input');`
` input.type = 'file';`
`button.onclick = function () {`
` input.click();`
` console.log('unblock')`
` };`
### problem
When i run this demo in Chrome or Firefox,unblock will be shown after clicking.But in Edge,opening upload input is something like blocking the thread unless i finish the upload input. Is it a bug or something else for reasons?
|
confusing block
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5641/comments
| 3 |
2018-08-27T05:21:11Z
|
2018-08-28T16:43:01Z
|
https://github.com/chakra-core/ChakraCore/issues/5641
| 354,183,268 | 5,641 |
[
"chakra-core",
"ChakraCore"
] |
Executing following code in ch 1.10:
```
print(typeof Int32Array.prototype.__proto__.byteOffset);
```
Output of ChakraCore:
```
undefined
```
However, output should be :
```
Exception: TypeError: Receiver should be a typed array view
```
BT group
2018.08.26
|
Fail to throw TypeError when using typeof to access %TypedArray% Intrinsic Object's byteOffset
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5639/comments
| 3 |
2018-08-26T09:33:11Z
|
2018-09-06T21:19:51Z
|
https://github.com/chakra-core/ChakraCore/issues/5639
| 354,080,547 | 5,639 |
[
"chakra-core",
"ChakraCore"
] |
Executing following code :
```
print(Int32Array.prototype.__proto__.constructor)
```
Output of ch is :
```
function() {
[native code]
}
```
However, output(v8, spm, jsc) should be :
```
function TypedArray() {
[native code]
}
```
BT group
2018.08.26
|
Wrong output of %TypedArray% 's constructor
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5638/comments
| 1 |
2018-08-26T09:21:29Z
|
2018-08-26T17:20:41Z
|
https://github.com/chakra-core/ChakraCore/issues/5638
| 354,079,938 | 5,638 |
[
"chakra-core",
"ChakraCore"
] |
Executing following code :
```
var v=[];
class C {
m() {return 23};
}
class D extends C {
f() {return super.boom();}
}
Object.defineProperty(C.prototype, "boom", {get : function() {
print(this===v);
return this.m;
}});
print(new D().f.apply(v,[]));
```
Output of ChakraCore :
```
false
23
```
However, output of other JS engines :
```
true
Exception: TypeError: super.boom is not a function. (In 'super.boom()', 'super.boom' is undefined)
```
BT group
2018.08.26
|
Wrong to change 'this' when using super to access method
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5637/comments
| 0 |
2018-08-26T08:08:16Z
|
2018-10-17T18:00:55Z
|
https://github.com/chakra-core/ChakraCore/issues/5637
| 354,075,856 | 5,637 |
[
"chakra-core",
"ChakraCore"
] |
See these comments:
https://github.com/Microsoft/ChakraCore/pull/5622#issuecomment-415905651
https://github.com/Microsoft/ChakraCore/pull/5622#issuecomment-415908077
After implementing Object.fromEntries the AsmJS parameters out of memory test would crash on xplat debug builds when calling WScript.Quit(0) - this issue only repros on xplat debug builds and seemingly only with fatal errors for OOM disabled (which this test disabled).
Fixed the test for now by avoiding the use of WScript.Quit - as that's not what the test was actually meant to test but there is a bug here that should be looked into.
CC @MikeHolman
|
Modified test: Xplat Debug only Recycler crash on exit
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5636/comments
| 1 |
2018-08-25T18:04:09Z
|
2018-09-05T23:07:39Z
|
https://github.com/chakra-core/ChakraCore/issues/5636
| 354,031,776 | 5,636 |
[
"chakra-core",
"ChakraCore"
] |
We are currently manually negating the input set and encoding the full negated set, rather than checking that a set does NOT include a character (for which we already have logic, except for the built-in character sets).
This has a minor to moderate unnecessary memory cost. We should be using whichever set (negated or natural) which contains the fewest characters, which minimizes memory cost -- which also happens to include selecting an ASCII-only set, if possible, which saves lots of memory by avoiding the creation of the non-ASCII external data structure for a character set.
This means pushing the set negation check into the bytecode (for which we already have opcodes).
See https://github.com/Microsoft/ChakraCore/pull/5592#discussion_r211013233
|
RegExp memory efficiency: built-in negated character classes could use NegatedSet
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5633/comments
| 0 |
2018-08-24T23:37:26Z
|
2019-06-07T18:36:21Z
|
https://github.com/chakra-core/ChakraCore/issues/5633
| 353,958,852 | 5,633 |
[
"chakra-core",
"ChakraCore"
] |
Only a problem when producing `JSCRIPT_FUNCTION_JIT_QUEUED` or `JSCRIPT_FUNCTION_JIT_DEQUEUED` events.
That calls `GetDisplayName` helper that may miscalculate the length of the source name and read extra chars, causing a crash in stress scenarios.
|
Tracing ETW events for the JIT queue may crash in stress scenarios.
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5631/comments
| 0 |
2018-08-24T17:52:01Z
|
2018-08-24T21:39:40Z
|
https://github.com/chakra-core/ChakraCore/issues/5631
| 353,873,390 | 5,631 |
[
"chakra-core",
"ChakraCore"
] |
Hi everyone,
there is an inconsistency in Chakra if a switch statement with only one case block evaluation that could be not reached.
version: 1.10.2
OS: Ubuntu 16.04 x64
steps to reproduce:
```js
{ function f() { return "f 0"; } }
switch (1)
{
case /0.0/gi:
function f() {
return "f 1";
}
break;
}
print( f() );
```
Actual results:
f 1
Expected results:
f 0
if we try to add the default block (`default: ` or `default: break;`), the same occurs as above.
V8 and SpiderMonkey works as expected.
cinfuzz
|
Switch statement without reached the case block
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5630/comments
| 3 |
2018-08-24T16:23:46Z
|
2020-04-13T12:41:40Z
|
https://github.com/chakra-core/ChakraCore/issues/5630
| 353,848,011 | 5,630 |
[
"chakra-core",
"ChakraCore"
] |
Executing following code :
```
var obj1 = new RegExp('')
let arg_1 = obj1;
let handler_1 = {
get:function (oTarget, sKey) {
if (sKey.toString() == 'Symbol(Symbol.toPrimitive)') { }
if (sKey.toString() == 'valueOf') { }
if (sKey.toString() == 'toString') {}
if (sKey.toString() == 'Symbol(Symbol.toStringTag)') {}
print(oTarget);
print(sKey.toString());
return Reflect.get(oTarget, sKey);
},
};
let p_1 = new Proxy(obj1, handler_1);
print(p_1.toString());
print("BT_FLAG");
```
Output of ChakraCore(ch 1.10) :
```
/(?:)/
toString
TypeError: RegExp.prototype.toString: 'this' is not a RegExp object
```
However, the output should be :
```
/(?:)/
toString
/(?:)/
source
/(?:)/
flags
/(?:)/
BT_FLAG
```
BT group
2018.08.24
|
Incorrect realization of RegExp.prototype.toString()
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5629/comments
| 1 |
2018-08-24T01:43:46Z
|
2020-03-25T08:53:17Z
|
https://github.com/chakra-core/ChakraCore/issues/5629
| 353,613,060 | 5,629 |
[
"chakra-core",
"ChakraCore"
] |
I recently hit a bug where Edge doesn't expose `searchParams` as a property on the URL class. According to the URL spec, `searchParams` is supposed return an instance of URLSearchParams.
Reference: https://url.spec.whatwg.org/#url-class
Codepen: https://codepen.io/macdonaldr93/pen/wEKwLa
|
The URL class in JavaScript doesn't implement the full spec (search params)
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5626/comments
| 5 |
2018-08-23T14:27:51Z
|
2018-08-23T23:40:30Z
|
https://github.com/chakra-core/ChakraCore/issues/5626
| 353,407,525 | 5,626 |
[
"chakra-core",
"ChakraCore"
] |
macOS Build doesn't support ch -? parameter,
but it obviously support flaglists, eg. -dump:globopt, -dump:bytecode, etc.
|
macOS Build doesn't support ch -? parameter
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5625/comments
| 2 |
2018-08-23T14:06:56Z
|
2018-10-09T23:21:55Z
|
https://github.com/chakra-core/ChakraCore/issues/5625
| 353,397,331 | 5,625 |
[
"chakra-core",
"ChakraCore"
] |
Hi everyone,
there is an inconsistency in Chakra if we seal a TypedArray the object is frozen as well. According to [specs](https://tc39.github.io/ecma262/#sec-setintegritylevel), Seal level should set only properties configurable to false.
version: 1.10.2
OS: Ubuntu 16.04 x64
steps to reproduce:
```js
let ta = new Int32Array(10);
Object.seal(ta);
if (Object.isExtensible(ta) !== false) throw new Error('Object.isExtensible should be false')
if (Object.isSealed(ta) !== true) throw new Error('Object.isSealed should be true')
if (Object.isFrozen(ta) !== false) throw new Error('Object.isFrozen should be false')
```
Actual results:
Error: Object.isFrozen should be false
Expected results:
pass without failures
SpiderMonkey works as expected, V8 fails because it cannot seal this object and JSC fails due non-enumerable/non-writable property on a typed array.
cinfuzz
|
Object.seal(TypedArray) should not freeze object as well
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5624/comments
| 0 |
2018-08-23T02:55:29Z
|
2018-08-29T20:55:52Z
|
https://github.com/chakra-core/ChakraCore/issues/5624
| 353,201,875 | 5,624 |
[
"chakra-core",
"ChakraCore"
] |
Hi everyone,
I find out an inconsistency in Array.toLocaleString when `typeof this` is called the return is `test`. V8, SpiderMonkey and JavaScriptCore return `string` as expected.
Chakra version: 1.10.2.0
O.S: MacOS High Sierra version 10.13.6
step to reproduce:
```js
"use strict";
Object.defineProperty(String.prototype, "toLocaleString", {
get() {
return function() { return typeof this; };
}
})
print(["test"].toLocaleString())
```
actual result:
test
expected result:
string
cinfuzz
|
Array.toLocaleString should return typeof string instead string value
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5621/comments
| 8 |
2018-08-22T19:55:57Z
|
2018-10-05T20:42:35Z
|
https://github.com/chakra-core/ChakraCore/issues/5621
| 353,100,548 | 5,621 |
[
"chakra-core",
"ChakraCore"
] |
The remarks in [the JsRef reference documention](https://github.com/Microsoft/ChakraCore/wiki/JsRef) say,
"A Chakra runtime will automatically track JsRef references as long as they are stored in local variables or in parameters (i.e. on the stack). Storing a JsRef somewhere other than on the stack requires calling JsAddRef and JsRelease to manage the lifetime of the object, otherwise the garbage collector may free the object while it is still in use."
Is this talking about tracking JsRef references on the JavaScript stack, or on the C++ stack of the host program?
|
Clarification on JsRef tracking
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5620/comments
| 6 |
2018-08-22T17:00:50Z
|
2018-10-10T01:15:12Z
|
https://github.com/chakra-core/ChakraCore/issues/5620
| 353,042,211 | 5,620 |
[
"chakra-core",
"ChakraCore"
] |
Hi MS team
We are seeing an issue with Edge / IE11 date format for ja-JP when using only Month and Day as an option. This is potentially coming from the CLDR version used by the Intl API but not sure.
Win 10 Microsoft Edge 42.17134.1.0:
Options: short, narrow for date without year results in missing month char in ja-JP
Expected: 8ζ5ζ₯ no matter which option is chosen for month
<img width="597" alt="screen shot 2018-08-21 at 1 26 26 pm" src="https://user-images.githubusercontent.com/13892147/44430165-b9eab900-a54e-11e8-8a7d-e6c18eb43e3e.png">
Win 10 Microsoft Internet Explorer Version 11.228.17134.0
Expected: 8ζ5ζ₯ no matter which option is chosen for month
<img width="751" alt="screen shot 2018-08-21 at 2 34 34 pm" src="https://user-images.githubusercontent.com/13892147/44430450-8eb49980-a54f-11e8-8889-61e7f5323441.png">
|
Edge and IE 11 - Date format for ja-JP locale is incorrect when using Month + Day in short and narrow options
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5619/comments
| 2 |
2018-08-21T21:39:42Z
|
2018-08-21T22:14:00Z
|
https://github.com/chakra-core/ChakraCore/issues/5619
| 352,720,767 | 5,619 |
[
"chakra-core",
"ChakraCore"
] |
Hi everyone,
according to ecma specs [String.padEnd](https://www.ecma-international.org/ecma-262/8.0/index.html#sec-string.prototype.padend) on step `8. If filler is the empty String, return S.`
V8 and Chakra throws a RangeError instead of return the original string.
In specs, if the maxLength is reached the maxLength should be converted to min(len, 2**53 - 1) but in this case the filler is an empty string, so Chakra should return the original string.
Chakra version: 1.10.2
OS: Ubuntu 16.04 x64
Steps to reproduce:
```js
let string = 'abc'.padEnd(34028236692, '');
if ( string !== 'abc') {
throw new Error('Test failed');
};
```
Actual results:
RangeError: String length is out of bound
Expected results:
pass without failures
JavascriptCore and SpiderMonkey works as expected.
cinfuzz
|
String.padStart and String.padEnd should return the original string if filler is an empty string
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5617/comments
| 3 |
2018-08-21T17:50:56Z
|
2018-09-21T00:07:46Z
|
https://github.com/chakra-core/ChakraCore/issues/5617
| 352,645,428 | 5,617 |
[
"chakra-core",
"ChakraCore"
] |
Hi, I'm sorry if this has been said before or if this is not the place to in fact say it, I'm not too much of a github guy.
So, there are some short but useful examples in the overview, but this is my first time doing stuff with interpreters, and I've found out I'm not as comfortable with javascript as I thought. All I'm trying to do is an interface for my c++ stuff. Allow anyone to be able to put together a script real quick and have a decent personalized tool. Use it as a console also.
I've gotten "far", I've only been at it for 2 days, but from what I can see documentation is scarce, I'm using the JRST reference, but I keep finding that some functions are missing, such as JsCreateExternalObjectWithPrototype or JsObjectDefineProperty.
Googling stuff yeilds no results (not that I've ever been brilliant at googling), and right now I've put together all my objects and their members, but I can't seem to get getters to work. I'm looking to do it with c++ natives, as I have been doing with most the other stuff.
I know it likely has something to do with JsDefineProperty, but I really have no clue on how to use it, and after 6 hours I've made no progress.
So I guess my question is how do you set a native getter, and where else should I ask these noob questions?
Thank you.
|
Undocumented functions. Also getters and setters.
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5615/comments
| 10 |
2018-08-20T21:43:38Z
|
2020-03-25T08:41:24Z
|
https://github.com/chakra-core/ChakraCore/issues/5615
| 352,307,314 | 5,615 |
[
"chakra-core",
"ChakraCore"
] |
```
var index = "0.1";
var ary = [0,1];
for (var i = 0; i < 10000; ++i)
{
// +index calls Op_ConvNumber which will return a double in this case.
// LdElemI will does a type check on the index and bails out if it's not an int, but rejits the exact same code.
ary[+index];
}
```
|
OpHelpers returning non-int values lead to Infinite bailouts on some array operations
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5614/comments
| 0 |
2018-08-20T20:56:54Z
|
2021-02-13T15:07:53Z
|
https://github.com/chakra-core/ChakraCore/issues/5614
| 352,293,568 | 5,614 |
[
"chakra-core",
"ChakraCore"
] |
Hi, following code behaves different from other JS engines.
```
function test0() {
var GiantPrintArray = [];
function v9870() {
try {
var arr = [];
var v9872 = [];
let rlt = Object.defineProperty(Array.prototype, "0",
{
configurable: true,
get: function () {
print("in get");
return 30;
}
});
GiantPrintArray.push(-1);
}
catch(ex) {
print(ex.message);
}
}
v9870();
print(GiantPrintArray[0]);
};
test0();
print("BT_FLAG");
```
In ChakraCore(ch version 1.10.0.0), the output is
```
-1
BT_FLAG
```
However, since setter is not defined, the exception message should be printed. Other JS engines' output :
```
setting getter-only property 0
in get
30
BT_FLAG
```
BT group
2018.8.20
|
Incorrect realization of Array.prototype.push
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5611/comments
| 3 |
2018-08-20T12:41:45Z
|
2018-08-23T17:47:14Z
|
https://github.com/chakra-core/ChakraCore/issues/5611
| 352,117,337 | 5,611 |
[
"chakra-core",
"ChakraCore"
] |
I saw we are using library function [swprintf_s](https://github.com/Microsoft/ChakraCore/blob/701d1af560cf0060df493c65c596d86bed708d4b/lib/Runtime/Library/JavascriptNumber.cpp#L931) to convert a double value to string, which has performance issues that have been discussed in .NET Core. See https://github.com/dotnet/coreclr/issues/10390 and https://github.com/dotnet/coreclr/issues/10651
In .NET Core 2.0, there's a new implementation that combined Grisu3 + Dragon4 algorithms to significantly improved the performance (I should say probably 7x faster). See these two PRs: https://github.com/dotnet/coreclr/pull/14646
https://github.com/dotnet/coreclr/pull/12894
Replace swprintf_s with the new implementation could make the double conversion much more faster.
|
Consider using Grisu3 + Dragon4 for double.ToString() conversion.
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5609/comments
| 1 |
2018-08-18T04:49:23Z
|
2020-09-21T21:02:47Z
|
https://github.com/chakra-core/ChakraCore/issues/5609
| 351,790,377 | 5,609 |
[
"chakra-core",
"ChakraCore"
] |
Chakra failed with error C2760 when build with permissive- by msvc on Windows, I use latest source on master branch. Could you please help take a look at this? Noted that this issue only found when compiles with unreleased vctoolset, that next release of MSVC will have this behavior.
**You can repro this issue as the steps below:**
1.git clone -c core.autocrlf=true https://github.com/microsoft/ChakraCore D:\Chakra\src
2.Open a clean x86 prompt (C:\windows\syswow64\cmd.exe) and browse to D:\Chakra\src
3.set _CL_=/permissive- /wd4471 /wd5043 /d1ParseTrees:identErrors-
4.msbuild /m /p:Platform=x86 /p:Configuration=Test /p:WindowsTargetPlatformVersion=10.0.17134.0 Build\Chakra.Core.sln /t:Rebuild
**Error info:**
d:\chakra\src\lib\runtime\library\propertyrecordusagecache.h(70,21): error C2760: syntax error: unexpected token '!', expected ';'
!OwnPropertyOnly, // CheckProto
^
d:\chakra\src\lib\runtime\library\propertyrecordusagecache.h(70,21): note: This diagnostic occurred in the compiler generated function 'bool Js::PropertyRecordUsageCache::TryGetPropertyFromCache(const Js::Var,Js::RecyclableObject *const ,Js::Var *const ,Js::ScriptContext *const ,Js::PropertyValueInfo *const ,Js::RecyclableObject *const ,Js::PropertyCacheOperationInfo *)'
!OwnPropertyOnly, // CheckProto
^
d:\chakra\src\lib\runtime\library\propertyrecordusagecache.h(154,17): error C2760: syntax error: unexpected token 'true', expected ';'
true, // CheckLocalTypeWithoutProperty
^
d:\chakra\src\lib\runtime\library\propertyrecordusagecache.h(154,17): note: This diagnostic occurred in the compiler generated function 'bool Js::PropertyRecordUsageCache::TrySetPropertyFromCache(Js::RecyclableObject *const ,Js::Var,Js::ScriptContext *const ,const Js::PropertyOperationFlags,Js::PropertyValueInfo *const ,Js::RecyclableObject *const ,Js::PropertyCacheOperationInfo *)'
true, // CheckLocalTypeWithoutProperty
|
Chakra failed with error C2760 when build with permissive- by msvc on Windows
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5607/comments
| 2 |
2018-08-17T02:50:11Z
|
2019-11-26T08:19:04Z
|
https://github.com/chakra-core/ChakraCore/issues/5607
| 351,438,707 | 5,607 |
[
"chakra-core",
"ChakraCore"
] |
This issue is regarding a bit of code the ICU implementation for Intl. (cc: @jackhorton).
Currently, it looks like ChakraCore calls `ucal_setGregorianChange` and sees if it *fails* with `U_UNSUPPORTED_ERROR ` in order to detect non-Gregorian calendars.
Link to the code:
https://github.com/Microsoft/ChakraCore/blob/c567e4e674e1d1e6af0006060c0277846fe1f862/lib/Runtime/Library/IntlEngineInterfaceExtensionObject.cpp#L2658
However, it seems like you could instead directly call the ICU API `ucal_getType`, and then simply check for the string "`gregorian`" instead to see if the underlying calendar object was a Gregorian calendar or not.
Link to ICU API docs: http://icu-project.org/apiref/icu4c/ucal_8h.html#ac3da68a172e0dff2097004c811a49b13
This seems like it would help clean it up a bit. :)
|
Intl ICU: Call ucal_getType instead of calling ucal_setGregorianChange and checking for failure?
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5603/comments
| 0 |
2018-08-16T00:23:40Z
|
2018-08-28T15:50:50Z
|
https://github.com/chakra-core/ChakraCore/issues/5603
| 351,012,559 | 5,603 |
[
"chakra-core",
"ChakraCore"
] |
I started playing with ChakraCore in a multi-threaded environment (Rust, using a multi-threaded HTTP server) and stumbled into frequent `JsErrorWrongThread` errors. It seems to happen when trying to `JsSetCurrentContext` in a thread while it's active in another thread.
After chatting on gitter, I came to understand there's no synchronization going on in ChakraCore and it's the host's responsibility to handle that.
Coming from V8, they have a `v8::Locker` RAII which takes care of locking a `v8::Isolate` (eq to `JsRuntime`) for a given thread. I believe it works like:
- If the isolate is already locked to the current thread, increment a counter (a bit like a `JsAdd`)
- Once the Locker unlocks (instance drops out of scope), decrement the counter (like `JsRelease`)
- At `0`, this Isolate is ready to be locked onto a different thread (or the same, really)
This allows efficient usage within the same thread, but also a seamless experience across threads (when using the Locker.)
If `JsSetCurrentContext` could do that work, it'd be easy to use ChakraCore in multi-threaded environments. I think a different set of functions would be fine too.
Our use case is a multi-threaded HTTP server and also a multi-threaded event loop. Async operations might complete in a different thread.
Related question: What's the cost of switching a context to a different thread?
|
Multi-threaded synchronization
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5599/comments
| 5 |
2018-08-15T13:11:11Z
|
2018-08-25T22:23:42Z
|
https://github.com/chakra-core/ChakraCore/issues/5599
| 350,803,646 | 5,599 |
[
"chakra-core",
"ChakraCore"
] |
Seems only can effect the js code logic:
Maybe the stack obj memory should be discarded after the deep copy, and redirect the ref to the stack obj data to the new heap obj memory.
otherwise, the optimized code execution result "heap_arr[index] == stack_arr[index]" not true, which changed the code logic.
[seems_a_bug_but_not_security_one.js.txt](https://github.com/Microsoft/ChakraCore/files/2289215/seems_a_bug_but_not_security_one.js.txt)
|
seems a optimization bug when an object escaped
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5598/comments
| 1 |
2018-08-15T04:42:24Z
|
2018-08-22T23:27:47Z
|
https://github.com/chakra-core/ChakraCore/issues/5598
| 350,683,966 | 5,598 |
[
"chakra-core",
"ChakraCore"
] |
ChakraCore 1.10.1 does not work anymore on Windows Server 2008 R2. The server is fully patched. Just try to run the ch.exe running a simple script and it will crash.
ChakraCore 1.10.0 works fine.
|
Crashes on 2008 R2
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5595/comments
| 8 |
2018-08-14T12:02:45Z
|
2018-08-17T12:51:02Z
|
https://github.com/chakra-core/ChakraCore/issues/5595
| 350,398,437 | 5,595 |
[
"chakra-core",
"ChakraCore"
] |
This issue is as minor as they come - no impact on CC when you're running it.
But slightly annoying redundancy when running the script a lot e.g. when developing any new JsBuiltIn (unless I'm misunderstanding and the repeat is needed):
https://github.com/Microsoft/ChakraCore/blob/f5c33acaf24f5899435ac295ab8597611e743103/RegenAllByteCodeNoBuild.cmd#L31-L39
|
RegenAllByteCodeNoBuild.cmd regens JsBuiltIns twice
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5591/comments
| 0 |
2018-08-11T18:25:17Z
|
2018-08-13T18:26:40Z
|
https://github.com/chakra-core/ChakraCore/issues/5591
| 349,754,074 | 5,591 |
[
"chakra-core",
"ChakraCore"
] |
Object.fromEntries is a stage 3 proposal: https://github.com/tc39/proposal-object-from-entries
It'd be great to get it implemented in Chakra soon!
Test262 tests are here: https://github.com/tc39/test262/pull/1676
Ref: https://github.com/tc39/proposal-object-from-entries/issues/21
|
Implement Object.fromEntries
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5590/comments
| 3 |
2018-08-11T05:31:20Z
|
2018-09-06T07:20:35Z
|
https://github.com/chakra-core/ChakraCore/issues/5590
| 349,707,738 | 5,590 |
[
"chakra-core",
"ChakraCore"
] |
Try the following in console:
>m1 = new Map();
[object Map]: {size: 0}
>m1.set(Symbol.for("n1"), "v1");
[object Map]: {size: 1}
> m1.get(Symbol.for("n1"));
undefined
Actual: undefined
Expected: "v1"
Same works in Chrome and returns "v1".
Symbol.for() should have created an entry in the global symbol registry.
Screenshot below

EDGE version:
Microsoft Edge 42.17134.1.0
Microsoft EdgeHTML 17.17134
Windows 10 Enterprise Eval, Version: 1803, OS Build: 17134.1
|
Symbol.for and usage as Map key do not work as expected
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5587/comments
| 12 |
2018-08-09T23:48:57Z
|
2018-08-22T23:24:03Z
|
https://github.com/chakra-core/ChakraCore/issues/5587
| 349,329,360 | 5,587 |
[
"chakra-core",
"ChakraCore"
] |
Hello.
The following script will raise a compile error.
`trace("ζ©ε€©ζ₯Ό"2222, true, 3.14);`
And the source property of exception-metadata is wrong.
like this:
`trace("ζ©ε€©ζ₯Ό"2222, true, m File`
In Scanner::SysAllocErrorLine(), `pEnd` calculation is failed with two or more bytes character.
It makes insufficient string and we can see uninitialized memory.
environment: ChakraCore v1.10.1/Win10/64bit
|
The source property of exception-metadata may be wrong.
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5585/comments
| 1 |
2018-08-08T14:07:25Z
|
2019-01-22T20:15:23Z
|
https://github.com/chakra-core/ChakraCore/issues/5585
| 348,742,524 | 5,585 |
[
"chakra-core",
"ChakraCore"
] |
Hi everyone,
according to [es6 specs](https://tc39.github.io/ecma262/#sec-regexp.prototype.compile) chakra should throw a TypeError if the object does not have a RegExpMatcher.
OS: Ubuntu 16.04 x64
chakra version: 1.10.1.0
steps to reproduce:
```js
RegExp().constructor().constructor.prototype.compile(RegExp.prototype)
```
Actual results:
pass without failures
Expected results:
TypeError: Method RegExp.prototype.compile called on incompatible receiver [object Object]
V8, Spiderminkey and JSC works as expected. Running with the flag `-ES6Experimental` the test works as expected (maybe some flags are supported only in experimental mode).
cinfuzz
|
RegExp.prototype.compile with incompatible Object
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5579/comments
| 1 |
2018-08-07T20:02:18Z
|
2020-03-25T08:53:29Z
|
https://github.com/chakra-core/ChakraCore/issues/5579
| 348,466,761 | 5,579 |
[
"chakra-core",
"ChakraCore"
] |
I've got a test program that does the following in two separate threads. I understand that the runtime and context can only be accessed by one thread at a time.
In the main thread, create a runtime and a context, and execute some JavaScript code to add a function called "square" to the global object. The JavaScript code being run is very simple:
`function square(number) { return number * number; }`
The API calls in the main thread are the following, in this order:
JsCreateRuntime
JsCreateContext
JsAddRef: passing in the JsContextRef so the Context won't be garbage collected.
JsSetCurrentContext
JsCreateExternalArrayBuffer: create a buffer that points to the JavaScript code to be run.
JsCreateString: create a string for the URL parameter to JsRun
JsRun: run the JavaScript code to create the "square" function.
JsSetCurrentContext(JS_INVALID_REFERENCE)
After that a second thread is spawned. This second thread will be calling the "square" function. It makes the following API calls, in this order:
JsSetCurrentContext
JsGetGlobalObject
JsCreatePropertyId
At this point the second thread occasionally seg faults (SIGSEGV) in the call to JsCreatePropertyId.
The back trace looks like:
#0 0x000055e69854223e in Memory::RecyclerWriteBarrierManager::WriteBarrier(void*) ()
#1 0x000055e69857d6e7 in ThreadContext::GetOrAddPropertyId(char16_t const*, int, Js::PropertyRecord const**) ()
#2 0x000055e6985698ae in Js::ScriptContext::GetOrAddPropertyRecord(char16_t const*, int, Js::PropertyRecord const**) ()
#3 0x000055e6984b252b in JsGetPropertyIdFromNameInternal(char16_t const*, unsigned long, void**)::{lambda(Js::ScriptContext*)#1} ContextAPINoScriptWrapper_Core<_JsErrorCode ContextAPINoScriptWrapper_NoRecord<JsGetPropertyIdFromNameInternal(char16_t const*, unsigned long, void**)::{lambda(Js::ScriptContext*)#1}>(JsGetPropertyIdFromNameInternal(char16_t const*, unsigned long, void**)::{lambda(Js::ScriptContext*)#1}, bool, bool)::{lambda(Js::ScriptContext*)#1}>(_JsErrorCode, bool, bool) ()
#4 0x000055e6984af6cb in JsCreatePropertyId ()
This test program is written in Rust, which is why I'm not just including the source code, but instead trying to describe the API calls I'm making.
I'd appreciate any help in figuring out what I'm doing wrong here.
|
Seg fault when accessing Context from multiple threads
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5577/comments
| 10 |
2018-08-07T14:35:35Z
|
2018-08-09T15:28:41Z
|
https://github.com/chakra-core/ChakraCore/issues/5577
| 348,349,776 | 5,577 |
[
"chakra-core",
"ChakraCore"
] |
Hi everyone,
this is a inconsistency on Chakra that can declare global binding `undefined`.
OS: Ubuntu 16.04 x64
chakra: 1.10.1.0
steps to reproduce:
```js
function undefined () {print('Test failed')}
undefined()
'use strict'
function undefined () {print('Test failed')}
undefined()
```
Actual results:
Test failed
Test failed
Expected results:
SpiderMonkey: TypeError: Property must be configurable or both writable and enumerable (Early error)
V8: SyntaxError: Identifier 'undefined' has already been declared (Early Error)
JSC: TypeError: undefined is not a function. (In 'undefined()', 'undefined' is undefined)
The others engines throws an Error as expected. I'm not sure if this case should be a TypeError (jsc/sm) or a SyntaxError (V8) but the test cannot pass without failures.
cinfuzz
|
Chakra should not redeclare "undefined" keyword
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5576/comments
| 2 |
2018-08-07T10:18:19Z
|
2018-10-02T22:52:15Z
|
https://github.com/chakra-core/ChakraCore/issues/5576
| 348,257,781 | 5,576 |
[
"chakra-core",
"ChakraCore"
] |
Debug build of ChakraCore received SIGILL with an ASSERTION FAILURE.
ASSERTION 15614: (/data/ChakraCore/lib/Runtime/Base/ScriptContext.cpp, line 2809) this->threadContext->GetRecordedException() == nullptr || GetThreadContext()->HasUnhandledException()
Failure: (this->threadContext->GetRecordedException() == nullptr || GetThreadContext()->HasUnhandledException())
```
$ ./build.sh --debug
$ ./out/Debug/ch test.js
$ cat test.js
WScript.LoadScript('', '', {
toString: function () {
func_0();
}
});
```
OS: Ubuntu 18.04 LTS
Arch: x86_64
|
ChakraCore crashes with assertion failure in ScriptContext.cpp:2809
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5572/comments
| 2 |
2018-08-04T07:14:37Z
|
2018-08-23T21:36:09Z
|
https://github.com/chakra-core/ChakraCore/issues/5572
| 347,595,661 | 5,572 |
[
"chakra-core",
"ChakraCore"
] |
Debug build of ChakraCore received SIGILL with an ASSERTION FAILURE.
```
$ ./build.sh --debug
$ ./out/Debug/ch test.js
ASSERTION 14607: (/data/ChakraCore/lib/Parser/Scan.h, line 495) static_cast<charcount_t>(m_pchMinTok - m_pchBase) >= m_cMinTokMultiUnits
Failure: (static_cast<charcount_t>(m_pchMinTok - m_pchBase) >= m_cMinTokMultiUnits)
$ cat test.js
eval('\u20091a')
```
OS: Ubuntu 18.04 LTS
Arch: x86_64
|
ChakraCore crashes with assertion failure in Scan.h:495
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5571/comments
| 1 |
2018-08-04T06:37:13Z
|
2018-08-15T23:58:30Z
|
https://github.com/chakra-core/ChakraCore/issues/5571
| 347,593,433 | 5,571 |
[
"chakra-core",
"ChakraCore"
] |
The documentation for JsCreatePropertyId at https://github.com/Microsoft/ChakraCore/wiki/JsCreatePropertyId indicates that the 'name' parameter may consist of only digits.
I'm confused as I expect the name to be the name of whatever property you're going to get/set, and not just a string representation of an integer.
|
Proper use of name parameter for JsCreatePropertyId
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5570/comments
| 5 |
2018-08-03T18:27:47Z
|
2020-04-12T00:35:52Z
|
https://github.com/chakra-core/ChakraCore/issues/5570
| 347,494,311 | 5,570 |
[
"chakra-core",
"ChakraCore"
] |
'use strict';
var o = [1,2,3]
Object.freeze(o);
console.log(delete o[1]);
Result: Assert: (result || !(propertyOperationFlags & (PropertyOperation_StrictMode | PropertyOperation_ThrowOnDeleteIfNotConfig)))
|
Assertion when deleting indexed property from frozen array
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5564/comments
| 1 |
2018-08-01T20:02:55Z
|
2018-08-01T23:54:37Z
|
https://github.com/chakra-core/ChakraCore/issues/5564
| 346,747,758 | 5,564 |
[
"chakra-core",
"ChakraCore"
] |
Following up on the discussion in this PR https://github.com/Microsoft/ChakraCore/pull/5471. Right now for eval cases we always assume superpopertyallowed status and then throw a runtime error for error cases. Ideally is should be a Syntax Error.
```js
function foo() {
print(eval("print('Inside eval');super.a"));
}
foo();
```
This shouldn't print 'Inside eval' at all. We should only get a SyntaxError.
<sub>edit:formatting</sub>
|
Super property access in eval cases should throw SyntaxError not runtime error
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5559/comments
| 4 |
2018-07-31T18:58:58Z
|
2019-06-07T18:34:01Z
|
https://github.com/chakra-core/ChakraCore/issues/5559
| 346,316,819 | 5,559 |
[
"chakra-core",
"ChakraCore"
] |
As @huaiyudavid recently pointed out, jshost respects `-forceSerialized` (checked in `ScriptEngine::CompileUTF8Core`), but ch seems to have no corresponding code.
|
support `-forceSerialized` command line switch in ch
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5558/comments
| 5 |
2018-07-30T20:27:47Z
|
2018-08-22T23:15:40Z
|
https://github.com/chakra-core/ChakraCore/issues/5558
| 345,921,956 | 5,558 |
[
"chakra-core",
"ChakraCore"
] |
Currently, the parser does not recognize the destructuring object/array as an array rest parameter and as such, everything in the object/array remains uninitialized. However, the specific case of having object destructuring works syntactically (see issue #5550). For example:
```
function foo(a, ...{...rest}) {
console.log(JSON.stringify(rest));
}
foo(1, 2, 3);
```
results in rest being empty, when it should be {0:2, 1:3}.
The parser currently treats the `{...rest}` as a var declaration instead of a destructuring assignment in `ParseFncFormals()`.
Note: When fixing this, also check for the effect of eval("").
@tcare
|
Destructuring unrecognized when nested in Array Rest
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5551/comments
| 3 |
2018-07-27T21:20:58Z
|
2019-05-28T20:05:09Z
|
https://github.com/chakra-core/ChakraCore/issues/5551
| 345,369,866 | 5,551 |
[
"chakra-core",
"ChakraCore"
] |
The unit test in destructuring_bugs.js, "Rest as pattern at param with arguments/eval at function body" yields differing values from other engines. The eshost output is attached below:
```
#### ch-1.10.1
4
5
3
3
4
5
3
1,2
#### sm
undefined
undefined
3
3
undefined
undefined
3
1,2
#### node
undefined
undefined
3
3
undefined
undefined
3
[ 1, 2 ]
```
Generated by:
```
(function ([a, b], c, ...{rest1, rest2}) {
eval("");
console.log(rest1);
console.log(rest2);
console.log(c);
console.log(arguments[1]);
})([1, 2], 3, {rest1:4, rest2:5});
(function ([a, b], c, ...{rest1, rest2}) {
(function () {
console.log(rest1);
console.log(rest2);
console.log(a+b);
})();
eval("");
console.log(arguments[0]);
})([1, 2], 3, {rest1:4, rest2:5});
```
|
Differing behavior with other engines for nested destructuring in array rest
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5550/comments
| 0 |
2018-07-27T21:15:49Z
|
2019-05-28T20:05:09Z
|
https://github.com/chakra-core/ChakraCore/issues/5550
| 345,368,655 | 5,550 |
[
"chakra-core",
"ChakraCore"
] |
Hi everyone,
according to [9.4.5.3](https://www.ecma-international.org/ecma-262/8.0/index.html#sec-integer-indexed-exotic-objects-defineownproperty-p-desc) it is possible define a property key if it is a numeric index, Chakra throws a TypeError instead.
OS: Ubuntu 16.04
version: 1.10.1
Steps to reproduce:
```
var sample = new Float64Array(2)
print(Reflect.defineProperty(sample, "0", {
value: 42,
configurable: false,
enumerable: true,
writable: false
}))
```
Actual results:
TypeError: Cannot redefine non-configurable property '0'
Expected results:
false
V8, SpiderMonkey and JSC works as expected.
cinfuzz
|
Chakra should returns false if key is a numeric index and desc.writable is false
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5549/comments
| 2 |
2018-07-27T21:01:59Z
|
2018-08-15T20:09:32Z
|
https://github.com/chakra-core/ChakraCore/issues/5549
| 345,365,417 | 5,549 |
[
"chakra-core",
"ChakraCore"
] |
Hi everyone,
according to [24.3.4.13](https://www.ecma-international.org/ecma-262/8.0/index.html#sec-dataview.prototype.setfloat32) DataView.setFloat32 should cast to NaN when value argument is not present.
OS: Ubuntu 16.04
version: 1.10.1
steps to reproduce:
```
var buffer = new ArrayBuffer(8);
var sample = new DataView(buffer, 0);
var result = sample.setFloat32(0);
print(sample.getFloat32(0))
```
Actual results:
TypeError: Invalid arguments in DataView
Expected results:
NaN
V8, SpiderMonkey and JSC works as expected.
cinfuzz
|
DataView.setFloat32 should convert undefined value to NaN
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5548/comments
| 2 |
2018-07-27T19:04:07Z
|
2020-04-12T00:36:10Z
|
https://github.com/chakra-core/ChakraCore/issues/5548
| 345,334,279 | 5,548 |
[
"chakra-core",
"ChakraCore"
] |
If I try to instantiate a Intl.DateTimeFormat with very specific values (see below) I get the above exception.
So far this only happens with these values. Tried others combinations (for dates, times) and they all seems to be working.
This is not locale specific. It happens with any available locale.
```
new Intl.DateTimeFormat("en-US", {"minute" : "numeric"});
new Intl.DateTimeFormat("en-US", {"minute" : "2-digit"});
new Intl.DateTimeFormat("en-US", {"second" : "numeric"});
new Intl.DateTimeFormat("en-US", {"second" : "2-digit"});
```
|
Invalid procedure call or argument on Intl.DateTimeFormat
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5544/comments
| 13 |
2018-07-27T18:17:22Z
|
2018-08-23T00:04:41Z
|
https://github.com/chakra-core/ChakraCore/issues/5544
| 345,320,507 | 5,544 |
[
"chakra-core",
"ChakraCore"
] |
flatMap and flat are now Stage 3. https://github.com/tc39/proposal-flatMap
|
Implement Array.prototype.flatMap, Array.prototype.flat
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5543/comments
| 7 |
2018-07-27T10:30:18Z
|
2018-08-17T23:03:24Z
|
https://github.com/chakra-core/ChakraCore/issues/5543
| 345,175,600 | 5,543 |
[
"chakra-core",
"ChakraCore"
] |
The code uses `handler == null ` all over the place as the way to check for revocations.
That is a very confusing practice as it came up in https://github.com/Microsoft/ChakraCore/pull/5529
|
Add an `IsRevoked` helper to JavascriptProxy for more code clarity
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5542/comments
| 1 |
2018-07-26T23:51:13Z
|
2020-04-12T06:37:03Z
|
https://github.com/chakra-core/ChakraCore/issues/5542
| 345,043,617 | 5,542 |
[
"chakra-core",
"ChakraCore"
] |
I discovered that ChakraCore has supported ETW (https://github.com/Microsoft/ChakraCore/pull/1986
, https://github.com/Microsoft/ChakraCore/issues/328)
I want to leverage this powerful tool for CPU profiling and further analysis, for example, which is the hotspot in JS program/runtime, but I still can't find a way to get useful profile data.
According to the ETW introduction here (https://channel9.msdn.com/Events/Build/2017/P4099), I open MS TraceView, create a new LogSession with a particular GUID "{57277741-3638-4A4B-BDBA-0AC6E45DA56C}" (manifests/Microsoft-Scripting-Chakra-Instrumentation.man), but I see a lot of event activities logging in TraceView even I haven't launch ch.exe, I don't know why but I guess maybe conflict with the ChakraCore in my Edge browser due to they share the same GUID, is it possible?
Therefore, I changed the last digit of GUID from "C" to "B", then TraceView seems able to get some runtime behavior data from the particular ChakraCore during the javascript program execution, but these are all unknown event and process, you can check my attachment for the detail.
Could you tell me how to enable ETW feature in ChakraCore correctly?

|
How to do profiling with ETW
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5541/comments
| 7 |
2018-07-26T22:09:44Z
|
2018-07-30T23:30:53Z
|
https://github.com/chakra-core/ChakraCore/issues/5541
| 345,022,945 | 5,541 |
[
"chakra-core",
"ChakraCore"
] |
the following js code fragment can lead to a null pointer dereference.
```
function g()
{
for (var i=0;;++i)
{
for (var j=0;;++j){
var a =0;
}
}
}
g();
```
==10216==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x55b703964384 bp 0x7ffd0824e480 sp 0x7ffd0824e430 T0)
#0 0x55b703964383 in EmitBooleanExpression(ParseNode*, int, int, ByteCodeGenerator*, FuncInfo*, bool, bool) (/media/b/ext/ChakraCore-1.10.0/out/Release/ch+0x170a383)
#1 0x55b703966025 in ByteCodeGenerator::EmitInvertedLoop(ParseNodeLoop*, ParseNodeFor*, FuncInfo*) (/media/b/ext/ChakraCore-1.10.0/out/Release/ch+0x170c025)
#2 0x55b70392a05b in Emit(ParseNode*, ByteCodeGenerator*, FuncInfo*, int, bool, ParseNode*, bool) (/media/b/ext/ChakraCore-1.10.0/out/Release/ch+0x16d005b)
#3 0x55b703924439 in ByteCodeGenerator::EmitTopLevelStatement(ParseNode*, FuncInfo*, int) (/media/b/ext/ChakraCore-1.10.0/out/Release/ch+0x16ca439)
#4 0x55b703942582 in ByteCodeGenerator::EmitFunctionBody(FuncInfo*) (/media/b/ext/ChakraCore-1.10.0/out/Release/ch+0x16e8582)
#5 0x55b703947d95 in ByteCodeGenerator::EmitOneFunction(ParseNodeFnc*) (/media/b/ext/ChakraCore-1.10.0/out/Release/ch+0x16edd95)
#6 0x55b703942fa4 in ByteCodeGenerator::EmitScopeList(ParseNode*, ParseNode*) (/media/b/ext/ChakraCore-1.10.0/out/Release/ch+0x16e8fa4)
#7 0x55b703942b77 in ByteCodeGenerator::EmitScopeList(ParseNode*, ParseNode*) (/media/b/ext/ChakraCore-1.10.0/out/Release/ch+0x16e8b77)
#8 0x55b703942f91 in ByteCodeGenerator::EmitScopeList(ParseNode*, ParseNode*) (/media/b/ext/ChakraCore-1.10.0/out/Release/ch+0x16e8f91)
#9 0x55b7029737a1 in ByteCodeGenerator::Generate(ParseNodeProg*, unsigned int, ByteCodeGenerator*, Js::ParseableFunctionInfo**, unsigned int, bool, Parser*, Js::ScriptFunction**) (/media/b/ext/ChakraCore-1.10.0/out/Release/ch+0x7197a1)
#10 0x55b70297a6c8 in GenerateByteCode(ParseNodeProg*, unsigned int, Js::ScriptContext*, Js::ParseableFunctionInfo**, unsigned int, bool, Parser*, CompileScriptException*, Js::ScopeInfo*, Js::ScriptFunction**) (/media/b/ext/ChakraCore-1.10.0/out/Release/ch+0x7206c8)
#11 0x55b7028eb29a in Js::ScriptContext::GenerateRootFunction(ParseNodeProg*, unsigned int, Parser*, unsigned int, CompileScriptException*, char16_t const*) (/media/b/ext/ChakraCore-1.10.0/out/Release/ch+0x69129a)
#12 0x55b7028eb63d in Js::ScriptContext::LoadScript(unsigned char const*, unsigned long, SRCINFO const*, CompileScriptException*, Js::Utf8SourceInfo**, char16_t const*, LoadScriptFlag, void*) (/media/b/ext/ChakraCore-1.10.0/out/Release/ch+0x69163d)
#13 0x55b7026c1fdf in RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**) (/media/b/ext/ChakraCore-1.10.0/out/Release/ch+0x467fdf)
#14 0x55b7026cb85d in JsRun (/media/b/ext/ChakraCore-1.10.0/out/Release/ch+0x47185d)
#15 0x55b7025d1f97 in RunScript(char const*, char const*, unsigned long, void (*)(void*), void*, char*, void*) (/media/b/ext/ChakraCore-1.10.0/out/Release/ch+0x377f97)
#16 0x55b7025d3e72 in ExecuteTest(char const*) (/media/b/ext/ChakraCore-1.10.0/out/Release/ch+0x379e72)
#17 0x55b7025d49f2 in main (/media/b/ext/ChakraCore-1.10.0/out/Release/ch+0x37a9f2)
#18 0x7f70646fe82f in __libc_start_main /build/glibc-Cl5G7W/glibc-2.23/csu/../csu/libc-start.c:291
#19 0x55b7024fbce8 in _start (/media/b/ext/ChakraCore-1.10.0/out/Release/ch+0x2a1ce8)
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV (/media/b/ext/ChakraCore-1.10.0/out/Release/ch+0x170a383) in EmitBooleanExpression(ParseNode*, int, int, ByteCodeGenerator*, FuncInfo*, bool, bool)
==10216==ABORTING
|
null pointer dereference in EmitBooleanExpression
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5532/comments
| 5 |
2018-07-26T11:04:38Z
|
2018-08-31T17:43:39Z
|
https://github.com/chakra-core/ChakraCore/issues/5532
| 344,797,690 | 5,532 |
[
"chakra-core",
"ChakraCore"
] |
Hello, executing following code
```
var keys=""
var already_non_enmerable = false;
var getPrototypeOfCalled = 0;
var proxy = new Proxy({}, {
ownKeys: function() {
return ['a','b','a']; // make first a non-enumerable, and second a enumerable, second a won't show up
},
getOwnPropertyDescriptor: function(target, key){
var enumerable = true;
if(key === "a" && !already_non_enmerable)
{
enumerable=false;
already_non_enmerable = true;
}
return {
configurable: true,
enumerable: enumerable,
value: 42,
writable: true
};
},
getPrototypeOf: function(){
getPrototypeOfCalled++;
return null;
}
});
for(var key in proxy){ keys += key;}
print(keys);
print("BT_FLAG");
```
Output of ChakraCore:
```
getPrototypeOf
ownKeys
getOwnPropertyDescriptor: a
getOwnPropertyDescriptor: b
getOwnPropertyDescriptor: a
b
BT_FLAG
```
However, in ecma, 6.1.7.3Invariants of the Essential Internal Methods, [[OwnPropertyKeys]] must not contain any duplicate entries.
BT group
2018.7.26
|
proxy [[OwnPropertyKeys]] shouldn't return duplicate entries
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5531/comments
| 2 |
2018-07-26T01:57:22Z
|
2018-07-30T19:35:20Z
|
https://github.com/chakra-core/ChakraCore/issues/5531
| 344,666,711 | 5,531 |
[
"chakra-core",
"ChakraCore"
] |
Hi,
The following code behaves incorrectly (inconsistent with other engines).
```
new class extends new Proxy(class {},{}) {}
```
In ChakraCore, the output is
`TypeError: Object doesn't support this action`
However, in V8 , SpiderMonkey and JSC, output is
`BT_FLAG`
BT group
2018.7.25
|
Throw TypeError when new an object extends Proxy object
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5523/comments
| 3 |
2018-07-25T12:56:31Z
|
2018-07-26T00:00:12Z
|
https://github.com/chakra-core/ChakraCore/issues/5523
| 344,431,948 | 5,523 |
[
"chakra-core",
"ChakraCore"
] |
ChakraCore/test/typedarray/Uint8ClampedArray_es6.baseline
contains output of asserts failing. The corresponding js file should be changed to assert based on expected behavior.
|
Investigate and possibly fix asserts failing in baseline
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5520/comments
| 1 |
2018-07-24T22:28:13Z
|
2018-07-26T00:00:47Z
|
https://github.com/chakra-core/ChakraCore/issues/5520
| 344,226,460 | 5,520 |
[
"chakra-core",
"ChakraCore"
] |
Currently, if we're doing virtual typed array access and don't know whether the offset for the load of an element is necessarily within the 4GB reserved region, we insert bounds checks. However, we seem to do this too often, and in ways that don't give the best perf possible. Consider the following code under `-mic:1 -msjrc:1 -bgjit- -oopjit- -dump:globopt`:
```js
let arr = new Uint8Array(0x10000000);
function foo(i) {
i = i | 0;
if(i<0) i = 0;
if(i >= 64) i = 63
return arr[i];
}
foo(0)
foo(1)
foo(2)
for(let i=0;i<100;i++)
{
foo(i);
}
```
The typed array load in foo generates the following:
```
Line 4: return arr[i];
Col 5: ^
StatementBoundary #0 #0000
s3[LikelyCanBeTaggedValue_Uint8VirtualArray].var = LdRootFld s6(s1<s7>[Object]->arr)<0,m,++,s7!,s8,{arr(0)}>[LikelyCanBeTaggedValue_Uint8VirtualArray].var! #0000
s9(s2).i32 = FromVar s2[LikelyCanBeTaggedValue_Int].var! #0006 Bailout: #0006 (BailOutIntOnly)
BailOnNotArray s3[LikelyCanBeTaggedValue_Uint8VirtualArray].var #0006 Bailout: #0006 (BailOutOnNotArray)
BoundCheck 0 <= s9(s2).i32 #0006 Bailout: #0006 (BailOutOnArrayAccessHelperCall)
BoundCheck s9(s2).i32 < [s3[Uint8VirtualArray].var+32].u32 #0006 Bailout: #0006 (BailOutOnArrayAccessHelperCall)
BailTarget #0006 Bailout: #0006 (BailOutShared)
Nop #0006
s12(s0).i32 = LdElemI_A [s3[Uint8VirtualArray][><].var!+s9(s2).i32!].var #0006 Bailout: #0006 (BailOutConventionalTypedArrayAccessOnly)
```
This shows two potential improvements that we can get:
1. For virtual typed arrays, the bounds that we have to check are not the array bounds, but the bounds of the 4GB reserved region. This should be easier to prove statically (currently, even if we have an int range for the index that is within this region, we emit the bounds check).
2. If we can combine the bound check instructions, we can emit better assembly. Currently, these end up lowering as
```
GLOBOPT INSTR: BoundCheck 0 <= s9(s2).i32 #0006 Bailout: #0006 (BailOutOnArrayAccessHelperCall)
TEST s9(s2).i32, s9(s2).i32 #
JNSB $L12 #
$L13: [helper] #
[s19.u64 < (&BailOutKind)>].u32 = MOV 131072 (0x20000).u32 #
s21.u64 = LEA [s19.u64+XX < (FunctionBody [foo (#1.1), #2])>].u64 #
[s19.u64+XX < (Unknown)>].u64 = MOV s21.u64 #
JMP $L9 #
$L12: #
GLOBOPT INSTR: BoundCheck s9(s2).i32 < [s3[Uint8VirtualArray].var+32].u32 #0006 Bailout: #0006 (BailOutOnArrayAccessHelperCall)
CMP s9(s2).i32, [s3[Uint8VirtualArray].var+32].u32 #
JLT $L10 #
$L11: [helper] #
[s19.u64 < (&BailOutKind)>].u32 = MOV 131072 (0x20000).u32 #
s20.u64 = LEA [s19.u64+XX < (FunctionBody [foo (#1.1), #2])>].u64 #
[s19.u64+XX < (Unknown)>].u64 = MOV s20.u64 #
JMP $L9 #
$L10: #
```
We can, if the check is changed to be based on the 4GB region, change this to something along the lines of
```
SAR unused.u64, index.u64, (32-(elementsize-1))
JNZ helper
```
which saves one copy of the helper and one branch on the critical path.
|
Potential improvement for virtual typed array access
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5517/comments
| 0 |
2018-07-24T20:58:50Z
|
2018-07-24T20:59:09Z
|
https://github.com/chakra-core/ChakraCore/issues/5517
| 344,201,343 | 5,517 |
[
"chakra-core",
"ChakraCore"
] |
Most JS functions will have a bailout or something that uses native code data, but wasm functions never will (or almost never). We should change to only emit this instruction only if we actually need it. It's a bit tricky to track, since most of the uses are introduced during lowerer or later, but it should be doable.
|
don't emit LdNativeCodeData if function doesn't use any
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5516/comments
| 0 |
2018-07-24T19:16:22Z
|
2018-07-24T19:16:22Z
|
https://github.com/chakra-core/ChakraCore/issues/5516
| 344,168,320 | 5,516 |
[
"chakra-core",
"ChakraCore"
] |
Hello,
The following code behaves strangely (inconsistent with other engines).
```
var test = 1;
function fail(n, expected, result) { print("test " + test + "; expected " + expected + ", got " + result); }
function test0() {
var result;
var check;
result = (~ 2147483647);
check = this;
if(result != check) {{ fail(test, check, result); }} ++test;
}
test0();
print("BT_FLAG");
```
In ChakraCore, the output is
```
test 1; expected [object Object], got -2147483648
BT_FLAG
```
However, in V8 and SpiderMonkey, output is
```
test 1; expected [object global], got -2147483648
BT_FLAG
```
BT group
2018.7.24
|
Global object has no toStringTag unlike other engines
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5513/comments
| 4 |
2018-07-24T14:07:42Z
|
2018-08-10T23:47:46Z
|
https://github.com/chakra-core/ChakraCore/issues/5513
| 344,053,896 | 5,513 |
[
"chakra-core",
"ChakraCore"
] |
Hello,
The following code behaves strangely (inconsistent with other engines).
```
var testCount = 0;
function test(re, str, lastIndex, loopCount)
{
var formattedStr = str.replace(loopCount, '\\n')
print('********** Test #' * ++testCount+ " **********");
re.lastIndex = lastIndex;
for(var i = 0; i < loopCount; i++) {
print(' *** Iteration#' + (i+1))
print(' var re=' + re);
print(' var str=\'' + formattedStr + '\'');
print(' re.lastIndex = '+re.lastIndex);
print(' Result = ' + re.exec(str));
print(' re.lastIndex = ' + re.lastIndex);
}
}
var re = /^\s*|\s*$/;
test(/^\s*|\s*$/y, " ab", 1, 1);
print("BT_FLAG");
```
In ChakraCore, the output is
```
NaN **********
*** Iteration#1
var re=/^\s*|\s*$/y
var str=' ab'
re.lastIndex = 1
Result =
re.lastIndex = 3
BT_FLAG
```
However, in V8 and SpiderMonkey, output is
```
NaN **********
*** Iteration#1
var re=/^\s*|\s*$/y
var str=' ab'
re.lastIndex = 1
Result = null
re.lastIndex = 0
BT_FLAG
```
BT group
2018.7.24
|
Incorrect realization of lastIndex of RegExp
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5512/comments
| 1 |
2018-07-24T14:00:04Z
|
2020-03-25T08:53:49Z
|
https://github.com/chakra-core/ChakraCore/issues/5512
| 344,050,518 | 5,512 |
[
"chakra-core",
"ChakraCore"
] |
Hello,
The following code behaves strangely (inconsistent with other engines).
```
function test() {
x = 4;
do {
var ss = 100;
function ss() {
print("in func");
}
x--;
ss = 101; }
while(x>0)
}
test();
print("BT_FLAG")
```
In ChakraCore, the output is
`BT_FLAG`
However, in V8 and SpiderMonkey, output is
`SyntaxError: redeclaration of var ss:`
BT group
2018.7.24
|
Inconsistent output compared with other JS engines
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5511/comments
| 5 |
2018-07-24T13:52:07Z
|
2020-04-13T18:31:35Z
|
https://github.com/chakra-core/ChakraCore/issues/5511
| 344,046,953 | 5,511 |
[
"chakra-core",
"ChakraCore"
] |
Hello,
The following code behaves strangely (inconsistent with other engines).
```
function testToUint32InSplit() {
var re;
function toDictMode() {
re.x = 42;
delete re.x;
return "def";
}
re *= /./g // Needs to be global to trigger lastIndex accesses.
return testToStringInReplace(toDictMode(new String('a'), 'length'), 1);
}
function testToStringInReplace() {
var re;
function toDictMode() {
re.x = 42;
delete re.x;
return 42;
}
re = /./g; // Needs to be global to trigger lastIndex accesses.
return re[Symbol.split]("abc", { valueOf: toDictMode });
}
testToUint32InSplit();
testToStringInReplace();
print("BT_FLAG");
```
In ChakraCore, the output is
`TypeError: Object doesn't support property or method 'undefined'`
However, in V8 and SpiderMonkey, output is
`BT_FLAG`
BT group
2018.7.24
|
Support for regexp symbols like Symbol.split not enabled by default
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5510/comments
| 2 |
2018-07-24T08:21:07Z
|
2020-03-25T08:54:01Z
|
https://github.com/chakra-core/ChakraCore/issues/5510
| 343,932,927 | 5,510 |
[
"chakra-core",
"ChakraCore"
] |
Hello,
The following code behaves strangely (inconsistent with other engines).
```
checkNaN('b', 'a'.replace(/a/, new Proxy(() => 'b', {})));
if(!isNaN(Math.pow()))
{
print("error: Math.pow() is not NaN");
}
print("done");
function check(result, x, y) {
var rs = Math.pow(x, y);
if ( Math.abs(rs - result) > 0.00000000001) {
print("pow(" + x + " , " + y + ") != " + result);
print(" wrong result is pow(" + x + " , " + y + ") = " + rs);
}
}
function checkNaN(x, y) {
var rs = Math.pow(x, y);
if (!isNaN(rs)) {
print("pow(" + x + " , " + y + ") != NaN" );
print(" wrong result is pow(" + x + " , " + y + ") = " + rs);
}
}
print("BT_FLAG");
```
In ChakraCore, the output is
`TypeError: Function.prototype.toString: 'this' is not a Function object`
However, in V8, SpiderMonkey and JSC, output is
```
done
BT_FLAG
```
BT group
2018.7.24
|
Regex replace with proxied function attempts to stringify proxy instead of call it
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5509/comments
| 2 |
2018-07-24T08:14:55Z
|
2018-07-25T23:58:32Z
|
https://github.com/chakra-core/ChakraCore/issues/5509
| 343,930,931 | 5,509 |
[
"chakra-core",
"ChakraCore"
] |
Hello,
The following code behaves incorrectly (inconsistent with other engines).
```
RegExp.prototype.__defineGetter__("global", () => true);
print("BT_FLAG");
```
In ChakraCore, the output is
`TypeError: Cannot redefine non-configurable property 'global'`
However, in V8 , SpiderMonkey and JSC, output is
`BT_FLAG`
BT group
2018.7.24
|
Inconsistent output compared with other JS engines when handling global property of RegExp
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5508/comments
| 2 |
2018-07-24T08:02:49Z
|
2020-03-25T08:54:14Z
|
https://github.com/chakra-core/ChakraCore/issues/5508
| 343,927,122 | 5,508 |
[
"chakra-core",
"ChakraCore"
] |
I have attached crashing inputs [crashes-jit.zip](https://github.com/Microsoft/ChakraCore/files/2220301/crashes-jit.zip) with backtrace and context during crash.
To reproduce the issue run `ch` on **linux** with the crashing input as script:
```bash
$ ./ch <crashing input>
```
The crash only occurs when `new Array(...[])` is executed as JIT code, so you may have to increase recursion.
Here is a dump of the produced JIT code along with some debugging comments: [jit.zip](https://github.com/Microsoft/ChakraCore/files/2220344/jit.zip)
Backtrace:
```
#0 0x0000555555da88a0 in Js::RecyclableObject::GetType (this=<optimized out>) at /home/sww13/fuzz/target/ChakraCore/lib/Runtime/./Types/RecyclableObject.h:278
#1 Js::RecyclableObject::GetLibrary (this=<optimized out>) at /home/sww13/fuzz/target/ChakraCore/lib/Runtime/./Types/RecyclableObject.inl:51
#2 Js::RecyclableObject::GetScriptContext (this=<optimized out>) at /home/sww13/fuzz/target/ChakraCore/lib/Runtime/./Types/RecyclableObject.inl:56
#3 Js::CrossSite::MarshalVar (scriptContext=0x61a00001ec80, value=0x1, fRequestWrapper=false) at /home/sww13/fuzz/target/ChakraCore/lib/Runtime/Base/CrossSite.cpp:163
#4 0x0000555556983f0a in Js::JavascriptArray::GetSpreadArgLen (spreadArg=0x1, scriptContext=0x9) at /home/sww13/fuzz/target/ChakraCore/lib/Runtime/Library/JavascriptArray.cpp:11604
#5 0x0000555556a834f2 in Js::JavascriptFunction::GetSpreadSize (args=..., spreadIndices=<optimized out>, scriptContext=0x61a00001ec80) at /home/sww13/fuzz/target/ChakraCore/lib/Runtime/Library/JavascriptFunction.cpp:1024
#6 0x000055555682449b in Js::ProfilingHelpers::ProfiledNewScObjArraySpread_Jit (spreadIndices=0x7ffff7e5ca10, callee=0x7ffff21a7a40, framePointer=<optimized out>, profileId=1, arrayProfileId=1, callInfo=...) at /home/sww13/fuzz/target/ChakraCore/lib/Runtime/Language/ProfilingHelpers.cpp:561
```
`git bisect` reveals this issue is present since the merge of JIT:
```
$ git bisect skip
There are only 'skip'ped commits left to test.
The first bad commit could be any of:
5e1aca9f64c8d77a8214ba794165451b48350b33
4f93a9d8ce86b835159b867c24d72c241f20215f
ce9c17386ae3701121fec48c1ede73ab0dd298ef
3ab6f3e971776a0cf6b34c416d619dc3e4a390f3
960ec9a5a6a2d33d9a8cd67fc8a4a2cc7b717789
68e819f2e8bba958dd109db9c12015a0a7fb8a96
We cannot bisect more!
---
* 68e819f2e (HEAD, refs/bisect/bad) JIT: (xplat) address CR issues
* 3ab6f3e97 (refs/bisect/skip-3ab6f3e971776a0cf6b34c416d619dc3e4a390f3) JIT: signed integer overflow and other fixes
* ce9c17386 (refs/bisect/skip-ce9c17386ae3701121fec48c1ede73ab0dd298ef) JIT: build and test changes
* 5e1aca9f6 (refs/bisect/skip-5e1aca9f64c8d77a8214ba794165451b48350b33) JIT: PAL related changes
* 4f93a9d8c (refs/bisect/skip-4f93a9d8ce86b835159b867c24d72c241f20215f) JIT: to compile on Linux
* 960ec9a5a (refs/bisect/skip-960ec9a5a6a2d33d9a8cd67fc8a4a2cc7b717789) JIT: enable JIT on Linux
* 1834318a9 (refs/bisect/good-1834318a96565906ea212d7482d12c020009aa53) [MERGE #1675 @MikeHolman] fix bug with trying to use full JS strings from JIT
```
We can verify the issue against commit fc08987381da141bb686b5d0c71d75da96f9eb8a.
Credits: Simon WΓΆrner, Cornelius Aschermann, Daniel Teuchert, Tommaso Frassetto (all of Ruhr-UniversitΓ€t Bochum)
|
Crash in ProfiledNewScObjArraySpread_Jit on linux
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5503/comments
| 0 |
2018-07-23T17:20:06Z
|
2018-07-25T18:03:54Z
|
https://github.com/chakra-core/ChakraCore/issues/5503
| 343,722,206 | 5,503 |
[
"chakra-core",
"ChakraCore"
] |
```
new Date( "2018-07-23 09:53:16.752-07:00" );
```
The above results (in Edge console) `[date] Invalid Date: `
Firefox and chorme have supported this for 8+ years.
https://stackoverflow.com/questions/2182246/date-constructor-returns-nan-in-ie-but-works-in-firefox-and-chrome
```
new Date( "2018-07-23 09:53:16.752-07:00" );
new Date( "2018-07-23 09:53:16.752+07:00" );
// this one works - it's the only variant with timezone that does
new Date( "2018-07-23 09:53:16.752Z" );
```
all of those work in Node, chrome, firefox, my C library that parses javascript times.
|
Failure to parse date strings with timeone
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5502/comments
| 2 |
2018-07-23T17:19:55Z
|
2018-08-16T18:45:31Z
|
https://github.com/chakra-core/ChakraCore/issues/5502
| 343,722,153 | 5,502 |
[
"chakra-core",
"ChakraCore"
] |
There is a bug in the initialisation of module namespace objects when the module contains an indirect export.
Simple proof of concept
```js
//test.mjs
export {bar as foo} from "./test.mjs";
export const bar = 5;
import * as stuff from "./test.mjs";
print(JSON.stringify(stuff)); //prints {"bar":5} - should print {"bar":5, "foo":5}
print(Object.getOwnPropertyNames(stuff)); // correctly prints "bar, foo"
print(stuff.foo); // prints undefined - should print 5
```
Credit @fatcerberus for finding that there was a CC bug here
EDIT: deleted info on where I thought the bug came from as I think what I'd posted was wrong.
|
BUG: Module namespace objects have undefined Indirect exports
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5501/comments
| 1 |
2018-07-23T16:31:27Z
|
2018-10-31T19:15:47Z
|
https://github.com/chakra-core/ChakraCore/issues/5501
| 343,706,490 | 5,501 |
[
"chakra-core",
"ChakraCore"
] |
I found this via [an example on StackOverflow](https://stackoverflow.com/a/34717402/3918980) using the `RegExp` "/u" (Unicode) flag with `String.prototype.split` to convert a string into an array of characters without destroying surrogate pairs. The author noted this does not work in Edge (which I confirmed).
Repro:
```JavaScript
// returns ['π', 'π', 'π', 'π'] in Chrome/Firefox
// returns ['οΏ½','οΏ½','οΏ½','οΏ½','οΏ½','οΏ½','οΏ½','οΏ½'] in ChakraCore
'ππππ'.split(/(?=[\s\S])/u);
```
|
String.prototype.split with RegExp "/u" flag breaks surrogate pairs
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5500/comments
| 3 |
2018-07-23T16:31:22Z
|
2018-07-26T00:14:05Z
|
https://github.com/chakra-core/ChakraCore/issues/5500
| 343,706,450 | 5,500 |
[
"chakra-core",
"ChakraCore"
] |
I had an issue with my debugserver crashing when attempting to examine module namespace objects, so I investigated. It turns out that the ChakraCore debugger serializes module namespace objects quite a bit differently than it does for any other object.
I ran the following in miniSphere while under control of SSj:
```js
(async () => {
let a = await import('sphere-runtime');
let b = { pig: 812, cow: 1208, ape: -128 };
debugger;
})();
```
I added a bit of code to miniSphere to print the `JSON.stringify`'d object returned by the debugger.
Normal objects are serialized like so:
```json
{"name":"b","type":"object","className":"Object","display":"{...}","propertyAttributes":3,"handle":2}
```
Module namespaces on the other hand, look like this:
```json
{"name":"a","propertyAttributes":3,"handle":7}
```
Note in particular the missing type. There's no way to determine what kind of value this even is.
|
Module namespace object when examined in debugger has no value, type, etc.
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5499/comments
| 0 |
2018-07-22T17:59:07Z
|
2019-06-07T18:49:53Z
|
https://github.com/chakra-core/ChakraCore/issues/5499
| 343,425,818 | 5,499 |
[
"chakra-core",
"ChakraCore"
] |
This code should print both properties but only prints one:
```javascript
const blah = {"\0":"hi","\0\0":"hello"};
for (var i in new Proxy(blah, {})) console.log(blah[i]);
```
This is because JavascriptProxy::ProxyOwnkeysEnumerator::MoveAndGetNext is using a hash set of null-terminated strings, so it doesn't handle embedded nulls correctly. Most places we use CharacterBuffer or similar to do string hashing and comparisons correctly.
|
proxy property enumeration can skip items
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5492/comments
| 0 |
2018-07-20T16:20:27Z
|
2018-08-03T15:13:42Z
|
https://github.com/chakra-core/ChakraCore/issues/5492
| 343,168,589 | 5,492 |
[
"chakra-core",
"ChakraCore"
] |
When trying to extend a set to allow unique custom objects, I found an error stating:
`Set: 'this' is not a Set object`
Recreation:
https://jsfiddle.net/9xknubyj/
|
TypeScript class extending Set returns error.
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5491/comments
| 6 |
2018-07-20T11:04:11Z
|
2018-07-25T23:43:42Z
|
https://github.com/chakra-core/ChakraCore/issues/5491
| 343,066,414 | 5,491 |
[
"chakra-core",
"ChakraCore"
] |
Specifically `processNativeCodeSize` and `nativeCodeSize` on ThreadContext.
|
Redeferral should update the total jitted code size, so new functions don't hit the max jitted code cap.
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5487/comments
| 0 |
2018-07-19T20:46:44Z
|
2019-06-07T18:32:44Z
|
https://github.com/chakra-core/ChakraCore/issues/5487
| 342,883,244 | 5,487 |
[
"chakra-core",
"ChakraCore"
] |
Found from searching the spec for uses of `isCallable` after hitting #5479. This repros on the latest ChakraCore from master today.
Repro:
```javascript
// returns `[2]`
Array.from([1], () => 2);
// returns `[2]` in Chrome (V8) and Firefox
// throws "TypeError: Array.from: argument is not a Function object" in ChakraCore
Array.from([1], new Proxy(() => 2, {}));
```
See step 3.a in http://www.ecma-international.org/ecma-262/#sec-array.from
|
Calling `Array.from` fails when passed a `Proxy` of a `function`
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5480/comments
| 1 |
2018-07-18T17:51:36Z
|
2019-06-01T01:54:55Z
|
https://github.com/chakra-core/ChakraCore/issues/5480
| 342,429,684 | 5,480 |
[
"chakra-core",
"ChakraCore"
] |
Another variation of #4730 and #5282 where a `Proxy` to a `function` is not treated as callable. Unlike those issues this still repros after building the latest ChakraCore from master today.
Repro:
```javascript
// returns "best"
'test'.replace(/t/, function(c) { return 'b' }, {});
// returns "best" in Chrome (V8) and Firefox
// returns "function(c) { return 'b' }est" in ChakraCore
'test'.replace(/t/, new Proxy(function(c) { return 'b' }, {}));
```
See step 5 in http://www.ecma-international.org/ecma-262/#sec-string.prototype.replace
|
Calling `String.prototype.replace` stringifies a `Proxy` of a `function` instead of invoking it
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5479/comments
| 0 |
2018-07-18T17:44:16Z
|
2019-06-04T17:44:45Z
|
https://github.com/chakra-core/ChakraCore/issues/5479
| 342,427,166 | 5,479 |
[
"chakra-core",
"ChakraCore"
] |
Hi everyone,
I found a case of inconsistency using `eval` to evaluate a function that have a comma after function params.
OS: Ubuntu 16.04 x64
Version: 1.10.1
Step to reproduce:
```
let fun = (a,b) => { print( a + b ); }
fun(1,2)
fun(1,2, )
fun = (a,b, ) => { print( a + b ); } // with comma after params
fun(1,2)
```
Actual results:
```
3
3
SyntaxError: Syntax error
```
Expected results:
```
3
3
3
```
V8, SpiderMonkey, JSC and XS works as expected.
cinfuzz
|
Chakra should eval function with comma after params
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5478/comments
| 1 |
2018-07-18T17:41:33Z
|
2018-08-07T11:49:58Z
|
https://github.com/chakra-core/ChakraCore/issues/5478
| 342,426,361 | 5,478 |
[
"chakra-core",
"ChakraCore"
] |
Hello,
The following code behaves strangely (inconsistent with other engines).
```
class c {
[d = function () {
return c;
}]() {
}
}
print("BT_FLAG");
```
In ChakraCore, the output is
`BT_FLAG`
However, in V8 and SpiderMonkey, output is
`ReferenceError: d is not defined`
BT group
2018.7.18
|
Inconsistent output compared with other JS engines
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5477/comments
| 1 |
2018-07-18T14:28:49Z
|
2018-09-15T00:37:28Z
|
https://github.com/chakra-core/ChakraCore/issues/5477
| 342,353,472 | 5,477 |
[
"chakra-core",
"ChakraCore"
] |
I can't find instructions on how to build ChakraCore as a library for UWP and I am not sure whether is better to use the ChakraRT that is part of the UWP platform or build and embed your own.
- Is the regular build UWP compatible or there is something that I am missing?
- What are the differences between using ChakraCore from the OS vs embedding own version?
I know that if I build my own, I will have to disable the JIT compiler. Does the ChakraCore in the OS JIT?
|
Buiding and using ChakraCore for UWP applications
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5470/comments
| 8 |
2018-07-17T19:52:22Z
|
2020-11-13T20:27:08Z
|
https://github.com/chakra-core/ChakraCore/issues/5470
| 342,060,694 | 5,470 |
[
"chakra-core",
"ChakraCore"
] |
Hello, I am working on some porting from V8 implemented [Unreal Engine Javascript plugin](https://github.com/ncsoft/Unreal.js-core) to [ChakraCore implementation](https://github.com/ninemcom/Unreal.js-core).
Its primary objective is supporting mobile devices(iOS, Android) and I got success from most devices. But I got reports about thread hanging issue for some old Samsung Android devices(like Galaxy S6). This problem exists even if I set flag `JsRuntimeAttributeDisableBackgroundWork` to disable threaded work. Unfortunately I couldn't use native debugger to that devices due to configuration.
To investigate the issue, I rebuilt it with `--trace` and some extra multithread traces turned on, but it always ends with waiting trace message at random timing. The trace log file is very huge I cannot just paste all contents to here. But here is last few lines:
```
07-09 16:22:24.680 26488 26591 E chakracore-log: [LCS-UN 0xcfd19670] ==> OK
07-09 16:22:24.680 26488 26591 E chakracore-log: ] VirtualAlloc_ /Users/9m/chakracore-build/ChakraCore/pal/src/map/virtual.cpp:1693
07-09 16:22:24.680 26488 26591 E chakracore-log: VirtualAlloc returning 0xae721000
07-09 16:22:24.680 26488 26591 E chakracore-log:
07-09 16:22:24.681 26488 26510 E chakracore-log: ] GetTickCount /Users/9m/chakracore-build/ChakraCore/pal/src/misc/time.cpp:185
07-09 16:22:24.681 26488 26510 E chakracore-log: GetTickCount ()
07-09 16:22:24.681 26488 26510 E chakracore-log: ] GetTickCount /Users/9m/chakracore-build/ChakraCore/pal/src/misc/time.cpp:190
07-09 16:22:24.681 26488 26510 E chakracore-log: GetTickCount returns DWORD 437670471
07-09 16:22:24.681 26488 26510 E chakracore-log: ] VirtualAlloc_ /Users/9m/chakracore-build/ChakraCore/pal/src/map/virtual.cpp:1625
07-09 16:22:24.681 26488 26510 E chakracore-log: VirtualAlloc(lpAddress=0xab950000, dwSize=77824, flAllocationType=0x1000, flProtect=0x4)
07-09 16:22:24.681 26488 26510 E chakracore-log: ] InternalEnterCriticalSection /Users/9m/chakracore-build/ChakraCore/pal/src/sync/cs.cpp:773
07-09 16:22:24.681 26488 26510 E chakracore-log: [ECS 0xcfd19670] Switching from {0, 0, 0} to {0, 0, 1} ==>
07-09 16:22:24.681 26488 26510 E chakracore-log: ] InternalEnterCriticalSection /Users/9m/chakracore-build/ChakraCore/pal/src/sync/cs.cpp:785
07-09 16:22:24.681 26488 26510 E chakracore-log: [ECS 0xcfd19670] ==> OK LockCount={0, 0, 1} lVal={0, 0, 0}
07-09 16:22:24.681 26488 26510 E chakracore-log: ] VIRTUALFindRegionInformation /Users/9m/chakracore-build/ChakraCore/pal/src/map/virtual.cpp:536
07-09 16:22:24.681 26488 26510 E chakracore-log: VIRTUALFindRegionInformation( 0xab950000 )
07-09 16:22:24.681 26488 26510 E chakracore-log: ] VIRTUALCommitMemory /Users/9m/chakracore-build/ChakraCore/pal/src/map/virtual.cpp:1117
07-09 16:22:24.681 26488 26510 E chakracore-log: Committing the memory now..
07-09 16:22:24.697 26488 26591 E chakracore-log: ] VirtualAlloc_ /Users/9m/chakracore-build/ChakraCore/pal/src/map/virtual.cpp:1625
07-09 16:22:24.700 26488 26591 E chakracore-log: VirtualAlloc(lpAddress=0xae722000, dwSize=4096, flAllocationType=0x1000, flProtect=0x4)
07-09 16:22:24.700 26488 26591 E chakracore-log: ] PALCS_WaitOnCS /Users/9m/chakracore-build/ChakraCore/pal/src/sync/cs.cpp:1202
07-09 16:22:24.700 26488 26591 E chakracore-log: [WCS 0xcfd19670] Switching from {0, 0, 1} to {1, 0, 1} ==>
07-09 16:22:24.700 26488 26591 E chakracore-log: ] PALCS_WaitOnCS /Users/9m/chakracore-build/ChakraCore/pal/src/sync/cs.cpp:1208
07-09 16:22:24.700 26488 26591 E chakracore-log: [WCS 0xcfd19670] ==> OK
07-09 16:22:24.700 26488 26591 E chakracore-log: ] PALCS_DoActualWait /Users/9m/chakracore-build/ChakraCore/pal/src/sync/cs.cpp:1237
07-09 16:22:24.700 26488 26591 E chakracore-log: Trying to go to sleep [CS=0xcfd19670]
07-09 16:22:24.700 26488 26591 E chakracore-log: ] PALCS_DoActualWait /Users/9m/chakracore-build/ChakraCore/pal/src/sync/cs.cpp:1247
07-09 16:22:24.700 26488 26591 E chakracore-log: Actually Going to sleep [CS=0xcfd19670]
```
It is one of hanging points I have got.
I know ChakraCore does not support these mobile devices officially yet but any tips or helps are very appreciated!
|
Some tips for multithread debugging?
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5463/comments
| 5 |
2018-07-16T00:22:59Z
|
2018-08-02T04:37:14Z
|
https://github.com/chakra-core/ChakraCore/issues/5463
| 341,364,795 | 5,463 |
[
"chakra-core",
"ChakraCore"
] |
This is a bit of an odd one. I've narrowed things down with a reproducer for investigation but I'm not at all sure how to really debug this further. The end result is a segfault on this line:
https://github.com/Microsoft/ChakraCore/blob/de80038b6ce0d224e121ff2439564a95dfbcd3a6/lib/Common/Memory/RecyclerWriteBarrierManager.cpp#L331
I have to say that I ended up finding this in a round about way investigating part of a larger project for bindings between Erlang and ChakraCore. In that case what I observed was that the filename reported in stack traces would randomly be reported as "Unknown script code" which didn't make sense and only reproduced randomly in my test suite runs (pointing at some sort of memory corruption or race condition).
I've managed to simplify this bug to a standalone program to remove any implication of the Erlang VM or other weird threading issues. To reproduce:
1. Build a debug version of ChakraCore with address sanitization. My exact build invocation:
```
$ ./build.sh --icu=/usr/local/opt/icu4c/include/ --extra-defines=U_USING_ICU_NAMESPACE=1 -j=4 -y -d --sanitize=address --libs-only
```
2. Compile the program bug.c (listed below) with:
```
$ gcc -o bug bug.c -fsanitize=address -I/usr/local/include -lChakraCore
```
3. Observe the segfault:
```
$ lldb bug
(lldb) target create "bug"
Current executable set to 'bug' (x86_64).
(lldb) run
Process 62055 launched: '/Users/davisp/tmp/chakra-bug-write-barrier/bug' (x86_64)
Process 62055 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=2, address=0xf1bf90001)
frame #0: 0x000000010183c682 libChakraCore.dylib`Memory::RecyclerWriteBarrierManager::WriteBarrier(address=0x000060d000001100) at RecyclerWriteBarrierManager.cpp:331
328 VerifyIsBarrierAddress(address);
329 #endif
330 const uintptr_t index = GetCardTableIndex(address);
-> 331 cardTable[index] |= DIRTYBIT;
332 #else
333 uint bitShift = (((uint)address) >> s_BitArrayCardTableShift);
334 uint bitMask = 1 << bitShift;
Target 0: (bug) stopped.
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=2, address=0xf1bf90001)
* frame #0: 0x000000010183c682 libChakraCore.dylib`Memory::RecyclerWriteBarrierManager::WriteBarrier(address=0x000060d000001100) at RecyclerWriteBarrierManager.cpp:331
frame #1: 0x000000010035d0a9 libChakraCore.dylib`Memory::WriteBarrierPtr<void>::WriteBarrierSet(this=0x000060d000001100, ptr=0x0000000000000000) at RecyclerPointers.h:407
frame #2: 0x00000001003654dd libChakraCore.dylib`Memory::WriteBarrierPtr<void>::WriteBarrierPtr(this=0x000060d000001100, ptr=0x0000000000000000) at RecyclerPointers.h:354
frame #3: 0x000000010036529d libChakraCore.dylib`Memory::WriteBarrierPtr<void>::WriteBarrierPtr(this=0x000060d000001100, ptr=0x0000000000000000) at RecyclerPointers.h:352
frame #4: 0x00000001004fd786 libChakraCore.dylib`Js::JsrtExternalArrayBuffer::JsrtExternalArrayBufferDetachedState::JsrtExternalArrayBufferDetachedState(this=0x000060d0000010d8, buffer="ChBc?, bufferLength=240, finalizeCallback=0x0000000000000000, callbackState=0x0000000000000000)(void*), void*) at JsrtExternalArrayBuffer.cpp:36
frame #5: 0x00000001004fd6a3 libChakraCore.dylib`Js::JsrtExternalArrayBuffer::JsrtExternalArrayBufferDetachedState::JsrtExternalArrayBufferDetachedState(this=0x000060d0000010d8, buffer="ChBc?, bufferLength=240, finalizeCallback=0x0000000000000000, callbackState=0x0000000000000000)(void*), void*) at JsrtExternalArrayBuffer.cpp:37
frame #6: 0x00000001004fd437 libChakraCore.dylib`Js::JsrtExternalArrayBuffer::CreateDetachedState(this=0x000000010fd0f060, buffer="ChBc?, bufferLength=240) at JsrtExternalArrayBuffer.cpp:31
frame #7: 0x00000001032708f7 libChakraCore.dylib`Js::ArrayBuffer::DetachAndGetState(this=0x000000010fd0f060) at ArrayBuffer.cpp:260
frame #8: 0x000000010051ec36 libChakraCore.dylib`Js::JsrtSourceHolder<bool (*)(unsigned long, void**, _JsParseScriptAttributes*), void (*)(unsigned long)>::JsrtSourceHolder(this=0x000000010fd44050, scriptLoadCallback=(bug`load_script), scriptUnloadCallback=(libChakraCore.dylib`DummyScriptUnloadCallback(unsigned long) at Jsrt.cpp:3987), sourceContext=0, serializedScriptValue=0x000000010fd0f060)(unsigned long, void**, _JsParseScriptAttributes*), void (*)(unsigned long), unsigned long, Js::ArrayBuffer*) at JsrtSourceHolder.h:55
frame #9: 0x000000010051f105 libChakraCore.dylib`Js::JsrtSourceHolder<bool (*)(unsigned long, void**, _JsParseScriptAttributes*), void (*)(unsigned long)>::JsrtSourceHolder(this=0x000000010fd44050, scriptLoadCallback=(bug`load_script), scriptUnloadCallback=(libChakraCore.dylib`DummyScriptUnloadCallback(unsigned long) at Jsrt.cpp:3987), sourceContext=0, serializedScriptValue=0x000000010fd0f060)(unsigned long, void**, _JsParseScriptAttributes*), void (*)(unsigned long), unsigned long, Js::ArrayBuffer*) at JsrtSourceHolder.h:59
frame #10: 0x000000010044965f libChakraCore.dylib`_JsErrorCode RunSerializedScriptCore<bool (*)(unsigned long, void**, _JsParseScriptAttributes*), void (*)(unsigned long)>(this=0x00007ffeefbfefc0, scriptContext=0x0000622000000158)(unsigned long, void**, _JsParseScriptAttributes*), void (*)(unsigned long), unsigned long, unsigned char*, Js::ArrayBuffer*, unsigned long, char16_t const*, bool, bool, void**, unsigned int)::'lambda'(Js::ScriptContext*)::operator()(Js::ScriptContext*) const at Jsrt.cpp:3902
frame #11: 0x0000000100448c2e libChakraCore.dylib`_JsErrorCode ContextAPINoScriptWrapper_NoRecord<_JsErrorCode RunSerializedScriptCore<bool (*)(unsigned long, void**, _JsParseScriptAttributes*), void (*)(unsigned long)>(bool (*)(unsigned long, void**, _JsParseScriptAttributes*), void (*)(unsigned long), unsigned long, unsigned char*, Js::ArrayBuffer*, unsigned long, char16_t const*, bool, bool, void**, unsigned int)::'lambda'(Js::ScriptContext*)>(this=0x00007ffeefbfed40, scriptContext=0x0000622000000158)(unsigned long, void**, _JsParseScriptAttributes*), bool, bool)::'lambda'(Js::ScriptContext*)::operator()(Js::ScriptContext*) const at JsrtInternal.h:331
frame #12: 0x0000000100447d67 libChakraCore.dylib`_JsErrorCode ContextAPINoScriptWrapper_Core<_JsErrorCode ContextAPINoScriptWrapper_NoRecord<_JsErrorCode RunSerializedScriptCore<bool (*)(unsigned long, void**, _JsParseScriptAttributes*), void (*)(unsigned long)>(bool (*)(unsigned long, void**, _JsParseScriptAttributes*), void (*)(unsigned long), unsigned long, unsigned char*, Js::ArrayBuffer*, unsigned long, char16_t const*, bool, bool, void**, unsigned int)::'lambda'(Js::ScriptContext*)>(bool (*)(unsigned long, void**, _JsParseScriptAttributes*), bool, bool)::'lambda'(Js::ScriptContext*)>(fn=(anonymous class) @ 0x00007ffeefbfed40, allowInObjectBeforeCollectCallback=false, scriptExceptionAllowed=false)(unsigned long, void**, _JsParseScriptAttributes*), bool, bool) at JsrtInternal.h:277
frame #13: 0x00000001004478d1 libChakraCore.dylib`_JsErrorCode ContextAPINoScriptWrapper_NoRecord<_JsErrorCode RunSerializedScriptCore<bool (*)(unsigned long, void**, _JsParseScriptAttributes*), void (*)(unsigned long)>(bool (*)(unsigned long, void**, _JsParseScriptAttributes*), void (*)(unsigned long), unsigned long, unsigned char*, Js::ArrayBuffer*, unsigned long, char16_t const*, bool, bool, void**, unsigned int)::'lambda'(Js::ScriptContext*)>(fn=(anonymous class) @ 0x00007ffeefbfefc0, allowInObjectBeforeCollectCallback=false, scriptExceptionAllowed=false)(unsigned long, void**, _JsParseScriptAttributes*), bool, bool) at JsrtInternal.h:329
frame #14: 0x000000010034cc64 libChakraCore.dylib`_JsErrorCode RunSerializedScriptCore<bool (*)(unsigned long, void**, _JsParseScriptAttributes*), void (*)(unsigned long)>(scriptLoadCallback=(bug`load_script), scriptUnloadCallback=(libChakraCore.dylib`DummyScriptUnloadCallback(unsigned long) at Jsrt.cpp:3987), scriptLoadSourceContext=0, buffer="ChBc?, bufferVal=0x000000010fd0f060, sourceContext=0, sourceUrl=u"example.js", parseOnly=false, useParserStateCache=false, result=0x00007ffeefbff760, sourceIndex=4294967295)(unsigned long, void**, _JsParseScriptAttributes*), void (*)(unsigned long), unsigned long, unsigned char*, Js::ArrayBuffer*, unsigned long, char16_t const*, bool, bool, void**, unsigned int) at Jsrt.cpp:3884
frame #15: 0x000000010034d098 libChakraCore.dylib`::JsRunSerialized(bufferVal=0x000000010fd0f060, scriptLoadCallback=(bug`load_script), sourceContext=0, sourceUrl=0x000000010fd063f0, result=0x00007ffeefbff760) at Jsrt.cpp:5187
frame #16: 0x00000001000023c6 bug`main + 2598
frame #17: 0x00007fff77afb015 libdyld.dylib`start + 1
frame #18: 0x00007fff77afb015 libdyld.dylib`start + 1
(lldb) print address
(void *) $0 = 0x000060d000001100
(lldb) print index
(uintptr_t) $1 = 25987907585
```
I'm still working on trying to tease apart what's supposed to be happening here to try and debug this further but I figured this would be enough to post in case someone more experienced with this software memory barrier stuff can already spot the issue with this information.
Also of note, I saw the documents on the write barrier stuff talking about using nullptr for the template specialization. After playing around I couldn't figure out how to get code to select that specialization directly. However this patch seems to fix things:
```diff
diff --git a/lib/Common/Memory/RecyclerPointers.h b/lib/Common/Memory/RecyclerPointers.h
index 90d8cbca9..082d6f63c 100644
--- a/lib/Common/Memory/RecyclerPointers.h
+++ b/lib/Common/Memory/RecyclerPointers.h
@@ -350,6 +350,11 @@ class WriteBarrierPtr
WriteBarrierPtr(const std::nullptr_t&) : ptr(nullptr) {}
WriteBarrierPtr(T * ptr)
{
+ if(ptr == NULL) {
+ this->ptr = NULL;
+ return;
+ }
+
// WriteBarrier
WriteBarrierSet(ptr);
}
```
Now, that seems like an obvious non-fix in that if I were to start using a non-NULL finalizeCallback and callbackState in the call to JsCreateExternalBuffer that this doesn't change anything fundamental about how those write barriers work. Although as an important data point, applying this patch fixes my much larger set of bindings for Erlang so it at least seems to be pointing the finger at this write barrier stuff having a bug somewhere.
Feel free to let me know if there's any other data/script/test that I can provide to investigate further. Thanks in advance for any help on this one!
bug.c:
```c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "ChakraCore.h"
#define CHECK(ERR, MSG) \
do { \
if(ERR != JsNoError) { \
fprintf(stderr, "%s\n", MSG); \
exit(1); \
} \
} while(0)
const char* URL = "example.js";
const char* SOURCE = "function a() {throw new Error();};";
void
free_copy_data(JsValueRef obj, void* ptr)
{
free(ptr);
}
bool
load_script(JsSourceContext ctx, JsValueRef* ref, JsParseScriptAttributes* attr)
{
JsErrorCode err;
err = JsCreateExternalArrayBuffer(
(void*) SOURCE,
strlen(SOURCE),
NULL,
NULL,
ref
);
CHECK(err, "create external array buffer - load script callback");
*attr = JsParseScriptAttributeNone;
return true;
}
int
main(int argc, char* argv[])
{
JsRuntimeHandle rt;
JsContextRef ctx;
JsValueRef url_str;
JsValueRef source_str;
JsValueRef buffer;
JsValueRef serialized;
JsValueRef result;
unsigned char* buffer_ptr;
unsigned int buffer_len;
unsigned char* copy_ptr;
JsErrorCode err;
err = JsCreateRuntime(JsRuntimeAttributeNone, NULL, &rt);
CHECK(err, "create runtime");
err = JsCreateContext(rt, &ctx);
CHECK(err, "create context");
err = JsSetCurrentContext(ctx);
CHECK(err, "set current context");
err = JsCreateString(URL, strlen(URL), &url_str);
CHECK(err, "create string - url_str");
err = JsCreateExternalArrayBuffer(
(void*) SOURCE,
strlen(SOURCE),
NULL,
NULL,
&source_str
);
CHECK(err, "crate external array buffer - source_str");
err = JsSerialize(source_str, &buffer, JsParseScriptAttributeNone);
CHECK(err, "serializing source_str");
err = JsGetArrayBufferStorage(buffer, &buffer_ptr, &buffer_len);
CHECK(err, "getting serialized buffer storage");
copy_ptr = (unsigned char*) malloc(buffer_len * sizeof(unsigned char));
if(copy_ptr == NULL) {
exit(2);
}
memcpy(copy_ptr, buffer_ptr, buffer_len);
err = JsCreateExternalArrayBuffer(
copy_ptr,
buffer_len,
NULL,
NULL,
&serialized
);
CHECK(err, "create external array buffer - serialized");
err = JsSetObjectBeforeCollectCallback(
serialized,
copy_ptr,
free_copy_data
);
CHECK(err, "set object before collect callback");
err = JsRunSerialized(
serialized,
load_script,
0,
url_str,
&result
);
CHECK(err, "run serialized");
err = JsSetCurrentContext(JS_INVALID_REFERENCE);
CHECK(err, "set current context - invalid ref");
err = JsDisposeRuntime(rt);
CHECK(err, "dispose runtime");
return 0;
}
```
|
Segfault in RecyclerWriteBarrierManager::WriteBarrier
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5461/comments
| 5 |
2018-07-13T21:57:28Z
|
2018-07-18T17:21:08Z
|
https://github.com/chakra-core/ChakraCore/issues/5461
| 341,171,144 | 5,461 |
[
"chakra-core",
"ChakraCore"
] |
Hi everyone,
I decide to disable ENABLE_CONCURRENT_GC, because in our application we don't want extra reserved memory for barriers table, but this result in serious performance implications.Basicly our application spend 95% of the time in GC, because it looks like every API call trigger cleanup.
So i decide to disable it for function ContextAPIWrapper_Core, but this result in a crash in JavascriptArray::DirectSetItem_Full.
Look like this line SparseArraySegment<T>* current = (SparseArraySegment<T>*)this->GetBeginLookupSegment(itemIndex, false);
returns wrong pointer(misinterpreted) or memory behind it is stomped.
I try to add 24 byte marker at begin of SparseArraySegmentBase which i set to zero and when crash occur βcurrentβ looks like :
Marker - >0x00000002bc9e8308 {0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00,
0x83, 0x46, 0x4d, 0xc8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x06, 0xc1, 0xff, 0xff, 0xff, 0xff}
Left -> 0xffffffff
Length ->0x00000000
size-> 0x00000005
Next -> 0xffffffff000206c1 { buffer=0xffffffff000206c1 {???, ???, ???, ???, ???, ???} left=???
Here is part of the call stack:
Js::SparseArraySegment<void*>::AllocateSegmentImpl<false>(Memory::Recycler* recycler, Js::SparseArraySegmentBase* prev, uint32 index) Line 205 + 0x4 bytes C++
Js::SparseArraySegment<void*>::AllocateSegment(Memory::Recycler* recycler, Js::SparseArraySegmentBase* prev, uint32 index) Line 194 + 0x10 bytes C++
Js::JavascriptArray::DirectSetItem_Full<void*>(uint32 itemIndex, void* newValue) Line 1413 + 0x10 bytes C++
Js::JavascriptArray::DirectSetItemAt<void*>(uint32 itemIndex, Js::Var newValue) Line 455 C++
Js::JavascriptArray::SetItem(uint32 index, Js::Var value, enum class Js::PropertyOperationFlags flags) Line 12534 + 0xc bytes C++
Js::JavascriptOperators::OP_SetElementI(Js::Var instance, Js::Var index, Js::Var value, Js::ScriptContext* scriptContext, enum class Js::PropertyOperationFlags flags) Line 4362 C++
Js::InterpreterStackFrame::OP_SetElementI<Js::OpLayoutT_ElementI<Js::LayoutSizePolicy<(LayoutSize)0>>>(const Js::OpLayoutT_ElementI<Js::LayoutSizePolicy<(LayoutSize)0>>* playout, enum class Js::PropertyOperationFlags flags) Line 5168 + 0x3c bytes C++
Js::InterpreterStackFrame::OP_SetElementIStrict<Js::OpLayoutT_ElementI<Js::LayoutSizePolicy<(LayoutSize)0>>>(const Js::OpLayoutT_ElementI<Js::LayoutSizePolicy<(LayoutSize)0>>* playout) Line 5212 C++
Js::InterpreterStackFrame::ProcessUnprofiled() Line 268 + 0x26 bytes C++
Js::InterpreterStackFrame::Process() Line 3521 + 0x9 bytes C++
Js::InterpreterStackFrame::ProcessThunk(void* address, void* addressOfReturnAddress) Line 2525 + 0x9 bytes C++
Js::InterpreterStackFrame::InterpreterHelper(Js::ScriptFunction* function, Js::ArgumentReader args, void* returnAddress, void* addressOfReturnAddress, struct Js::InterpreterStackFrame::AsmJsReturnStruct* asmJsReturn) Line 2033 + 0x14 bytes C++
Js::InterpreterStackFrame::InterpreterThunk(Js::RecyclableObject* function, Js::CallInfo callInfo, ...) Line 1754 + 0x37 bytes C++
Do you have some ideas what is source the crash or some suggestions how to reduce time spent in GC when ENABLE_CONCURRENT_GC is disable.
|
Bad performance when disable concurrent GC
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5458/comments
| 6 |
2018-07-13T10:52:45Z
|
2019-06-07T18:48:27Z
|
https://github.com/chakra-core/ChakraCore/issues/5458
| 340,973,883 | 5,458 |
[
"chakra-core",
"ChakraCore"
] |
Hi everyone,
I would like to report an issue when using "use strict" and declaring a function twice on same scope the others engines raises a SyntaxError, maybe this issue is a dupe of #5076.
Chakra: 1.10.1
OS: Ubuntu 16.04 x86
Steps to reproduce:
```
function test() {
"use strict";
function f() {
return 1;
}
{
function f() {
return 2;
}
function f() {
return 3;
}
}
return f() === 1;
}
if (!test())
throw new Error("Test failed");
```
Actual results:
pass without failures
Expected results:
SyntaxError: redeclaration of function
SpiderMonkey, V8 and JavaScriptCore works as expected.
|
Chakra should throw SyntaxError when declaring function twice with "use strict"
|
https://api.github.com/repos/chakra-core/ChakraCore/issues/5453/comments
| 3 |
2018-07-12T14:26:31Z
|
2018-07-14T02:04:09Z
|
https://github.com/chakra-core/ChakraCore/issues/5453
| 340,661,861 | 5,453 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.