🤖 bug: sharp image resize crashes Electron's Node runtime on headless Linux (SIGSEGV)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 44/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- electron, linux, typescript
- 領域
- backend, desktop, performance
調査の方向性
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)
- Build the main process:
make build-main. - Make two large fixtures (a 9001x10 PNG and a 10x9001 JPEG with EXIF orientation 6) with sharp under plain
node. - Run a script that calls
resizeRasterImageAttachmentBufferIfNeededfromdist/node/utils/attachments/resizeRasterImageAttachment.json both files:node run.cjsprintsoversized.png true 9001x10 -> 2000x2 image/png ...and the JPEG line, then exits 0.ELECTRON_RUN_AS_NODE=1 node_modules/.bin/electron run.cjsprints.../node_modules/electron/dist/electron exited with signal SIGSEGV.
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
- Run
attach_filewith an image larger than the resize limit in a packaged Linux build (AppImage or deb) on a real desktop. - If it crashes, choose one fix: run the resize in a plain Node worker the way
mcpIconDecoderuns, 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 ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
coder/xum のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
marmelab/react-admin#11431 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
db-ux-design-system/core-web#8655 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
stripe/react-stripe-js#728 ·
-
[Upload Grade C dataset] the pop-up changes it's size while uploading the document => Jumping effectオープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
epam/statgpt-admin-frontend#305 ·
メンテナーはふだん 1 日以内に返信