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

Segmentation fault on a particular env variable with Apple Silicon #554

Closed
thomscoder opened this issue Jul 10, 2022 · 7 comments
Closed
Labels
bug Something isn't working crash An issue that could cause a crash

Comments

@thomscoder
Copy link

thomscoder commented Jul 10, 2022

Version

0.1.2

Platform

Darwin Kernel Version 21.5.0

What steps will reproduce the bug?

  • created a React App with bun create react ./react-app
  • created a .env file and put WELCOME_MESSAGE=ReactAppWithBun
  • {process.env.WELCOME_MESSAGE} in App.jsx

The bug (?) only presents with that particular env variable. Works well with every other variables I've tested.

How often does it reproduce? Is there a required condition?

All the time in React App created with bun create react

What is the expected behavior?

Correctly displaying the values of the env variables.

What do you see instead?

Segmentation fault error

SegmentationFault at 1929388152


–––– bun meta ––––
Bun v0.1.2 macOS Silicon 21.5.0
DevCommand: single_page_app_routing fast_refresh bun_bun public_folder dotenv 
Elapsed: 3372ms | User: 7ms | Sys: 16ms
RSS: 9.52MB | Peak: 9.52MB | Commit: 71.34MB | Faults: 268
–––– bun meta ––––

Additional information

Schermata 2022-07-10 alle 22 45 55

Just adding one letter at the end of the env variable everything turns to work normally
Schermata 2022-07-10 alle 23 03 50

@thomscoder thomscoder changed the title Segmentation Fault with certain env variables on Apple Silicon Segmentation fault on a particular env variable with Apple Silicon Jul 10, 2022
@HarishTeens
Copy link

HarishTeens commented Jul 11, 2022

After a rigorous process of hit and trial. This issue seems to appear only when the Key and the Value of the env is exactly of length 15

@Jarred-Sumner
Copy link
Collaborator

Super interesting

@thomscoder
Copy link
Author

thomscoder commented Jul 11, 2022

After a rigorous process of hit and trial. This issue seems to appear only when the Key and the Value of the env is exactly of length 15

I confirm.
Tried with env set = HelloFromBun!!! or any other 15 characters string and it crashed with segmentation fault error.

Only in scaffolded React project. Works fine in a basic:

WELCOME_MESSAGE=HelloFromBun!!!
export default {
 port: 3000,
 fetch(request) {
   return new Response(process.env.WELCOME_MESSAGE); 
 }
}

for example

@whiny-nil
Copy link

I'm also getting segfault errors if there are blank lines in any .env files.

@sno2 sno2 added bug Something isn't working segfault labels Jul 29, 2022
@Johann01
Copy link

Johann01 commented Sep 11, 2022

Exactly the same issue, with .env, just containing:

NOTION_TOKEN=[REDACTED]

If the string content has a different length, it works, but not with that combination.

@github-actions github-actions bot removed the crash label Oct 22, 2022
@Electroid
Copy link
Contributor

Confirming this is still an issue. Here's the reproduction:

// .env
WELCOME_MESSAGE=ReactAppWithBun
// index.js
export default {
  port: 3000,
  fetch(request) {
    return new Response(process.env.WELCOME_MESSAGE); 
  }
}

Output:

SegmentationFault at 0x753700F300000000


----- bun meta -----
Bun v0.2.2 (88ddb103) macOS Silicon 21.5.0
RunCommand: bun_bun dotenv 
Elapsed: 25ms | User: 18ms | Sys: 7ms
RSS: 20.61MB | Peak: 20.61MB | Commit: 67.11MB | Faults: 5
----- bun meta -----

@Electroid Electroid added the crash An issue that could cause a crash label Nov 1, 2022
@Electroid Electroid reopened this Jan 18, 2023
@Jarred-Sumner
Copy link
Collaborator

I'm not able to reproduce this as of v0.4.0+ (tested 0.4, 0.5, 0.5.7, and 0.5.8), but please leave a comment/reopen if still happening

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

7 participants