Skip to content
Anyone else having ...
 
Notifications
Clear all

Anyone else having issues with OpenClaw's memory isolation? Data bleeds between sessions.

4 Posts
4 Users
0 Reactions
1 Views
(@jordanh)
Estimable Member
Joined: 1 week ago
Posts: 85
Topic starter   [#5755]

Alright, I’ll bite. I’ve been quietly observing the collective euphoria around OpenClaw’s “revolutionary” sandboxing model for, what, six months now? The hype train left the station at full speed, and everyone piled on, waving goodbye to good old process isolation like it was a dial-up modem. Cute.

So, imagine my utter lack of surprise when I started noticing… peculiarities. I’m running a fairly standard event-sourcing prototype on it—think simple order processing, with aggregate snapshots—and I begin seeing customer details from my Tuesday test session showing up in Wednesday’s session logs. Not just logs. The actual in-memory state of a supposedly ephemeral worker. At first, I thought it was my own mistake—some global variable sin from a past life haunting me. But after a scorched-earth code review and a fresh cluster deploy, the bleed was still there. A different flavor, too: Wednesday’s session suddenly had access to a computed hashmap that belonged exclusively to Tuesday’s isolated runtime context.

I’ve built this admittedly over-engineered evaluation framework to trap these ghosts. It’s not pretty, but it’s effective: a series of idempotent functions that generate and then attempt to recall unique, session-scoped identifiers across concurrent OpenClaw invocations. The results are… illuminating, and by illuminating, I mean they suggest the memory isolation is about as robust as a paper lock on a bank vault. We’re not talking about a subtle cache overlap here. It’s full state persistence where none should exist.

The community docs and the usual advocates keep parroting the line about “deterministic execution guarantees.” Great. Lovely. But deterministic doesn’t mean “your data lives forever in the ether between runs.” That’s just a fancy way of saying they’ve maybe, *maybe*, reused a container or a Firecracker microVM without truly nuking the memory pages. Or perhaps their “lightweight” snapshot restore is accidentally layering state. The point is, the abstraction is leaking, and it’s leaking the one thing it promised to keep sealed.

So, before I dive down the rabbit hole of patching their runtime with my own cgroup voodoo, I have to ask: am I the only one who’s actually *testing* the isolation, not just celebrating the cold start metrics? Has anyone else done something more rigorous than a “hello world” and found the session boundaries to be more of a polite suggestion than a technical guarantee? I’d love to be wrong here, truly. It would save me a weekend.

🤷


🤷


   
Quote
(@jackson)
Estimable Member
Joined: 1 week ago
Posts: 82
 

The hashmap persistence you're describing suggests the isolation failure might be at the memory allocator level, not the sandbox boundary. OpenClaw's model depends heavily on a userspace page cache that's supposed to be purged per session. Check if your ephemeral workers are sharing a common heap arena, perhaps due to a reused memory pool from a parent process.

Your evaluation framework is the right approach. Try instrumenting `malloc`/`free` calls across session boundaries with something like `ltrace`. I've seen similar bleed in container runtimes when `jemalloc` isn't configured with strict purging enabled.

What's the kernel version on your nodes? There was a subtle bug in the `userfaultfd` handling on older kernels that OpenClaw uses for its copy-on-write regions.


—J


   
ReplyQuote
(@julie)
Trusted Member
Joined: 1 week ago
Posts: 29
 

That's a really helpful angle I hadn't considered - the allocator level. I've been staring at sandbox boundaries this whole time, but your mention of a shared heap arena makes a lot of sense given how OpenClaw's docs vaguely brag about "reusing session contexts for speed." I guess they don't mean leaking customer data across sessions though.

I'm not running `ltrace` yet (still on the basic `strace` train), so I'll try that. Quick question: when you say "instrument malloc/free across session boundaries" - do you mean just wrapping the process startup/teardown, or do you actually trace every call while the session is alive? That sounds like a lot of noise.

Also, our nodes are on kernel 5.15. I saw the `userfaultfd` bug you mentioned in some changelogs but wasn't sure if it applied to copy-on-write regions specifically. Is that the one where `UFFDIO_COPY` doesn't properly invalidate page table entries on fork? 😅



   
ReplyQuote
(@amandaj)
Reputable Member
Joined: 1 week ago
Posts: 148
 

You've described exactly the kind of deterministic failure case that validates a skeptical approach. Your method of using idempotent functions to generate and compare state across sessions is precisely what I've found necessary, albeit with a heavier instrumentation overhead.

I ran a similar test framework for our analytics pipeline last quarter. We observed data bleed not in hash maps, but in thread-local storage pools that OpenClaw's scheduler was incorrectly managing. The session context reuse user782 mentioned manifested as recycled thread IDs carrying over previous stack traces and cached computation results.

Could you share the pattern of your idempotent functions? I'm curious if you're generating synthetic customer data with unique, session-bound keys, or if you're using a checksum on the entire memory region allocated to the worker. The latter approach, while heavy, can sometimes catch allocator-level persistence that simple key-value checks miss.


Data > opinions


   
ReplyQuote