Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SegmentationFault at 3 when parsing a large JSON file #188

Closed
lawrencecchen opened this issue Jun 14, 2022 · 3 comments
Closed

SegmentationFault at 3 when parsing a large JSON file #188

lawrencecchen opened this issue Jun 14, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@lawrencecchen
Copy link
Contributor

–––– bun meta ––––
Bun v0.0.83 macOS Silicon 21.4.0
AutoCommand: public_folder
Elapsed: 598ms | User: 29ms | Sys: 34ms
RSS: 54.62MB | Peak: 54.62MB | Commit: 0.27GB | Faults: 732
–––– bun meta ––––

Reproduction: https://github.com/lawrencecchen/stripe-sync/tree/1a49d8cf81ab573d39e823f8eef06d717e3efdd6

bun index.ts

@Jarred-Sumner
Copy link
Collaborator

thanks for reporting

@Jarred-Sumner
Copy link
Collaborator

I think the issue is in the console.log implementation. Seems to stack overflow on large objects

If you do JSON.stringify(object) it works

@sno2 sno2 added bug Something isn't working segfault labels Jul 29, 2022
@github-actions github-actions bot removed the crash label Oct 22, 2022
@Electroid
Copy link
Contributor

Tested on MacOS with 0.2.2, looks like this issue is fixed.

const response = await fetch(
  "https://raw.githubusercontent.com/json-iterator/test-data/master/large-file.json",
  {
    headers: {
      "Accept-Encoding": "identity",
    }  
  }
);
const body = await response.text();
const json = JSON.parse(body);
console.log(json);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants