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 is auto-restarting due to crash [time: 1715357374657] #10990

Open
jerrieok opened this issue May 10, 2024 · 0 comments
Open

Bun is auto-restarting due to crash [time: 1715357374657] #10990

jerrieok opened this issue May 10, 2024 · 0 comments
Labels
bug Something isn't working crash An issue that could cause a crash

Comments

@jerrieok
Copy link

How can we reproduce the crash?

Bun v1.1.7 (b0b7db5) Linux x64
Args: "bun", "run", "--watch", "app.ts", "--debug"
Features: jsc fetch(142) http_server transpiler_cache(6) tsconfig
Builtins: "bun:main" "node:buffer" "node:child_process" "node:crypto" "node:events" "node:fs" "node:fs/promises" "node:net" "node:os" "node:path" "node:stream" "node:string_decoder" "node:timers" "node:tls" "node:url" "node:util" "node:util/types"
Elapsed: 8289ms | User: 26534ms | Sys: 7697ms
RSS: 1.01GB | Peak: 0.23GB | Commit: 1.01GB | Faults: 0

panic: Segmentation fault at address 0x11
oh no: Bun has crashed. This indicates a bug in Bun, not your code.

To send a redacted crash report to Bun's team,
please file a GitHub issue using the link below:

JavaScript/TypeScript code that reproduces the crash?

for (const vo of json.data) {
    const insert: any = {
      item_id: vo.id,
      name: vo.itemName,
      cost_price: vo.minSalesPrice,
      sham_num: Math.floor(Math.random() * 1000) + 1,
      status: 1,
    }
    console.log(insert)
    //图片下载
    let i = 1
    for (const url of vo.itemMainImage) {
      const path = `/static/shop/${md5(url)}.jpg`
      let file: any = Bun.file(`${rootPath}/${path}`)
      if (await file.exists()) continue
      fetch(url).then(async response => {
        loadImage(Buffer.from(await response.arrayBuffer())).then(async image => {
          let buffer: any = Buffer.from(await response.arrayBuffer())
          let canvas: any = createCanvas(800, 800)
          let ctx: any = canvas.getContext('2d')
          ctx.drawImage(image, 0, 0, canvas.width, canvas.height)
          await Bun.write(`${rootPath}/${path}`, canvas.toBuffer('image/png'))
          buffer = null
          canvas = null
          ctx = null
          file = null
        })
      })
      insert[`pic${i}`] = path
      i++
      if (i > 4) break
    }
    await dbQuery('REPLACE INTO shop_items SET ?', insert)
  }
  postMessage('picker goods complete!')

Relevant log output

No response

Stack Trace (bun.report)

Bun v1.1.7 (b0b7db5) on linux x86_64 [AutoCommand]

Segmentation fault at address 0x00000011

Features: jsc, fetch, tsconfig

@jerrieok jerrieok added bug Something isn't working crash An issue that could cause a crash labels May 10, 2024
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

1 participant