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

Bun crashed after processing over a million results from an external API #10855

Open
Jelle-SamsonIT opened this issue May 5, 2024 · 3 comments
Labels
bug Something isn't working crash An issue that could cause a crash

Comments

@Jelle-SamsonIT
Copy link

Jelle-SamsonIT commented May 5, 2024

How can we reproduce the crash?

I have no idea yet. I had my fresh code process a million search results from an external API that indexes public storage bucket

I cannot give a detailed crash report yet as I didn't encounter it again. There's 10k pages of HTTP requests happening here divided over 5 webworkers that process data from the external API and insert it into SQLite using many async/awaits.

Too complicated to trace, and i've only seen it happen once, but i wanted to get the crash report to you. There's probably some memory leaks in my code still too 😁
image

JavaScript/TypeScript code that reproduces the crash?

Relevant log output

No response

Stack Trace (bun.report)

Bun v1.1.5 (b257a30) on linux x86_64 [RunCommand]

Segmentation fault at address 0x00000000

  • ld-temp.o:0: WTF::Unicode::convertUTF16ToUTF8
  • 1 unknown/js code
@Jelle-SamsonIT Jelle-SamsonIT added bug Something isn't working crash An issue that could cause a crash labels May 5, 2024
@Jarred-Sumner
Copy link
Collaborator

Are the Worker instances being closed at any point?

@Jelle-SamsonIT
Copy link
Author

Jelle-SamsonIT commented May 5, 2024

Negative.
I added a worker.terminate() just to be sure and freed the callback. That may be where my memory leak came from: I'm setting worker[index].callback to be my callback to be executed when it's done:

image

Will try again this week and report back!

@truongan07
Copy link

upgrade to v.1.1.7 was fixed leak memory in my case. You can try upgrade

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

No branches or pull requests

3 participants