bun icon indicating copy to clipboard operation
bun copied to clipboard

SegmentationFault when using Honojs on Bun and testing using Hoppscotch.

Open ethndotsh opened this issue 1 year ago • 4 comments

Version

0.1.5

Platform

Darwin My-Air.lan 22.0.0 Darwin Kernel Version 22.0.0: Tue Jun 28 20:48:02 PDT 2022; root:xnu-8792.0.134.131.2~1/RELEASE_ARM64_T8103 arm64

What steps will reproduce the bug?

  1. Create a new Bun project
  2. Install Hono using bun add hono
  3. Add this code to index.js:
import { Hono } from "hono";
import { cors } from "hono/cors";

const app = new Hono();

app.use("*", cors());

app.get("/", (c) => {
  return c.json({ status: 200, message: "OK" }, 200);
});

export default {
  port: 3001,
  fetch: app.fetch,
};
  1. Visit Hoppscotch.io and make a request to http://localhost:3001
  2. The server should crash with a SegmentationFault
  3. Test using another client such as Thunder Client or just Google Chrome, and it should respond with a status code of 200.

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

This happens every time I make a request using Hoppscotch.io, which is my preferred HTTP client.

What is the expected behavior?

A proper request that goes through with the HTTP status code of 200

What do you see instead?

No response and a SegmentationFault in the console.

Additional information

No response

ethndotsh avatar Jul 29 '22 15:07 ethndotsh

With native Bun.serve it works?

xHyroM avatar Jul 29 '22 17:07 xHyroM

No it is still broken even when using Bun.serve

ethndotsh avatar Jul 29 '22 18:07 ethndotsh

Can you send full segmentation fault?

xHyroM avatar Jul 29 '22 18:07 xHyroM

[0.37ms] ".env"
Nova server started

SegmentationFault at 18446181123756130306


–––– bun meta ––––
Bun v0.1.5 macOS Silicon 22.0.0
RunCommand: dotenv 
Elapsed: 2349ms | User: 43ms | Sys: 62ms
RSS: 0.22GB | Peak: 0.22GB | Commit: 67.11MB | Faults: 73
–––– bun meta ––––

Ask for #help in https://bun.sh/discord or go to https://bun.sh/issues

This is after making a GET request

ethndotsh avatar Jul 29 '22 19:07 ethndotsh

@cursecodes Hi, can you try again with the latest bun? (bun upgrade). just tried with v0.1.10, it works fine now :)

zhuzilin avatar Aug 20 '22 10:08 zhuzilin

This is fixed as of 0.1.10 - if you see this happening again please comment and we'll re-open

Jarred-Sumner avatar Sep 05 '22 08:09 Jarred-Sumner