hermes: Throw an exception that should not be thrown

Version

3826084

Build steps

hermes/utils/build/build_llvm.py --distribute
hermes/utils/build/configure.py --distribute
cd build_release && ninja

Testcase

var NISLFuzzingFunc = function(i) {
    while (--i >= 0) {
        this[i] = null;
    }
    print("hello world");
};
var NISLParameter0 = 710403;
NISLFuzzingFunc(NISLParameter0);

Execution steps

./build_release/bin/hermes -w testcase.js

Output

RangeError: Property storage exceeds 196607 properties
    at NISLFuzzingFunc (testcase.js:3:17)
    at global (testcase.js:8:16)

Expected output

hello world

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 23 (9 by maintainers)

Commits related to this issue

Most upvoted comments

Hot module reloading sometimes hit this, requires manual reload to clean things up.

@kapil21 No, it does not fail for array.

Screen Shot 2023-01-06 at 10 07 02 AM

Note that this restriction on the number of properties does not exist for arrays.

it fails for Array also . try this line let arry = Array(196608).fill(0); and it will fail.

it was failing if you log it . ex console.log(arry)

@KianSalehi my comment above, which you quoted, wasn’t referring to the map() function, I was referring to an object being used as a dictionary. You would see this error if you put more than about 190,000 properties in a single object. Typically this indicates that the object is either used as an array, or is used as a dictionary. Both of these can be corrected by using an actual array or an actual Map.

@tmikov Can’t confirm this because we are exactly in the middle of developing a module that do internal cleanups, it stopped happening again somewhere in the progress. Good catch though, stopped me from worrying if it was other little things.

There must be an object that is used as a map somewhere in the code, which isn’t being cleaned up.

Note that this restriction on the number of properties does not exist for arrays.