Skip to content

Crashed while trying to use better-sqlite3 via @verdant-web/server #18957

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

Closed
laptou opened this issue Apr 11, 2025 · 2 comments
Closed

Crashed while trying to use better-sqlite3 via @verdant-web/server #18957

laptou opened this issue Apr 11, 2025 · 2 comments
Labels
crash An issue that could cause a crash node.js Compatibility with Node.js APIs runtime windows An issue that is known to occur on Windows

Comments

@laptou
Copy link

laptou commented Apr 11, 2025

How can we reproduce the crash?

I triggered this bug by running a @verdant-web/server instance and then attempting to sync some data into it. Since the crash specifically occurs when the database is opened, you can probably reproduce it just by trying to use better-sqlite3.

Relevant log output

107 |         return opts[p] || p;
108 |       })
109 |     );
110 |     tries.push(n);
111 |     try {
112 |       b = opts.path ? requireFunc.resolve(n) : requireFunc(n);
                                                     ^
error: LoadLibrary failed: A dynamic link library (DLL) initialization routine failed.  
 code: "ERR_DLOPEN_FAILED"

      at bindings (C:\Users\ibiyemi\projects\archivist\sync\node_modules\bindings\bindings.js:112:48)
      at new Database (C:\Users\ibiyemi\projects\archivist\sync\node_modules\better-sqlite3\lib\database.js:48:29)
      at <anonymous> (C:\Users\ibiyemi\projects\archivist\sync\node_modules\@verdant-web\server\dist\esm\storage\sqlShard\database.js:12:24)
      at openDatabase (C:\Users\ibiyemi\projects\archivist\sync\node_modules\@verdant-web\server\dist\esm\storage\sqlShard\database.js:6:36)
      at <anonymous> (C:\Users\ibiyemi\projects\archivist\sync\node_modules\@verdant-web\server\dist\esm\storage\sqlShard\Databases.js:23:48)
      at <anonymous> (C:\Users\ibiyemi\projects\archivist\sync\node_modules\@verdant-web\server\dist\esm\storage\sqlShard\Databases.js:13:27)
      at <anonymous> (C:\Users\ibiyemi\projects\archivist\sync\node_modules\@verdant-web\server\dist\esm\storage\sqlShard\SqlReplicas.js:14:39)
      at <anonymous> (C:\Users\ibiyemi\projects\archivist\sync\node_modules\@verdant-web\server\dist\esm\storage\sqlShard\SqlReplicas.js:12:27)
      at <anonymous> (C:\Users\ibiyemi\projects\archivist\sync\node_modules\@verdant-web\server\dist\esm\ServerLibrary.js:12:57)
      at <anonymous> (C:\Users\ibiyemi\projects\archivist\sync\node_modules\@verdant-web\server\dist\esm\ServerLibrary.js:11:45)
      at <anonymous> (C:\Users\ibiyemi\projects\archivist\sync\node_modules\@verdant-web\server\dist\esm\ServerLibrary.js:27:40)

Bun v1.2.8 (Windows x64)
============================================================
Bun v1.2.8 (adab0f64) Windows x64
Windows v.win11_dt
CPU: sse42 avx avx2
Args: "C:\Users\ibiyemi\.bun\bin\bun.exe" "run" "index.ts"
Features: Bun.stderr(2) Bun.stdin(2) Bun.stdout(2) dotenv(2) http_server jsc tsconfig(17) process_dlopen 
Builtins: "bun:main" "node:async_hooks" "node:buffer" "node:crypto" "node:events" "node:fs" "node:fs/promises" "node:http" "node:net" "node:os" "node:path" "node:process" "node:querystring" "node:stream" "node:tty" "node:url" "node:util" "node:zlib" "ws" 
Elapsed: 4538ms | User: 328ms | Sys: 250ms
RSS: 0.28GB | Peak: 0.28GB | Commit: 0.39GB | Faults: 70233

panic(main thread): Segmentation fault at address 0x7FFA7D88A4B0
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.2.8/wr1adab0f6kIuwgU_CSntdll.dll+r8ICSntdll.dll64xsBCSntdll.dllorrsBCYKERNEL32.DLL2qsQq7Sk16jGg658F2zu3mBq0k6EA20//Bgryix9D

error: script "start" exited with code 1

Stack Trace (bun.report)

Bun v1.2.8 (adab0f6) on windows x86_64 [RunCommand]

Segmentation fault at address 0x7FFA7DACA4B0

Features: tsconfig, process_dlopen, Bun.stderr, Bun.stdin, Bun.stdout, dotenv, http_server, jsc

Sentry Issue: BUN-EWK

@laptou laptou added the crash An issue that could cause a crash label Apr 11, 2025
Copy link
Contributor

@laptou, the latest version of Bun is v1.2.9, but this crash was reported on Bun v1.2.8.

Are you able to reproduce this crash on the latest version of Bun?

bun upgrade

@github-actions github-actions bot added the windows An issue that is known to occur on Windows label Apr 11, 2025
@RiskyMH RiskyMH marked this as a duplicate of #18958 Apr 13, 2025
@RiskyMH RiskyMH added the node.js Compatibility with Node.js APIs label Apr 13, 2025
@Jarred-Sumner
Copy link
Collaborator

Duplicate of #4290

@Jarred-Sumner Jarred-Sumner marked this as a duplicate of #4290 Apr 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crash An issue that could cause a crash node.js Compatibility with Node.js APIs runtime windows An issue that is known to occur on Windows
Projects
None yet
Development

No branches or pull requests

3 participants