Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

🤖 bug: sharp image resize crashes Electron's Node runtime on headless Linux (SIGSEGV)

クローズ
#7,387 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
44/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
electron, linux, typescript

調査の方向性

Start by reading src/node/utils/attachments/resizeRasterImageAttachment.ts and the Linux Electron sharp note in src/node/workers/mcpIconDecode.ts. Reproduce with the two oversized fixtures under ELECTRON_RUN_AS_NODE=1, then verify on a real Linux desktop in a packaged build using attach_file. Done means oversized image resizing works without a crash; the payload suggests a plain Node worker or sharp's WebAssembly build as possible fixes.

索引モデルが issue の本文から書いたものです。

説明

Problem

On a headless Linux host, sharp crashes Electron when it resizes an image inside Electron's Node runtime. The process exits with SIGSEGV. The same script works under plain Node.

CAUTION: I saw this only under ELECTRON_RUN_AS_NODE=1 on a headless Linux host with no display. It happens with sharp 0.34.5 (main) and with sharp 0.35.5. I did not verify it on a real Linux desktop or in a packaged Linux build, so I do not know if desktop users hit it.

Steps (Electron 44.5.1, Linux x64, no DISPLAY)

  1. Build the main process: make build-main.
  2. Make two large fixtures (a 9001x10 PNG and a 10x9001 JPEG with EXIF orientation 6) with sharp under plain node.
  3. Run a script that calls resizeRasterImageAttachmentBufferIfNeeded from dist/node/utils/attachments/resizeRasterImageAttachment.js on both files:
    • node run.cjs prints oversized.png true 9001x10 -> 2000x2 image/png ... and the JPEG line, then exits 0.
    • ELECTRON_RUN_AS_NODE=1 node_modules/.bin/electron run.cjs prints .../node_modules/electron/dist/electron exited with signal SIGSEGV.
  4. ELECTRON_RUN_AS_NODE=1 node_modules/.bin/electron -e 'require("sharp")' alone does not crash. The crash comes when the image is processed.

The full desktop smoke path (MUX_ATTACH_FILE_SMOKE_TEST_PNG_PATH / MUX_ATTACH_FILE_SMOKE_TEST_JPEG_PATH with electron --no-sandbox --ozone-platform=headless dist/desktop/main.js) also exits with SIGSEGV after "App ready, creating window...". On this host that is not conclusive, because no X display exists.

New warning in sharp 0.35

With sharp 0.35.5, loading sharp in Electron on Linux prints:

[SharpElectronLinux] Warning: Binaries provided by Electron for use on Linux may be incompatible with sharp - see https://sharp.pixelplumbing.com/install#electron-and-linux

src/node/workers/mcpIconDecode.ts already notes a GLib symbol conflict between Linux Electron and native sharp for SVG. This crash is a guess at the same class of problem. I did not verify the cause.

What to check

  1. Run attach_file with an image larger than the resize limit in a packaged Linux build (AppImage or deb) on a real desktop.
  2. If it crashes, choose one fix: run the resize in a plain Node worker the way mcpIconDecode runs, or use sharp's WebAssembly build on Linux Electron.

Refs #7384 (sharp 0.35.5 bump).


Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high

主要言語
TypeScript
スター
2.1k
フォーク
139
平均マージ
3時間 40分
マージ済み PR(30日)
948

環境構築

  • Dockerfile または Docker Compose ファイルあり
  • プルリクエストのテンプレートなし
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

coder/xum のほかの issue

coder/xum の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。