oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
74.11k stars 2.76k forks source link

Crashed on docker #13814

Open Davincible opened 1 month ago

Davincible commented 1 month ago

How can we reproduce the crash?

Not sure what happened but the console asked me to file a report

Relevant log output

No response

Stack Trace (bun.report)

Bun v1.1.27 (267afa2) on linux x86_64_baseline [RunAsNodeCommand]

Segmentation fault at address 0x00000005

Davincible commented 1 month ago

Here's my dockerfile

# syntax=docker/dockerfile:1

# Use the Bun base image
FROM oven/bun:alpine AS base
WORKDIR /app

# Install dependencies in a separate stage to leverage cache
FROM base AS install
WORKDIR /temp/dev

RUN apk add --no-cache python3

RUN --mount=type=bind,source=package.json,target=package.json \
    --mount=type=bind,source=bun.lockb,target=bun.lockb \
    bun install --frozen-lockfile

# Development stage, copying necessary files and setting up the dev server
FROM base AS dev
WORKDIR /app

# Install inotify-tools for file watching
RUN apk add --no-cache inotify-tools python3

# Create a non-root user 'container' for building the project
RUN addgroup -S container && adduser -S container -G container

USER container

# Copy dependencies from the install stage
COPY --from=install /temp/dev/node_modules node_modules

# Copy the rest of the app's source code
COPY . .

# Expose port for the development server
EXPOSE 6001

# Command for watching and running the development server
CMD ["sh", "-c", "inotifywait -m -e modify package.json | while read -r filename event; do bun install; done & bun run dev"]
Davincible commented 1 month ago
Bun v1.1.27 (267afa29) Linux x64 (baseline)
Linux Kernel v6.6.48 | glibc v2.34
CPU: sse42 popcnt avx avx2
Args: "node" "/app/node_modules/.bin/rsbuild" "dev"
Features: jsc Bun.stdin(2) bunfig dotenv http_server spawn tsconfig_paths(2) tsconfig(2) 
Builtins: "bun:jsc" "bun:main" "node:assert" "node:async_hooks" "node:buffer" "node:child_process" "node:constants" "node:crypto" "node:events" "node:fs" "node:http" "node:https" "node:module" "node:net" "node:os" "node:path" "node:perf_hooks" "node:querystring" "node:stream" "node:string_decoder" "node:tls" "node:tty" "node:url" "node:util" "node:util/types" "node:vm" "node:zlib" "node:worker_threads" "node:v8" "node:inspector" 
Elapsed: 8291ms | User: 15158ms | Sys: 1615ms
RSS: 2.05GB | Peak: 0.87GB | Commit: 2.05GB | Faults: 0

panic(main thread): Segmentation fault at address 0x5
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:

 https://bun.report/1.1.27/Bn1267afa2AqqghkDu8rklE+xxQ_+r0/1Dkym45E6xg3iF4zp9mF4xmi7D__A2AK

error: script "dev" was terminated by signal SIGILL (Illegal instruction)
Davincible commented 1 month ago

Ah I see https://github.com/oven-sh/bun/issues/11628 now

So no quick fix :(