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

node canvas error #11317

Closed
K1ssSh0t opened this issue May 24, 2024 · 2 comments
Closed

node canvas error #11317

K1ssSh0t opened this issue May 24, 2024 · 2 comments
Labels
crash An issue that could cause a crash

Comments

@K1ssSh0t
Copy link

How can we reproduce the crash?

bun add canvas

JavaScript/TypeScript code that reproduces the crash?

const width = 800;
  const height = 600;
  const canvas = createCanvas(width, height);
  const ctx = canvas.getContext("2d");

  // Configurar el lienzo
  ctx.fillStyle = "white";
  ctx.fillRect(0, 0, width, height);
  ctx.strokeStyle = "black";
  ctx.strokeRect(50, 50, width - 100, height - 100);

  // Dibujar los ejes
  ctx.beginPath();
  ctx.moveTo(50, height - 50);
  ctx.lineTo(width - 50, height - 50);
  ctx.moveTo(50, 50);
  ctx.lineTo(50, height - 50);
  ctx.stroke();

  // Dibujar la gráfica
  ctx.strokeStyle = "blue";
  ctx.beginPath();
  ctx.moveTo(60, height - 60);
  for (let i = 0; i < totalErrors.length; i++) {
    const x = 60 + i * ((width - 100) / (totalErrors.length - 1));
    const y =
      height -
      60 -
      (totalErrors[i] / Math.max(...totalErrors)) * (height - 120);
    ctx.lineTo(x, y);
  }
  ctx.stroke();

  // Guardar la gráfica como un archivo PNG
  const buffer = canvas.toBuffer("image/png");
  fs.writeFileSync("errores_totales.png", buffer);

Relevant log output

bun run index.ts 
1 | 'use strict'
2 |
3 | const bindings = require('../build/Release/canvas.node')
          ^
TypeError: LoadLibrary failed: Error en una rutina de inicialización de 
      at D:\Code\bun_Projects\red_neuronal\node_modules\canvas\lib\bindings.js:3:7
      at D:\Code\bun_Projects\red_neuronal\node_modules\canvas\lib\canvas.js:9:7
      at D:\Code\bun_Projects\red_neuronal\node_modules\canvas\index.js:1:7

Bun v1.1.8 (Windows x64)
============================================================
Bun v1.1.8 (89d25807) Windows x64
Args: "C:\Users\angel\.bun\bin\bun.exe", "run", "index.ts"
Features: jsc transpiler_cache tsconfig(2) 
Builtins: "bun:main" "node:fs" "node:string_decoder" "node:util/types" 
Elapsed: 449ms | User: 78ms | Sys: 78ms
RSS: 111.91MB | Peak: 113.61MB | Commit: 0.15GB | Faults: 28255

panic(main thread): Segmentation fault at address 0x7FFE63120E18
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.8/wr189d2580AiggggF_CU\ntdll.dll4yjVCU\ntdll.dll2liVCU\ntdll.dll6zhVCa\KERNEL32.DLL23kHCa\ucrtbase.dll4+vGCa\ucrtbase.dlliswGs7+pFkr4Boj6xGA28//BwhnoijD

Stack Trace (bun.report)

Bun v1.1.8 (89d2580) on windows x86_64 [RunCommand]

Segmentation fault at address 0x7FFE63120E18

  • 1 unknown/js code
  • ??? at 0x5472c in ntdll.dll
  • ??? at 0x5445b in ntdll.dll
  • ??? at 0x5433d in ntdll.dll
  • ??? at 0x1c97b in KERNEL32.DLL
  • ??? at 0x19fec in ucrtbase.dll
  • ??? at 0x1a0c1 in ucrtbase.dll
  • Global.zig:123: exitWide
  • Global.zig:106: exit
  • javascript.zig:941: eventLoop
@K1ssSh0t K1ssSh0t added the crash An issue that could cause a crash label May 24, 2024
@Jarred-Sumner
Copy link
Collaborator

Duplicate of #5835

@Jarred-Sumner Jarred-Sumner marked this as a duplicate of #5835 Aug 8, 2024
@Jarred-Sumner
Copy link
Collaborator

Please follow along in #5835

In the meantime, try upgrading to canvas@next.

@Jarred-Sumner Jarred-Sumner closed this as not planned Won't fix, can't repro, duplicate, stale Aug 8, 2024
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
Projects
None yet
Development

No branches or pull requests

2 participants