oven-sh / bun

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

crash canvas in bun #10587

Open rober-tm opened 2 months ago

rober-tm commented 2 months ago

How can we reproduce the crash?

La aplicacion escanea archivos pdf, los conierte a png y pasa un ocr para extraer informacion.

este es el pj

{ "name": "bot_pdf_ocr", "version": "1.0.0", "description": "", "main": "index.js", "type": "module", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "keywords": [], "author": "", "license": "ISC", "dependencies": { "canvas": "^2.11.2", "fs-extra": "^11.2.0", "jsqr": "^1.4.0", "node-poppler": "^7.2.0", "os": "^0.1.2", "pdf-lib": "^1.17.1", "pdf-poppler": "^0.2.1", "playwright": "^1.43.1", "pngjs": "^7.0.0", "samba-client": "^7.2.0", "smb2": "^0.2.11", "sqlite3": "^5.1.7", "tesseract.js": "^5.0.5" } }

Relevant log output

PS C:\Users\rober\OneDrive\Cursos\bot_pdf_ocr> bun run .\bot_ocr.js
1 | 'use strict'
2 | 
3 | const bindings = require('../build/Release/canvas.node')
          ^
TypeError: LoadLibrary failed: Error en una rutina de inicialización de 
      at C:\Users\rober\OneDrive\Cursos\bot_pdf_ocr\node_modules\canvas\lib\bindings.js:3:7
      at C:\Users\rober\OneDrive\Cursos\bot_pdf_ocr\node_modules\canvas\lib\canvas.js:9:7
      at C:\Users\rober\OneDrive\Cursos\bot_pdf_ocr\node_modules\canvas\index.js:1:7
      at C:\Users\rober\OneDrive\Cursos\bot_pdf_ocr\bot_ocr.js:7:26
============================================================
Bun v1.1.5 (b257a309) Windows x64
Args: "C:\Users\rober\.bun\bin\bun.exe", "run", ".\bot_ocr.js"
Builtins: "bun:main" "node:child_process" "node:events" "node:fs" "node:module" "node:path" "node:string_decoder" "node:util" "node:util/types" "node:worker_threads" "node-fetch" 
Elapsed: 236ms | User: 15ms | Sys: 15ms
RSS: 0.14GB | Peak: 0.14GB | Commit: 0.17GB | Faults: 34800

panic(main thread): Segmentation fault at address 0x7FF9959D0E38
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.5/wr1b257a30AA_CU\ntdll.dll4ppUCU\ntdll.dllu/nUCU\ntdll.dll6pmUCa\KERNEL32.DLL26/FCa\ucrtbase.dllwt/GCa\ucrtbase.dllypgH+8roFkw/Bwj8wGA2y//Bx84rsqD

PS C:\Users\rober\OneDrive\Cursos\bot_pdf_ocr>

Stack Trace (bun.report)

Bun v1.1.5 (#10527) on windows x86_64 [RunCommand]

Segmentation fault at address 0x7FFDF4FF6328

loudar commented 2 weeks ago

Also getting this error:

1 | 'use strict'
2 |
3 | const bindings = require('../build/Release/canvas.node')
          ^
TypeError: LoadLibrary failed: A dynamic link library (DLL) in
      at C:\myproject\node_modules\canvas\lib\bindings.js:3:7
      at C:\myproject\node_modules\canvas\lib\canvas.js:9:7
      at C:\myproject\node_modules\canvas\index.js:1:7
      at freshRequire (C:\myproject\node_modules\chartjs-node-canvas\dist\freshRequire.js:9:22)
      at new ChartJSNodeCanvas (C:\myproject\node_modules\chartjs-node-canvas\dist\index.js:24:28)
      at renderAndSaveGraph (C:\myproject\src\generators\DataAnalysis.ts:34:37)
Segmentation fault at address 0x7ffd92070e38
???:?:?: 0x7ffdaba2129b in ??? (ntdll.dll)
???:?:?: 0x7ffdaba20ff6 in ??? (ntdll.dll)
???:?:?: 0x7ffdaba20c9c in ??? (ntdll.dll)
???:?:?: 0x7ffdab657faa in ??? (KERNEL32.DLL)
???:?:?: 0x7ffda90bbed7 in ??? (ucrtbase.dll)
???:?:?: 0x7ffda90bc098 in ??? (ucrtbase.dll)
???:?:?: 0x7ff7dce0fd78 in ??? (bun.exe)
???:?:?: 0x7ff7dcb9263b in ??? (bun.exe)
???:?:?: 0x7ff7dced66ca in ??? (bun.exe)
???:?:?: 0x7ff7df32157a in ??? (bun.exe)
???:?:?: 0x7ff7dce0fc6e in ??? (bun.exe)
???:?:?: 0x7ff7dce3a420 in ??? (bun.exe)
???:?:?: 0x7ff7dce276d6 in ??? (bun.exe)
???:?:?: 0x7ff7dcb615fe in ??? (bun.exe)
???:?:?: 0x7ff7df6ecce3 in ??? (bun.exe)
???:?:?: 0x7ffdab65257c in ??? (KERNEL32.DLL)
???:?:?: 0x7ffdaba2aa47 in ??? (ntdll.dll)
{
  "name": "myproject",
  "version": "1.0.0",
  "description": "",
  "main": "dist/src/functions/*.js",
  "type": "module",
  "scripts": {
    "build": "tsc",
    "watch": "tsc -w",
    "clean": "rimraf dist",
    "prestart": "npm run clean && npm run build",
    "start": "func start",
  },
  "dependencies": {
    "@azure/cosmos": "^4.0.0",
    "@azure/functions": "^4.0.0",
    "@azure/storage-blob": "^12.17.0",
    "bun": "^1.1.12",
    "canvas": "^2.11.2",
    "chartjs-node-canvas": "^4.1.6",
    "dotenv": "^16.4.5",
    "random-words": "^2.0.1"
  },
  "devDependencies": {
    "@types/node": "18.x",
    "azure-functions-core-tools": "^4.x",
    "rimraf": "^5.0.0",
    "typescript": "^4.0.0"
  }
}