bytecodealliance / bytecodealliance/javy

Deeply nested object causes stack overflow error on compile

Open
#1,070 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Rust
Stars
2.7k
Forks
135
Avg merge
1d 44m
Merged PRs (30d)
11

Description

This JS seems to cause a Wasm-level stack overflow error when run with `javy build`:

```js
let foo = {"":[[null,[[{},"",[],[],[{},[[],[-5102808638908533466,{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":[],"\n\n;":[[],[[],[[").","",[],[],null,{},[[],[[[],[],[[],[[{},[{},[],[],[[[null,[[{},"",[],[],[{},[[],[-5102808638908533466,{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{}},"\n\n;":[[],[[],[[").","",[],[],null,{},{},"",[],[],[{},[[],[-5102808638908533466,{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{}},"\n\n;":[[],[[],[[").","",[],[],null,{},[[],[[[],[],[[],[[{},[{},[],[],[{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":[],"\n\n;":[[],[[],[[").","",[],[],null,{},[[],[[[],[],[[],[[{},[{},[],[],[[[null,[[{},"",[],[],[{},[[],[-5102808638908533466,{"":{"":{"":{"0":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":[],"\n\n;":[[],[[],[[").","",[],[],null,{},[[],[[[],[],[[],{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":[],"\n\n;":[[],[[],[[").","",[],[],null,{},[[],[[[],[],[[],[[{},[{},[],[],[[[null,[[{},"",[],[],[{},[[],[-5102808638908533466,{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{}},"\n\n;":[[],[[],[[").","",[1.2681253932520594e-233,["",[],[],[{},[[],[-5102808638908533466,{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{}},"\n\n;":[[],[[],[[").","",[],[],null,{},[[],[[[],[],[[],[[{},[{},[],[],[{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":""}}}}}}}}}}}}}}}}}}}}]]]]]]]]]]]]}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}]]]]]]]]]}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}]]]]]]]]]]]]]]]]]]]}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}]]]]]]]]}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}]]]]]]]]]]]]]]]]]]]}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"\n\u000f)":[]}]]]]]]]]]]]]}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}]]]]]]]}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}]]]]]]]]]]]]]]]]]]]}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}]]]]]]]};
```

This behaviour reproduces on v7.0.1 and `main`. The JS runs correctly when executed with NodeJS. The context is I tried using the fuzzer and it found this case.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.