openclaw - 💡(How to fix) Fix [Bug]: Gateway segfaults on every message when session history contains a cached PNG image [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#62329Fetched 2026-04-08 03:05:52
View on GitHub
Comments
0
Participants
1
Timeline
1
Reactions
0
Author
Participants
Timeline (top)
labeled ×1

After a PNG image was shared in the main session, the gateway began crashing on every subsequent incoming message. systemd was automatically restarting the process, causing repeated disconnects that looked like login/logout loops rather than a hard crash.

Root Cause

After a PNG image was shared in the main session, the gateway began crashing on every subsequent incoming message. systemd was automatically restarting the process, causing repeated disconnects that looked like login/logout loops rather than a hard crash.

Fix Action

Fix / Workaround

Workaround

RAW_BUFFERClick to expand / collapse

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

After a PNG image was shared in the main session, the gateway began crashing on every subsequent incoming message. systemd was automatically restarting the process, causing repeated disconnects that looked like login/logout loops rather than a hard crash.

Steps to reproduce

To Reproduce

Share a PNG image in the main session (direct chat) Send any follow-up text message Gateway crashes; systemd restarts it Repeat on every message indefinitely

Expected behavior

Expected behavior

Session history containing a cached image should not cause a crash on re-read. The gateway should handle previously-seen images gracefully without re-processing them through the image pipeline.

Actual behavior

What actually happened

The PNG embedded in agent:main:main session history was being re-processed through libvips (via sharp) on every session history reload, triggering a segfault each time.

Workaround

Replacing the image in the session JSONL with a text placeholder stopped the crashes immediately.

Environment

OS: Linux Mint (Ubuntu-based), kernel 6.14 Node: v24.14.1 OpenClaw version: 2026.4.1 Gateway mode: local, loopback Model: anthropic/claude-sonnet-4-6 Additional context

The original session file was backed up before the fix was applied. Happy to provide the JSONL if it helps reproduce the issue.

OpenClaw version

2026.4.1

Operating system

Mint 6.14

Install method

npm global

Model

anthropic/claude-sonnet-4-6

Provider / routing chain

Chrome through Tailscale to desktop

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

Chat in Dashboard was crashing and logging me out, gateway restarts, no answer was given, endless cycle, until I had Claude Code remove the image in the history.

Additional information

No response

extent analysis

TL;DR

The gateway crash can be fixed by preventing the re-processing of cached images through the image pipeline, possibly by implementing a cache or modifying the image handling logic.

Guidance

  • Investigate the image pipeline to identify why the PNG image is being re-processed on every session history reload, causing a segfault.
  • Consider implementing a cache to store previously seen images, so they are not re-processed through libvips (via sharp) on subsequent reloads.
  • Review the session history reload logic to determine if there's a way to handle cached images without re-processing them.
  • Examine the workaround that replaced the image with a text placeholder to understand how it stopped the crashes and apply a similar solution.

Example

No code snippet is provided as the issue does not contain sufficient information to create a specific example.

Notes

The root cause of the issue seems to be related to the image processing pipeline, but the exact cause is unclear. The provided workaround suggests that preventing the re-processing of cached images can resolve the issue.

Recommendation

Apply a workaround to prevent the re-processing of cached images, as the root cause of the issue is not entirely clear and a workaround has been shown to be effective in stopping the crashes.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

Expected behavior

Session history containing a cached image should not cause a crash on re-read. The gateway should handle previously-seen images gracefully without re-processing them through the image pipeline.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING