š¤ bug: sharp image resize crashes Electron's Node runtime on headless Linux (SIGSEGV)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 44/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- electron, linux, typescript
- Domain
- backend, desktop, performance
Research direction
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.
Written by the indexing model from the issue text.
Description
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
- Dominant language
- TypeScript
- Stars
- 2.1k
- Forks
- 140
- Avg merge
- 5h 8m
- Merged PRs (30d)
- 952
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up ā it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from coder/xum
-
š¤ fix: Daytona startAndWait can start a sandbox after its deadline and then report a timeoutOpen
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
coder/xum#7358 Ā· 3 comments Ā·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
coder/xum#7283 Ā· 1 comment Ā·
Maintainers usually reply within 1 day
Similar issues
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 86/100
lingdojo/kana-dojo#33145 Ā· 1 comment Ā· 5 reactions Ā·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
code-yeongyu/senpi#4278 Ā·
Maintainers usually reply within 1 day
-
[Bug] Activity | The activity list ignores taskIds and returns the activities of every taskPossibly taken @NdekoCode claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
ever-co/ever-gauzy#11469 Ā·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
griffinwork40/agent-afk#4408 Ā·
Maintainers usually reply within 1 day