Skip to content

feat(nbd): zero/discard detection to shrink snapshot diffs#2546

Merged
ValentaTomas merged 3 commits intomainfrom
feat/nbd-zero-discard-detection
May 5, 2026
Merged

feat(nbd): zero/discard detection to shrink snapshot diffs#2546
ValentaTomas merged 3 commits intomainfrom
feat/nbd-zero-discard-detection

Conversation

@ValentaTomas
Copy link
Copy Markdown
Member

@ValentaTomas ValentaTomas commented May 3, 2026

Drops snapshot-diff payload for blocks the guest zeroes or trims.

NBD_CMD_TRIM, NBD_CMD_WRITE_ZEROES, and all-zero plain WRITE now collapse to Empty in the diff (mapped to uuid.Nil, already understood by the read path) and the cache file is hole-punched via MADV_REMOVE so freed pages return. Both NBD flags are advertised; rootfs is mounted with discard.

Diff format unchanged (the Empty bitmap was always there, just never populated), so old snapshots and old readers stay compatible.

@cursor
Copy link
Copy Markdown

cursor Bot commented May 3, 2026

PR Summary

Medium Risk
Touches NBD write semantics and snapshot diff generation; mis-handling alignment or zero-detection could cause silent data loss or incorrect diff mappings.

Overview
Cache.WriteAtWithoutLock now assumes block-sized writes (b[:blockSize]) and block alignment; any shorter or misaligned write path could panic or incorrectly classify/emit blocks as Empty.

NBD_CMD_TRIM and NBD_CMD_WRITE_ZEROES are routed to WriteZeroesAt and the cache is hole-punched; if a guest or kernel issues these commands with unexpected alignment/flags, data could be discarded from the diff unexpectedly. The DiffMetadata constructor signature changed; any missed call sites would lead to incorrect empty/dirty tracking.

Reviewed by Cursor Bugbot for commit e55fd51. Bugbot is set up for automated code reviews on this repo. Configure here.

Comment thread packages/orchestrator/pkg/sandbox/nbd/dispatch.go
ValentaTomas added a commit that referenced this pull request May 3, 2026
The test round-tripped binary.BigEndian.Put/GetUint16 on bytes the test
itself wrote, asserting nothing the struct definition + 4-line parser
don't already make obvious by inspection. Real flag/opcode dispatch
behavior is exercised in #2546's NBD harness tests.
@ValentaTomas ValentaTomas marked this pull request as ready for review May 3, 2026 23:18
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b6c317b212

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/orchestrator/pkg/sandbox/block/cache.go Outdated
Comment thread packages/orchestrator/pkg/sandbox/block/cache.go Outdated
ValentaTomas added a commit that referenced this pull request May 4, 2026
…#2547)

`IsEmptyBlock` was the per-block hot path of
`DiffMetadataBuilder.Process` — one call per block during the rootfs
scan in `DirectProvider.exportToDiff`. It paid a full SIMD `memcmp` (4
KiB or, on hugepages, 2 MiB) before it could short-circuit, and required
two static zero buffers (`EmptyBlock`, `EmptyHugePage`) to compare
against.

Replace it with a small `IsZero` helper that uses QEMU's
`buffer_is_zero` trick: sample three bytes (first, last, middle) so most
non-zero blocks reject from a single cache line. The fallback uses
`bytes.Equal` on `b` shifted by one (`b[1:] == b[:n-1]`), which
dispatches to the runtime's SIMD `memequal` on amd64/arm64 — same speed
as the old comparison against a static buffer when the short-circuit
doesn't fire.

`DiffMetadataBuilder.Process` calls `IsZero` directly (the size
validation `IsEmptyBlock` did was unreachable in practice). `EmptyBlock`
is removed; `EmptyHugePage` stays — `build.go` uses it as the literal
zero buffer for `uuid.Nil` reads in `Build.ReadAt`.

Pre-factored from #2546 so it can land on its own.
@ValentaTomas ValentaTomas force-pushed the feat/block-state-tracker branch 4 times, most recently from 37be905 to dcb7de4 Compare May 4, 2026 18:50
@ValentaTomas ValentaTomas force-pushed the feat/nbd-zero-discard-detection branch from be64f24 to 64f075d Compare May 4, 2026 19:56
@codecov
Copy link
Copy Markdown

codecov Bot commented May 4, 2026

❌ 10 Tests Failed:

Tests completed Failed Passed Skipped
2578 10 2568 5
View the full list of 17 ❄️ flaky test(s)
github.com/e2b-dev/infra/tests/integration/internal/tests/api/metrics::TestTeamMetrics

Flake rate in main: 60.00% (Passed 12 times, Failed 18 times)

Stack Traces | 1.49s run time
=== RUN   TestTeamMetrics
=== PAUSE TestTeamMetrics
=== CONT  TestTeamMetrics
    team_metrics_test.go:61: 
        	Error Trace:	.../api/metrics/team_metrics_test.go:61
        	Error:      	Should be true
        	Test:       	TestTeamMetrics
        	Messages:   	MaxConcurrentSandboxes should be >= 0
--- FAIL: TestTeamMetrics (1.49s)
github.com/e2b-dev/infra/tests/integration/internal/tests/api/sandboxes::TestUpdateNetworkConfig

Flake rate in main: 62.16% (Passed 14 times, Failed 23 times)

Stack Traces | 204s run time
=== RUN   TestUpdateNetworkConfig
=== PAUSE TestUpdateNetworkConfig
=== CONT  TestUpdateNetworkConfig
    sandbox_network_out_test.go:30: Building custom template for network egress tests...
    template.go:44: network-egress-test: [info] Building template thp0fpf8g8hrme4gbjaz/0e642e9f-cd77-49ac-b47e-e5c26076724f
    template.go:44: network-egress-test: [info] [base] FROM ubuntu:22.04 [ffd709f131f42dfab282de47a91dd2c139e900c1c11fc574b49b517a05ef0a32]
    template.go:44: network-egress-test: [info] Base Docker image size: 30 MB
    template.go:44: network-egress-test: [info] Creating file system and pulling Docker image
    template.go:44: network-egress-test: [info] Uncompressing layer sha256:f63eb04151bcac21ad049f8d781b97b219aba392c5457907f8f3e88e43eb48ec 30 MB
    template.go:44: network-egress-test: [info] Uncompressing layer sha256:9535d3b9534bc0d796e4a29e7658b7007ff94c93f8124e8870d37e105f751b17 12 MB
    template.go:44: network-egress-test: [info] Uncompressing layer sha256:8c4b1b28875140ed3abacaf16ad0d696f6bef912f52d2148f261a23e3349465b 168 B
    template.go:44: network-egress-test: [info] Layers extracted
    template.go:44: network-egress-test: [info] Root filesystem structure: bin, boot, dev, etc, home, lib, lib32, lib64, libx32, media, mnt, opt, proc, root, run, sbin, srv, sys, tmp, usr, var
    template.go:44: network-egress-test: [info] Provisioning sandbox template
    template.go:44: network-egress-test: [info] Provisioning was successful, cleaning up
    template.go:44: network-egress-test: [info] Sandbox template provisioned
    template.go:44: network-egress-test: [info] [base] DEFAULT USER user [90bdd4afa342293c931373351bf578872dec9179214ba3e8bf9edba311466213]
    template.go:44: network-egress-test: [info] [builder 1/1] RUN sudo apt-get update && sudo apt-get install -y curl iputils-ping dnsutils openssh-client gnupg && sudo rm -rf .../lib/apt/lists/* [2463a9871c5acb096dc00a6b03e4965da11a9e03c5f0618cbf556435df9fae17]
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Hit:1 http://security.ubuntu.com/ubuntu jammy-security InRelease
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Hit:2 http://archive.ubuntu.com/ubuntu jammy InRelease
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Hit:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Hit:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Reading package lists...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Reading package lists...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Building dependency tree...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Reading state information...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: curl is already the newest version (7.81.0-1ubuntu1.24).
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: openssh-client is already the newest version (1:8.9p1-3ubuntu0.15).
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: openssh-client set to manually installed.
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: The following additional packages will be installed:
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: bind9-dnsutils bind9-host bind9-libs dirmngr gnupg-l10n gnupg-utils gpg
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: gpg-agent gpg-wks-client gpg-wks-server gpgconf gpgsm libassuan0 libicu70
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: libksba8 liblmdb0 libmaxminddb0 libnpth0 libuv1 libxml2 pinentry-curses
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Suggested packages:
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: dbus-user-session libpam-systemd pinentry-gnome3 tor parcimonie xloadimage
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: scdaemon mmdb-bin pinentry-doc
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: The following NEW packages will be installed:
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: bind9-dnsutils bind9-host bind9-libs dirmngr dnsutils gnupg gnupg-l10n
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: gnupg-utils gpg gpg-agent gpg-wks-client gpg-wks-server gpgconf gpgsm
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: iputils-ping libassuan0 libicu70 libksba8 liblmdb0 libmaxminddb0 libnpth0
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: libuv1 libxml2 pinentry-curses
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: 0 upgraded, 24 newly installed, 0 to remove and 2 not upgraded.
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Need to get 15.3 MB of archives.
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: After this operation, 48.2 MB of additional disk space will be used.
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Get:1 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 iputils-ping amd64 3:20211215-1ubuntu0.1 [43.0 kB]
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Get:2 http://archive.ubuntu.com/ubuntu jammy/main amd64 libicu70 amd64 70.1-2 [10.6 MB]
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Get:3 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libxml2 amd64 2.9.13+dfsg-1ubuntu0.11 [765 kB]
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Get:4 http://archive.ubuntu.com/ubuntu jammy/main amd64 liblmdb0 amd64 0.9.24-1build2 [47.6 kB]
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Get:5 http://archive.ubuntu.com/ubuntu jammy/main amd64 libmaxminddb0 amd64 1.5.2-1build2 [24.7 kB]
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Get:6 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libuv1 amd64 1.43.0-1ubuntu0.1 [92.7 kB]
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Get:7 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 bind9-libs amd64 1:9.18.39-0ubuntu0.22.04.3 [1262 kB]
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Get:8 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 bind9-host amd64 1:9.18.39-0ubuntu0.22.04.3 [52.5 kB]
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Get:9 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 bind9-dnsutils amd64 1:9.18.39-0ubuntu0.22.04.3 [158 kB]
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Get:10 http://archive.ubuntu.com/ubuntu jammy/main amd64 libassuan0 amd64 2.5.5-1build1 [38.2 kB]
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Get:11 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 gpgconf amd64 2.2.27-3ubuntu2.5 [94.3 kB]
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Get:12 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libksba8 amd64 1.6.0-2ubuntu0.2 [119 kB]
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Get:13 http://archive.ubuntu.com/ubuntu jammy/main amd64 libnpth0 amd64 1.6-3build2 [8664 B]
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Get:14 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 dirmngr amd64 2.2.27-3ubuntu2.5 [293 kB]
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Get:15 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 dnsutils all 1:9.18.39-0ubuntu0.22.04.3 [3924 B]
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Get:16 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 gnupg-l10n all 2.2.27-3ubuntu2.5 [54.5 kB]
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Get:17 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 gnupg-utils amd64 2.2.27-3ubuntu2.5 [309 kB]
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Get:18 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 gpg amd64 2.2.27-3ubuntu2.5 [519 kB]
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Get:19 http://archive.ubuntu.com/ubuntu jammy/main amd64 pinentry-curses amd64 1.1.1-1build2 [34.4 kB]
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Get:20 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 gpg-agent amd64 2.2.27-3ubuntu2.5 [209 kB]
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Get:21 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 gpg-wks-client amd64 2.2.27-3ubuntu2.5 [62.7 kB]
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Get:22 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 gpg-wks-server amd64 2.2.27-3ubuntu2.5 [57.6 kB]
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Get:23 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 gpgsm amd64 2.2.27-3ubuntu2.5 [197 kB]
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Get:24 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 gnupg all 2.2.27-3ubuntu2.5 [315 kB]
    template.go:44: network-egress-test: [info] [builder 1/1] [stderr]: debconf: delaying package configuration, since apt-utils is not installed
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Fetched 15.3 MB in 0s (31.6 MB/s)
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Selecting previously unselected package iputils-ping.
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: (Reading database ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: (Reading database ... 5%(Reading database ... 10%(Reading database ... 15%(Reading database ... 20%(Reading database ... 25%(Reading database ... 30%(Reading database ... 35%(Reading database ... 40%(Reading database ... 45%(Reading database ... 50%(Reading database ... 55%(Reading database ... 60%(Reading database ... 65%(Reading database ... 70%
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: (Reading database ... 75%
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: (Reading database ... 80%
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: (Reading database ... 85%
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: (Reading database ... 90%
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: (Reading database ... 95%
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: (Reading database ... 100%(Reading database ... 12395 files and directories currently installed.)
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Preparing to unpack .../00-iputils-ping_3%3a20211215-1ubuntu0.1_amd64.deb ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Unpacking iputils-ping (3:20211215-1ubuntu0.1) ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Selecting previously unselected package libicu70:amd64.
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Preparing to unpack .../01-libicu70_70.1-2_amd64.deb ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Unpacking libicu70:amd64 (70.1-2) ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Selecting previously unselected package libxml2:amd64.
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Preparing to unpack .../02-libxml2_2.9.13+dfsg-1ubuntu0.11_amd64.deb ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Unpacking libxml2:amd64 (2.9.13+dfsg-1ubuntu0.11) ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Selecting previously unselected package liblmdb0:amd64.
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Preparing to unpack .../03-liblmdb0_0.9.24-1build2_amd64.deb ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Unpacking liblmdb0:amd64 (0.9.24-1build2) ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Selecting previously unselected package libmaxminddb0:amd64.
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Preparing to unpack .../04-libmaxminddb0_1.5.2-1build2_amd64.deb ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Unpacking libmaxminddb0:amd64 (1.5.2-1build2) ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Selecting previously unselected package libuv1:amd64.
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Preparing to unpack .../05-libuv1_1.43.0-1ubuntu0.1_amd64.deb ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Unpacking libuv1:amd64 (1.43.0-1ubuntu0.1) ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Selecting previously unselected package bind9-libs:amd64.
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Preparing to unpack .../06-bind9-libs_1%3a9.18.39-0ubuntu0.22.04.3_amd64.deb ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Unpacking bind9-libs:amd64 (1:9.18.39-0ubuntu0.22.04.3) ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Selecting previously unselected package bind9-host.
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Preparing to unpack .../07-bind9-host_1%3a9.18.39-0ubuntu0.22.04.3_amd64.deb ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Unpacking bind9-host (1:9.18.39-0ubuntu0.22.04.3) ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Selecting previously unselected package bind9-dnsutils.
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Preparing to unpack .../08-bind9-dnsutils_1%3a9.18.39-0ubuntu0.22.04.3_amd64.deb ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Unpacking bind9-dnsutils (1:9.18.39-0ubuntu0.22.04.3) ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Selecting previously unselected package libassuan0:amd64.
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Preparing to unpack .../09-libassuan0_2.5.5-1build1_amd64.deb ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Unpacking libassuan0:amd64 (2.5.5-1build1) ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Selecting previously unselected package gpgconf.
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Preparing to unpack .../10-gpgconf_2.2.27-3ubuntu2.5_amd64.deb ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Unpacking gpgconf (2.2.27-3ubuntu2.5) ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Selecting previously unselected package libksba8:amd64.
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Preparing to unpack .../11-libksba8_1.6.0-2ubuntu0.2_amd64.deb ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Unpacking libksba8:amd64 (1.6.0-2ubuntu0.2) ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Selecting previously unselected package libnpth0:amd64.
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Preparing to unpack .../12-libnpth0_1.6-3build2_amd64.deb ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Unpacking libnpth0:amd64 (1.6-3build2) ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Selecting previously unselected package dirmngr.
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Preparing to unpack .../13-dirmngr_2.2.27-3ubuntu2.5_amd64.deb ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Unpacking dirmngr (2.2.27-3ubuntu2.5) ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Selecting previously unselected package dnsutils.
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Preparing to unpack .../14-dnsutils_1%3a9.18.39-0ubuntu0.22.04.3_all.deb ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Unpacking dnsutils (1:9.18.39-0ubuntu0.22.04.3) ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Selecting previously unselected package gnupg-l10n.
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Preparing to unpack .../15-gnupg-l10n_2.2.27-3ubuntu2.5_all.deb ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Unpacking gnupg-l10n (2.2.27-3ubuntu2.5) ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Selecting previously unselected package gnupg-utils.
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Preparing to unpack .../16-gnupg-utils_2.2.27-3ubuntu2.5_amd64.deb ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Unpacking gnupg-utils (2.2.27-3ubuntu2.5) ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Selecting previously unselected package gpg.
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Preparing to unpack .../17-gpg_2.2.27-3ubuntu2.5_amd64.deb ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Unpacking gpg (2.2.27-3ubuntu2.5) ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Selecting previously unselected package pinentry-curses.
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Preparing to unpack .../18-pinentry-curses_1.1.1-1build2_amd64.deb ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Unpacking pinentry-curses (1.1.1-1build2) ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Selecting previously unselected package gpg-agent.
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Preparing to unpack .../19-gpg-agent_2.2.27-3ubuntu2.5_amd64.deb ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Unpacking gpg-agent (2.2.27-3ubuntu2.5) ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Selecting previously unselected package gpg-wks-client.
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Preparing to unpack .../20-gpg-wks-client_2.2.27-3ubuntu2.5_amd64.deb ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Unpacking gpg-wks-client (2.2.27-3ubuntu2.5) ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Selecting previously unselected package gpg-wks-server.
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Preparing to unpack .../21-gpg-wks-server_2.2.27-3ubuntu2.5_amd64.deb ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Unpacking gpg-wks-server (2.2.27-3ubuntu2.5) ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Selecting previously unselected package gpgsm.
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Preparing to unpack .../22-gpgsm_2.2.27-3ubuntu2.5_amd64.deb ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Unpacking gpgsm (2.2.27-3ubuntu2.5) ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Selecting previously unselected package gnupg.
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Preparing to unpack .../23-gnupg_2.2.27-3ubuntu2.5_all.deb ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Unpacking gnupg (2.2.27-3ubuntu2.5) ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Setting up libksba8:amd64 (1.6.0-2ubuntu0.2) ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Setting up liblmdb0:amd64 (0.9.24-1build2) ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Setting up libmaxminddb0:amd64 (1.5.2-1build2) ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Setting up libnpth0:amd64 (1.6-3build2) ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Setting up libassuan0:amd64 (2.5.5-1build1) ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Setting up libuv1:amd64 (1.43.0-1ubuntu0.1) ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Setting up gnupg-l10n (2.2.27-3ubuntu2.5) ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Setting up gpgconf (2.2.27-3ubuntu2.5) ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Setting up iputils-ping (3:20211215-1ubuntu0.1) ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Setting up gpg (2.2.27-3ubuntu2.5) ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Setting up libicu70:amd64 (70.1-2) ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Setting up gnupg-utils (2.2.27-3ubuntu2.5) ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Setting up pinentry-curses (1.1.1-1build2) ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Setting up gpg-agent (2.2.27-3ubuntu2.5) ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Created symlink .../systemd/user/sockets.target.wants/gpg-agent-browser.socket → .../systemd/user/gpg-agent-browser.socket.
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Created symlink .../systemd/user/sockets.target.wants/gpg-agent-extra.socket → .../systemd/user/gpg-agent-extra.socket.
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Created symlink .../systemd/user/sockets.target.wants/gpg-agent-ssh.socket → .../systemd/user/gpg-agent-ssh.socket.
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Created symlink .../systemd/user/sockets.target.wants/gpg-agent.socket → .../systemd/user/gpg-agent.socket.
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Setting up gpgsm (2.2.27-3ubuntu2.5) ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Setting up dirmngr (2.2.27-3ubuntu2.5) ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Created symlink .../systemd/user/sockets.target.wants/dirmngr.socket → .../systemd/user/dirmngr.socket.
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Setting up gpg-wks-server (2.2.27-3ubuntu2.5) ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Setting up libxml2:amd64 (2.9.13+dfsg-1ubuntu0.11) ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Setting up gpg-wks-client (2.2.27-3ubuntu2.5) ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Setting up bind9-libs:amd64 (1:9.18.39-0ubuntu0.22.04.3) ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Setting up gnupg (2.2.27-3ubuntu2.5) ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Setting up bind9-host (1:9.18.39-0ubuntu0.22.04.3) ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Setting up bind9-dnsutils (1:9.18.39-0ubuntu0.22.04.3) ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Setting up dnsutils (1:9.18.39-0ubuntu0.22.04.3) ...
    template.go:44: network-egress-test: [info] [builder 1/1] [stdout]: Processing triggers for libc-bin (2.35-0ubuntu3.13) ...
    template.go:44: network-egress-test: [info] [finalize] Finalizing template build [678d8c6396745e76c1e6fcb6ec74a06eb1cc3bffc1101dbaec5c89848fb75045]
    template.go:44: network-egress-test: [info] [optimize] Optimizing template [027a14840d213f9902f523344074c7f19992129998b9867f8c379d0012f44fe9]
    template.go:44: network-egress-test: [info] Build finished, took 2m33s
    sandbox_network_out_test.go:32: Build completed successfully
    sandbox_network_out_test.go:49: Network test template built: thp0fpf8g8hrme4gbjaz
--- FAIL: TestUpdateNetworkConfig (203.80s)
github.com/e2b-dev/infra/tests/integration/internal/tests/api/sandboxes::TestUpdateNetworkConfig/pause_resume_preserves_allow_internet_access_false

Flake rate in main: 58.82% (Passed 14 times, Failed 20 times)

Stack Traces | 14.3s run time
=== RUN   TestUpdateNetworkConfig/pause_resume_preserves_allow_internet_access_false
Executing command curl in sandbox ik6dy1ts3pqi58zzkzbrx
    sandbox_network_update_test.go:372: Command [curl] output: event:{start:{pid:1347}}
    sandbox_network_update_test.go:372: Command [curl] output: event:{end:{exit_code:35  exited:true  status:"exit status 35"  error:"exit status 35"}}
Executing command curl in sandbox ik6dy1ts3pqi58zzkzbrx
    sandbox_network_update_test.go:372: Command [curl] output: event:{start:{pid:1348}}
    sandbox_network_update_test.go:372: Command [curl] output: event:{end:{exit_code:35  exited:true  status:"exit status 35"  error:"exit status 35"}}
    sandbox_network_update_test.go:391: Command [curl] output: event:{start:{pid:1349}}
    sandbox_network_update_test.go:391: Command [curl] output: event:{data:{stdout:"HTTP/2 302 \r\nx-content-type-options: nosniff\r\nlocation: https://dns.google/\r\ndate: Tue, 05 May 2026 22:27:49 GMT\r\ncontent-type: text/html; charset=UTF-8\r\nserver: HTTP server (unknown)\r\ncontent-length: 216\r\nx-xss-protection: 0\r\nx-frame-options: SAMEORIGIN\r\nalt-svc: h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000\r\n\r\n"}}
    sandbox_network_update_test.go:391: Command [curl] output: event:{end:{exited:true  status:"exit status 0"}}
    sandbox_network_update_test.go:391: Command [curl] completed successfully in sandbox ik6dy1ts3pqi58zzkzbrx
    sandbox_network_update_test.go:391: 
        	Error Trace:	.../api/sandboxes/sandbox_network_out_test.go:74
        	            				.../api/sandboxes/sandbox_network_update_test.go:60
        	            				.../api/sandboxes/sandbox_network_update_test.go:391
        	Error:      	An error is expected but got nil.
        	Test:       	TestUpdateNetworkConfig/pause_resume_preserves_allow_internet_access_false
        	Messages:   	https://8.8.8.8 should be blocked
--- FAIL: TestUpdateNetworkConfig/pause_resume_preserves_allow_internet_access_false (14.34s)
github.com/e2b-dev/infra/tests/integration/internal/tests/envd::TestBindLocalhost

Flake rate in main: 27.78% (Passed 13 times, Failed 5 times)

Stack Traces | 0s run time
=== RUN   TestBindLocalhost
=== PAUSE TestBindLocalhost
=== CONT  TestBindLocalhost
--- FAIL: TestBindLocalhost (0.00s)
github.com/e2b-dev/infra/tests/integration/internal/tests/envd::TestBindLocalhost/bind_0_0_0_0

Flake rate in main: 33.33% (Passed 10 times, Failed 5 times)

Stack Traces | 7.51s run time
=== RUN   TestBindLocalhost/bind_0_0_0_0
=== PAUSE TestBindLocalhost/bind_0_0_0_0
=== CONT  TestBindLocalhost/bind_0_0_0_0
    localhost_bind_test.go:69: Command [python] output: event:{start:{pid:1254}}
    localhost_bind_test.go:90: 
        	Error Trace:	.../tests/envd/localhost_bind_test.go:90
        	Error:      	Not equal: 
        	            	expected: 200
        	            	actual  : 502
        	Test:       	TestBindLocalhost/bind_0_0_0_0
        	Messages:   	Unexpected status code 502 for bind address 0.0.0.0
--- FAIL: TestBindLocalhost/bind_0_0_0_0 (7.51s)
github.com/e2b-dev/infra/tests/integration/internal/tests/envd::TestBindLocalhost/bind_127_0_0_1

Flake rate in main: 33.33% (Passed 10 times, Failed 5 times)

Stack Traces | 7.94s run time
=== RUN   TestBindLocalhost/bind_127_0_0_1
=== PAUSE TestBindLocalhost/bind_127_0_0_1
=== CONT  TestBindLocalhost/bind_127_0_0_1
Executing command python in sandbox ig821m0v0elvp8if3vv8f
    localhost_bind_test.go:69: Command [python] output: event:{start:{pid:1254}}
    localhost_bind_test.go:90: 
        	Error Trace:	.../tests/envd/localhost_bind_test.go:90
        	Error:      	Not equal: 
        	            	expected: 200
        	            	actual  : 502
        	Test:       	TestBindLocalhost/bind_127_0_0_1
        	Messages:   	Unexpected status code 502 for bind address 127.0.0.1
--- FAIL: TestBindLocalhost/bind_127_0_0_1 (7.94s)
github.com/e2b-dev/infra/tests/integration/internal/tests/envd::TestBindLocalhost/bind_::

Flake rate in main: 28.57% (Passed 10 times, Failed 4 times)

Stack Traces | 7.75s run time
=== RUN   TestBindLocalhost/bind_::
=== PAUSE TestBindLocalhost/bind_::
=== CONT  TestBindLocalhost/bind_::
Executing command python in sandbox itiwpttkpouq0a6pjshb4
    localhost_bind_test.go:69: Command [python] output: event:{start:{pid:1254}}
    localhost_bind_test.go:90: 
        	Error Trace:	.../tests/envd/localhost_bind_test.go:90
        	Error:      	Not equal: 
        	            	expected: 200
        	            	actual  : 502
        	Test:       	TestBindLocalhost/bind_::
        	Messages:   	Unexpected status code 502 for bind address ::
--- FAIL: TestBindLocalhost/bind_:: (7.75s)
github.com/e2b-dev/infra/tests/integration/internal/tests/envd::TestBindLocalhost/bind_::1

Flake rate in main: 33.33% (Passed 10 times, Failed 5 times)

Stack Traces | 12.9s run time
=== RUN   TestBindLocalhost/bind_::1
=== PAUSE TestBindLocalhost/bind_::1
=== CONT  TestBindLocalhost/bind_::1
    localhost_bind_test.go:69: Command [python] output: event:{start:{pid:1254}}
Executing command python in sandbox itld4hbckea201s5c7zp6
    localhost_bind_test.go:90: 
        	Error Trace:	.../tests/envd/localhost_bind_test.go:90
        	Error:      	Not equal: 
        	            	expected: 200
        	            	actual  : 502
        	Test:       	TestBindLocalhost/bind_::1
        	Messages:   	Unexpected status code 502 for bind address ::1
--- FAIL: TestBindLocalhost/bind_::1 (12.90s)
github.com/e2b-dev/infra/tests/integration/internal/tests/envd::TestBindLocalhost/bind_localhost

Flake rate in main: 33.33% (Passed 10 times, Failed 5 times)

Stack Traces | 8.42s run time
=== RUN   TestBindLocalhost/bind_localhost
=== PAUSE TestBindLocalhost/bind_localhost
=== CONT  TestBindLocalhost/bind_localhost
Executing command python in sandbox ilx6ixkw7lvc5rat6md2b
    localhost_bind_test.go:69: Command [python] output: event:{start:{pid:1254}}
    localhost_bind_test.go:90: 
        	Error Trace:	.../tests/envd/localhost_bind_test.go:90
        	Error:      	Not equal: 
        	            	expected: 200
        	            	actual  : 502
        	Test:       	TestBindLocalhost/bind_localhost
        	Messages:   	Unexpected status code 502 for bind address localhost
--- FAIL: TestBindLocalhost/bind_localhost (8.42s)
github.com/e2b-dev/infra/tests/integration/internal/tests/envd::TestListDir

Flake rate in main: 28.57% (Passed 10 times, Failed 4 times)

Stack Traces | 0.25s run time
=== RUN   TestListDir
=== PAUSE TestListDir
=== CONT  TestListDir
--- FAIL: TestListDir (0.25s)
github.com/e2b-dev/infra/tests/integration/internal/tests/envd::TestListDir/depth_0_lists_only_root_directory

Flake rate in main: 28.57% (Passed 10 times, Failed 4 times)

Stack Traces | 0.02s run time
=== RUN   TestListDir/depth_0_lists_only_root_directory
=== PAUSE TestListDir/depth_0_lists_only_root_directory
=== CONT  TestListDir/depth_0_lists_only_root_directory
    filesystem_test.go:97: 
        	Error Trace:	.../tests/envd/filesystem_test.go:97
        	Error:      	Received unexpected error:
        	            	unavailable: 502 Bad Gateway
        	Test:       	TestListDir/depth_0_lists_only_root_directory
--- FAIL: TestListDir/depth_0_lists_only_root_directory (0.02s)
github.com/e2b-dev/infra/tests/integration/internal/tests/envd::TestListDir/depth_1_lists_root_directory

Flake rate in main: 28.57% (Passed 10 times, Failed 4 times)

Stack Traces | 0.01s run time
=== RUN   TestListDir/depth_1_lists_root_directory
=== PAUSE TestListDir/depth_1_lists_root_directory
=== CONT  TestListDir/depth_1_lists_root_directory
    filesystem_test.go:97: 
        	Error Trace:	.../tests/envd/filesystem_test.go:97
        	Error:      	Received unexpected error:
        	            	unavailable: 502 Bad Gateway
        	Test:       	TestListDir/depth_1_lists_root_directory
--- FAIL: TestListDir/depth_1_lists_root_directory (0.01s)
github.com/e2b-dev/infra/tests/integration/internal/tests/envd::TestListDir/depth_2_lists_first_level_of_subdirectories_(in_this_case_the_root_directory)

Flake rate in main: 28.57% (Passed 10 times, Failed 4 times)

Stack Traces | 0.01s run time
=== RUN   TestListDir/depth_2_lists_first_level_of_subdirectories_(in_this_case_the_root_directory)
=== PAUSE TestListDir/depth_2_lists_first_level_of_subdirectories_(in_this_case_the_root_directory)
=== CONT  TestListDir/depth_2_lists_first_level_of_subdirectories_(in_this_case_the_root_directory)
    filesystem_test.go:97: 
        	Error Trace:	.../tests/envd/filesystem_test.go:97
        	Error:      	Received unexpected error:
        	            	unavailable: 502 Bad Gateway
        	Test:       	TestListDir/depth_2_lists_first_level_of_subdirectories_(in_this_case_the_root_directory)
--- FAIL: TestListDir/depth_2_lists_first_level_of_subdirectories_(in_this_case_the_root_directory) (0.01s)
github.com/e2b-dev/infra/tests/integration/internal/tests/envd::TestListDir/depth_3_lists_all_directories_and_files

Flake rate in main: 28.57% (Passed 10 times, Failed 4 times)

Stack Traces | 0.01s run time
=== RUN   TestListDir/depth_3_lists_all_directories_and_files
=== PAUSE TestListDir/depth_3_lists_all_directories_and_files
=== CONT  TestListDir/depth_3_lists_all_directories_and_files
Executing command python in sandbox ip00uva0h2gc6xoz1fsoy
    filesystem_test.go:97: 
        	Error Trace:	.../tests/envd/filesystem_test.go:97
        	Error:      	Received unexpected error:
        	            	unavailable: 502 Bad Gateway
        	Test:       	TestListDir/depth_3_lists_all_directories_and_files
--- FAIL: TestListDir/depth_3_lists_all_directories_and_files (0.01s)
github.com/e2b-dev/infra/tests/integration/internal/tests/orchestrator::TestSandboxMemoryIntegrity

Flake rate in main: 38.89% (Passed 11 times, Failed 7 times)

Stack Traces | 0s run time
=== RUN   TestSandboxMemoryIntegrity
=== PAUSE TestSandboxMemoryIntegrity
=== CONT  TestSandboxMemoryIntegrity
--- FAIL: TestSandboxMemoryIntegrity (0.00s)
github.com/e2b-dev/infra/tests/integration/internal/tests/orchestrator::TestSandboxMemoryIntegrity/stress-ng_verify

Flake rate in main: 33.33% (Passed 10 times, Failed 5 times)

Stack Traces | 35.3s run time
=== RUN   TestSandboxMemoryIntegrity/stress-ng_verify
=== PAUSE TestSandboxMemoryIntegrity/stress-ng_verify
=== CONT  TestSandboxMemoryIntegrity/stress-ng_verify
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{start:{pid:1264}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Hit:1 http://deb.debian.org/debian bookworm InRelease\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Hit:2 http://deb.debian.org/debian bookworm-updates InRelease\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Hit:3 http://deb.debian.org/debian-security bookworm-security InRelease\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Reading package lists..."}}
Executing command bash in sandbox ix0w580padid6q8qycjmu (user: root)
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Reading package lists..."}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Building dependency tree..."}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"\nReading state information..."}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"The following additional packages will be installed:\n  libdrm-common libdrm2 libegl-mesa0 libegl1 libgbm1 libglapi-mesa libgles2\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"  libglvnd0 libipsec-mb1 libjudydebian1 libsctp1 libwayland-client0\n  libwayland-server0 libx11-xcb1 libxcb-dri2-0 libxcb-dri3-0 libxcb-present0\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"  libxcb-randr0 libxcb-sync1 libxcb-xfixes0 libxshmfence1\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Suggested packages:\n  lksctp-tools\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"The following NEW packages will be installed:\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"  libdrm-common libdrm2 libegl-mesa0 libegl1 libgbm1 libglapi-mesa libgles2\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"  libglvnd0 libipsec-mb1 libjudydebian1 libsctp1 libwayland-client0\n  libwayland-server0 libx11-xcb1 libxcb-dri2-0 libxcb-dri3-0 libxcb-present0\n  libxcb-randr0 libxcb-sync1 libxcb-xfixes0 libxshmfence1 stress-ng time\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"0 upgraded, 23 newly installed, 0 to remove and 146 not upgraded.\nNeed to get 4781 kB of archives.\nAfter this operation, 25.6 MB of additional disk space will be used.\nGet:1 http://deb.debian.org/debian bookworm/main amd64 libdrm-common all 2.4.114-1 [7112 B]\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Get:2 http://deb.debian.org/debian bookworm/main amd64 libdrm2 amd64 2.4.114-1+b1 [37.5 kB]\nGet:3 http://deb.debian.org/debian bookworm/main amd64 libwayland-server0 amd64 1.21.0-1 [35.9 kB]\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Get:4 http://deb.debian.org/debian bookworm/main amd64 libgbm1 amd64 22.3.6-1+deb12u1 [38.0 kB]\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Get:5 http://deb.debian.org/debian bookworm/main amd64 libglapi-mesa amd64 22.3.6-1+deb12u1 [35.7 kB]\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Get:6 http://deb.debian.org/debian bookworm/main amd64 libwayland-client0 amd64 1.21.0-1 [28.3 kB]\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Get:7 http://deb.debian.org/debian bookworm/main amd64 libx11-xcb1 amd64 2:1.8.4-2+deb12u2 [192 kB]\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Get:8 http://deb.debian.org/debian bookworm/main amd64 libxcb-dri2-0 amd64 1.15-1 [107 kB]\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Get:9 http://deb.debian.org/debian bookworm/main amd64 libxcb-dri3-0 amd64 1.15-1 [107 kB]\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Get:10 http://deb.debian.org/debian bookworm/main amd64 libxcb-present0 amd64 1.15-1 [105 kB]\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Get:11 http://deb.debian.org/debian bookworm/main amd64 libxcb-randr0 amd64 1.15-1 [117 kB]\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Get:12 http://deb.debian.org/debian bookworm/main amd64 libxcb-sync1 amd64 1.15-1 [109 kB]\nGet:13 http://deb.debian.org/debian bookworm/main amd64 libxcb-xfixes0 amd64 1.15-1 [109 kB]\nGet:14 http://deb.debian.org/debian bookworm/main amd64 libxshmfence1 amd64 1.3-1 [8820 B]\nGet:15 http://deb.debian.org/debian bookworm/main amd64 libegl-mesa0 amd64 22.3.6-1+deb12u1 [114 kB]\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Get:16 http://deb.debian.org/debian bookworm/main amd64 libglvnd0 amd64 1.6.0-1 [51.8 kB]\nGet:17 http://deb.debian.org/debian bookworm/main amd64 libgles2 amd64 1.6.0-1 [16.8 kB]\nGet:18 http://deb.debian.org/debian bookworm/main amd64 libipsec-mb1 amd64 1.3-2 [981 kB]\nGet:19 http://deb.debian.org/debian bookworm/main amd64 libjudydebian1 amd64 1.0.5-5+b2 [102 kB]\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Get:20 http://deb.debian.org/debian bookworm/main amd64 libsctp1 amd64 1.0.19+dfsg-2 [29.7 kB]\nGet:21 http://deb.debian.org/debian bookworm/main amd64 libegl1 amd64 1.6.0-1 [33.7 kB]\nGet:22 http://deb.debian.org/debian bookworm/main amd64 stress-ng amd64 0.15.06-2 [2363 kB]\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Get:23 http://deb.debian.org/debian bookworm/main amd64 time amd64 1.9-0.2 [50.8 kB]\n"}}
Executing command bash in sandbox i6jm6i34s9l4bzy2eoffv (user: root)
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stderr:"debconf: delaying package configuration, since apt-utils is not installed\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Fetched 4781 kB in 0s (12.4 MB/s)\n"}}
Executing command bash in sandbox i6jm6i34s9l4bzy2eoffv (user: root)
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Selecting previously unselected package libdrm-common.\r\n(Reading database ... \r"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"(Reading database ... 5%\r(Reading database ... 10%\r(Reading database ... 15%\r(Reading database ... 20%\r(Reading database ... 25%\r(Reading database ... 30%\r(Reading database ... 35%\r(Reading database ... 40%\r(Reading database ... 45%\r(Reading database ... 50%\r(Reading database ... 55%\r(Reading database ... 60%\r(Reading database ... 65%\r"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"(Reading database ... 70%\r"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"(Reading database ... 75%\r"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"(Reading database ... 80%\r"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"(Reading database ... 85%\r"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"(Reading database ... 90%\r"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"(Reading database ... 95%\r"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"(Reading database ... 100%\r(Reading database ... 25971 files and directories currently installed.)\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Preparing to unpack .../00-libdrm-common_2.4.114-1_all.deb ...\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Unpacking libdrm-common (2.4.114-1) ...\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Selecting previously unselected package libdrm2:amd64."}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Preparing to unpack .../01-libdrm2_2.4.114-1+b1_amd64.deb ...\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Unpacking libdrm2:amd64 (2.4.114-1+b1) ...\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Selecting previously unselected package libwayland-server0:amd64.\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Preparing to unpack .../02-libwayland-server0_1.21.0-1_amd64.deb ...\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Unpacking libwayland-server0:amd64 (1.21.0-1) ...\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Selecting previously unselected package libgbm1:amd64.\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Preparing to unpack .../03-libgbm1_22.3.6-1+deb12u1_amd64.deb ...\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Unpacking libgbm1:amd64 (22.3.6-1+deb12u1) ...\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Selecting previously unselected package libglapi-mesa:amd64.\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Preparing to unpack .../04-libglapi-mesa_22.3.6-1+deb12u1_amd64.deb ...\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Unpacking libglapi-mesa:amd64 (22.3.6-1+deb12u1) ...\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Selecting previously unselected package libwayland-client0:amd64.\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Preparing to unpack .../05-libwayland-client0_1.21.0-1_amd64.deb ...\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Unpacking libwayland-client0:amd64 (1.21.0-1) ...\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Selecting previously unselected package libx11-xcb1:amd64.\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Preparing to unpack .../06-libx11-xcb1_2%3a1.8.4-2+deb12u2_amd64.deb ...\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Unpacking libx11-xcb1:amd64 (2:1.8.4-2+deb12u2) ...\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Selecting previously unselected package libxcb-dri2-0:amd64.\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Preparing to unpack .../07-libxcb-dri2-0_1.15-1_amd64.deb ...\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Unpacking libxcb-dri2-0:amd64 (1.15-1) ...\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Selecting previously unselected package libxcb-dri3-0:amd64.\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Preparing to unpack .../08-libxcb-dri3-0_1.15-1_amd64.deb ...\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Unpacking libxcb-dri3-0:amd64 (1.15-1) ...\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Selecting previously unselected package libxcb-present0:amd64.\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Preparing to unpack .../09-libxcb-present0_1.15-1_amd64.deb ...\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Unpacking libxcb-present0:amd64 (1.15-1) ...\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Selecting previously unselected package libxcb-randr0:amd64.\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Preparing to unpack .../10-libxcb-randr0_1.15-1_amd64.deb ...\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Unpacking libxcb-randr0:amd64 (1.15-1) ...\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Selecting previously unselected package libxcb-sync1:amd64.\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Preparing to unpack .../11-libxcb-sync1_1.15-1_amd64.deb ...\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Unpacking libxcb-sync1:amd64 (1.15-1) ...\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Selecting previously unselected package libxcb-xfixes0:amd64.\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Preparing to unpack .../12-libxcb-xfixes0_1.15-1_amd64.deb ...\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Unpacking libxcb-xfixes0:amd64 (1.15-1) ...\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Selecting previously unselected package libxshmfence1:amd64.\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Preparing to unpack .../13-libxshmfence1_1.3-1_amd64.deb ...\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Unpacking libxshmfence1:amd64 (1.3-1) ...\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Selecting previously unselected package libegl-mesa0:amd64.\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Preparing to unpack .../14-libegl-mesa0_22.3.6-1+deb12u1_amd64.deb ...\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Unpacking libegl-mesa0:amd64 (22.3.6-1+deb12u1) ...\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Selecting previously unselected package libglvnd0:amd64.\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Preparing to unpack .../15-libglvnd0_1.6.0-1_amd64.deb ...\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Unpacking libglvnd0:amd64 (1.6.0-1) ...\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Selecting previously unselected package libgles2:amd64.\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Preparing to unpack .../16-libgles2_1.6.0-1_amd64.deb ...\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Unpacking libgles2:amd64 (1.6.0-1) ...\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Selecting previously unselected package libipsec-mb1.\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Preparing to unpack .../17-libipsec-mb1_1.3-2_amd64.deb ...\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Unpacking libipsec-mb1 (1.3-2) ...\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Selecting previously unselected package libjudydebian1.\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Preparing to unpack .../18-libjudydebian1_1.0.5-5+b2_amd64.deb ...\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Unpacking libjudydebian1 (1.0.5-5+b2) ...\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Selecting previously unselected package libsctp1:amd64.\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Preparing to unpack .../19-libsctp1_1.0.19+dfsg-2_amd64.deb ...\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Unpacking libsctp1:amd64 (1.0.19+dfsg-2) ...\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Selecting previously unselected package libegl1:amd64.\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Preparing to unpack .../20-libegl1_1.6.0-1_amd64.deb ...\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Unpacking libegl1:amd64 (1.6.0-1) ...\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Selecting previously unselected package stress-ng.\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Preparing to unpack .../21-stress-ng_0.15.06-2_amd64.deb ...\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Unpacking stress-ng (0.15.06-2) ...\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Selecting previously unselected package time.\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Preparing to unpack .../22-time_1.9-0.2_amd64.deb ...\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Unpacking time (1.9-0.2) ...\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Setting up libxcb-dri3-0:amd64 (1.15-1) ...\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Setting up libwayland-server0:amd64 (1.21.0-1) ...\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Setting up libx11-xcb1:amd64 (2:1.8.4-2+deb12u2) ...\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Setting up time (1.9-0.2) ...\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Setting up libxcb-xfixes0:amd64 (1.15-1) ...\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Setting up libglvnd0:amd64 (1.6.0-1) ...\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Setting up libjudydebian1 (1.0.5-5+b2) ...\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Setting up libxcb-present0:amd64 (1.15-1) ...\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Setting up libipsec-mb1 (1.3-2) ...\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Setting up libgles2:amd64 (1.6.0-1) ...\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Setting up libxcb-sync1:amd64 (1.15-1) ...\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Setting up libglapi-mesa:amd64 (22.3.6-1+deb12u1) ...\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Setting up libxcb-dri2-0:amd64 (1.15-1) ...\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Setting up libsctp1:amd64 (1.0.19+dfsg-2) ...\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Setting up libxshmfence1:amd64 (1.3-1) ...\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Setting up libxcb-randr0:amd64 (1.15-1) ...\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Setting up libdrm-common (2.4.114-1) ...\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Setting up libwayland-client0:amd64 (1.21.0-1) ...\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Setting up libdrm2:amd64 (2.4.114-1+b1) ...\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Setting up libgbm1:amd64 (22.3.6-1+deb12u1) ...\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Setting up libegl-mesa0:amd64 (22.3.6-1+deb12u1) ...\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{data:{stdout:"Setting up libegl1:amd64 (1.6.0-1) ...\r\nSetting up stress-ng (0.15.06-2) ...\r\nProcessing triggers for libc-bin (2.36-9+deb12u3) ...\r\n"}}
    sandbox_memory_integrity_test.go:141: Command [bash] output: event:{end:{exited:true status:"exit status 0"}}
    sandbox_memory_integrity_test.go:141: Command [bash] completed successfully in sandbox ij30ew5o928tfep9d21bx
Executing command bash in sandbox ij30ew5o928tfep9d21bx (user: root)
    sandbox_memory_integrity_test.go:148: Command [bash] output: event:{start:{pid:1636}}
    sandbox_memory_integrity_test.go:148: Command [bash] output: event:{data:{stdout:"733\n"}}
    sandbox_memory_integrity_test.go:148: Command [bash] output: event:{end:{exited:true status:"exit status 0"}}
    sandbox_memory_integrity_test.go:148: Command [bash] completed successfully in sandbox ij30ew5o928tfep9d21bx
Executing command bash in sandbox ij30ew5o928tfep9d21bx (user: root)
    sandbox_memory_integrity_test.go:159: Command [bash] output: event:{start:{pid:1639}}
    sandbox_memory_integrity_test.go:159: Command [bash] output: event:{data:{stderr:"stress-ng: debug: [1640] invoked with 'stress-ng --vm 1 --vm-bytes 586M --verify -v -t 5s' by user 0 'root'\n"}}
    sandbox_memory_integrity_test.go:159: Command [bash] output: event:{data:{stderr:"stress-ng: debug: [1640] stress-ng 0.15.06\nstress-ng: debug: [1640] system: Linux e2b.local 6.1.158 #2 SMP PREEMPT_DYNAMIC Fri Apr 10 04:45:11 UTC 2026 x86_64\nstress-ng: debug: [1640] RAM total: 985.3M, RAM free: 717.5M, swap free: 0.0\nstress-ng: debug: [1640] temporary file path: '.', filesystem type: ext2\nstress-ng: debug: [1640] 2 processors online, 2 processors configured\nstress-ng: info:  [1640] setting to a 5 second run per stressor\nstress-ng: info:  [1640] dispatching hogs: 1 vm\n"}}
    sandbox_memory_integrity_test.go:159: Command [bash] output: event:{data:{stderr:"stress-ng: debug: [1640] cache allocate: shared cache buffer size: 32768K\nstress-ng: debug: [1640] starting stressors\nstress-ng: debug: [1640] 1 stressor started\n"}}
    sandbox_memory_integrity_test.go:159: Command [bash] output: event:{data:{stderr:"stress-ng: debug: [1641] vm: started [1641] (instance 0)\n"}}
    sandbox_memory_integrity_test.go:159: Command [bash] output: event:{data:{stderr:"stress-ng: debug: [1641] vm: using method 'all'\n"}}
    sandbox_memory_integrity_test.go:160: 
        	Error Trace:	.../tests/orchestrator/sandbox_memory_integrity_test.go:160
        	Error:      	Received unexpected error:
        	            	failed to execute command bash in sandbox ij30ew5o928tfep9d21bx: invalid_argument: protocol error: incomplete envelope: unexpected EOF
        	Test:       	TestSandboxMemoryIntegrity/stress-ng_verify
--- FAIL: TestSandboxMemoryIntegrity/stress-ng_verify (35.28s)
github.com/e2b-dev/infra/tests/integration/internal/tests/orchestrator::TestSandboxMemoryIntegrity/tmpfs_hash

Flake rate in main: 41.18% (Passed 10 times, Failed 7 times)

Stack Traces | 31.1s run time
=== RUN   TestSandboxMemoryIntegrity/tmpfs_hash
=== PAUSE TestSandboxMemoryIntegrity/tmpfs_hash
=== CONT  TestSandboxMemoryIntegrity/tmpfs_hash
    sandbox_memory_integrity_test.go:33: Command [bash] output: event:{start:{pid:1254}}
Executing command bash in sandbox i5kxa0elko2fl1f02l1fp (user: root)
    sandbox_memory_integrity_test.go:33: Command [bash] output: event:{data:{stdout:"Hit:1 http://deb.debian.org/debian bookworm InRelease\nHit:2 http://deb.debian.org/debian bookworm-updates InRelease\n"}}
    sandbox_memory_integrity_test.go:33: Command [bash] output: event:{data:{stdout:"Hit:3 http://deb.debian.org/debian-security bookworm-security InRelease\n"}}
    sandbox_memory_integrity_test.go:33: Command [bash] output: event:{data:{stdout:"Reading package lists..."}}
    sandbox_memory_integrity_test.go:33: Command [bash] output: event:{data:{stdout:"\n"}}
    sandbox_memory_integrity_test.go:33: Command [bash] output: event:{data:{stdout:"Reading package lists..."}}
    sandbox_memory_integrity_test.go:33: Command [bash] output: event:{data:{stdout:"\n"}}
    sandbox_memory_integrity_test.go:33: Command [bash] output: event:{data:{stdout:"Building dependency tree..."}}
    sandbox_memory_integrity_test.go:33: Command [bash] output: event:{data:{stdout:"\nReading state information..."}}
    sandbox_memory_integrity_test.go:33: Command [bash] output: event:{data:{stdout:"\n"}}
    sandbox_memory_integrity_test.go:33: Command [bash] output: event:{data:{stdout:"The following NEW packages will be installed:\n  time\n"}}
    sandbox_memory_integrity_test.go:33: Command [bash] output: event:{data:{stdout:"0 upgraded, 1 newly installed, 0 to remove and 146 not upgraded.\nNeed to get 50.8 kB of archives.\nAfter this operation, 132 kB of additional disk space will be used.\nGet:1 http://deb.debian.org/debian bookworm/main amd64 time amd64 1.9-0.2 [50.8 kB]\n"}}
    sandbox_memory_integrity_test.go:33: Command [bash] output: event:{data:{stderr:"debconf: delaying package configuration, since apt-utils is not installed\n"}}
    sandbox_memory_integrity_test.go:33: Command [bash] output: event:{data:{stdout:"Fetched 50.8 kB in 0s (576 kB/s)\n"}}
    sandbox_memory_integrity_test.go:33: Command [bash] output: event:{data:{stdout:"Selecting previously unselected package time.\r\n(Reading database ... \r"}}
    sandbox_memory_integrity_test.go:33: Command [bash] output: event:{data:{stdout:"(Reading database ... 5%\r(Reading database ... 10%\r(Reading database ... 15%\r(Reading database ... 20%\r(Reading database ... 25%\r(Reading database ... 30%\r(Reading database ... 35%\r(Reading database ... 40%\r(Reading database ... 45%\r(Reading database ... 50%\r(Reading database ... 55%\r(Reading database ... 60%\r(Reading database ... 65%\r"}}
    sandbox_memory_integrity_test.go:33: Command [bash] output: event:{data:{stdout:"(Reading database ... 70%\r"}}
    sandbox_memory_integrity_test.go:33: Command [bash] output: event:{data:{stdout:"(Reading database ... 75%\r"}}
    sandbox_memory_integrity_test.go:33: Command [bash] output: event:{data:{stdout:"(Reading database ... 80%\r"}}
Executing command bash in sandbox ih2wubl0lj44y21eu8k6x (user: root)
    sandbox_memory_integrity_test.go:34: 
        	Error Trace:	.../tests/orchestrator/sandbox_memory_integrity_test.go:34
        	Error:      	Received unexpected error:
        	            	failed to execute command bash in sandbox ickg7i1mnbmfuz513a1kd: invalid_argument: protocol error: incomplete envelope: unexpected EOF
        	Test:       	TestSandboxMemoryIntegrity/tmpfs_hash
--- FAIL: TestSandboxMemoryIntegrity/tmpfs_hash (31.09s)

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

ValentaTomas added a commit that referenced this pull request May 4, 2026
Adds `block.Tracker`, a non-generic state tracker over a fixed
`block.State` enum with three universal values that cover both UFFD
memory handling and NBD overlay tracking:

- `NotPresent` (default) — fall through to the previous layer
- `Dirty` — materialized in this layer (UFFD faulted page, NBD
overlay-owned block)
- `Zero` — known-zero without consulting the previous layer (UFFD page
removed via `DONTNEED`/balloon, NBD explicit zero/discard)

Backed by two roaring bitmaps (`dirty`, `zero`); `NotPresent` indices
are implicit. Exposes `SetRange`, `Get`, and `Export` (returns clones).

First consumer is #2520 (UFFD per-page state); also used by #2546 for
NBD zero-page tracking.
Base automatically changed from feat/block-state-tracker to main May 4, 2026 23:27
ValentaTomas added a commit that referenced this pull request May 5, 2026
When a read range was tracked entirely as Zero, ReadAt returned len(b)
unconditionally, while the non-zero path returns copy(b, slice) where
slice is capped at c.size. Mirror that cap in the zero path so reads
that extend past EOF report the correct number of bytes (and 0 when
fully past EOF).

Reported by Cursor Bugbot on #2546.
@ValentaTomas ValentaTomas force-pushed the feat/nbd-zero-discard-detection branch from 64f075d to 645e279 Compare May 5, 2026 00:36
Comment thread packages/orchestrator/pkg/sandbox/block/cache.go Outdated
@ValentaTomas ValentaTomas requested review from bchalios and removed request for jakubno May 5, 2026 04:38
@dobrac dobrac enabled auto-merge (squash) May 5, 2026 06:33
@ValentaTomas ValentaTomas force-pushed the feat/nbd-zero-discard-detection branch 2 times, most recently from 8143945 to 43c8f20 Compare May 5, 2026 09:41
Comment thread packages/orchestrator/pkg/sandbox/block/tracker.go
@ValentaTomas ValentaTomas force-pushed the feat/nbd-zero-discard-detection branch from 43c8f20 to fa24b44 Compare May 5, 2026 09:48
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Autofix Details

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Zero-detection loop panics on non-block-aligned writes
    • Added blockEnd calculation to constrain slice access to actual buffer length, preventing index-out-of-range panic when buffer is not block-aligned.

Create PR

Or push these changes by commenting:

@cursor push 3056dd5d91
Preview (3056dd5d91)
diff --git a/packages/orchestrator/pkg/sandbox/block/cache.go b/packages/orchestrator/pkg/sandbox/block/cache.go
--- a/packages/orchestrator/pkg/sandbox/block/cache.go
+++ b/packages/orchestrator/pkg/sandbox/block/cache.go
@@ -348,7 +348,8 @@
 	// detect-zeroes=unmap: route aligned all-zero blocks to Empty.
 	for i := off; i < end; i += c.blockSize {
 		idx := uint32(header.BlockIdx(i, c.blockSize))
-		if header.IsZero(b[i-off : i-off+c.blockSize]) {
+		blockEnd := min(i-off+c.blockSize, int64(len(b)))
+		if header.IsZero(b[i-off : blockEnd]) {
 			c.punchHole(i, c.blockSize)
 			c.tracker.SetRange(idx, idx+1, Zero)
 		} else {

You can send follow-ups to the cloud agent here.

Comment thread packages/orchestrator/pkg/sandbox/block/cache.go
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fa24b44e96

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/orchestrator/pkg/sandbox/block/cache.go Outdated
Comment thread packages/orchestrator/pkg/sandbox/block/cache.go Outdated
@ValentaTomas ValentaTomas force-pushed the feat/nbd-zero-discard-detection branch from fa24b44 to 5260bb6 Compare May 5, 2026 10:00
Comment thread packages/orchestrator/pkg/sandbox/block/cache.go Outdated
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

Autofix Details

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: WriteZeroesAt uses floor division for end block index
    • Changed WriteZeroesAt to use BlockCeilIdx instead of BlockIdx for the end boundary to maintain consistency with setIsCached and isCached, preventing partial blocks from being zeroed without being tracked.

Create PR

Or push these changes by commenting:

@cursor push 31d6f04e99
Preview (31d6f04e99)
diff --git a/packages/orchestrator/pkg/sandbox/block/cache.go b/packages/orchestrator/pkg/sandbox/block/cache.go
--- a/packages/orchestrator/pkg/sandbox/block/cache.go
+++ b/packages/orchestrator/pkg/sandbox/block/cache.go
@@ -382,7 +382,7 @@
 	c.punchHole(off, end-off)
 	c.tracker.SetRange(
 		uint32(header.BlockIdx(off, c.blockSize)),
-		uint32(header.BlockIdx(end, c.blockSize)),
+		uint32(header.BlockCeilIdx(end, c.blockSize)),
 		Zero,
 	)

You can send follow-ups to the cloud agent here.

Comment thread packages/orchestrator/pkg/sandbox/block/cache.go Outdated
@ValentaTomas ValentaTomas force-pushed the feat/nbd-zero-discard-detection branch 3 times, most recently from dc01295 to db3c85f Compare May 5, 2026 10:21
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Flush uses BlockIdx instead of BlockCeilIdx for end
    • Changed flush closure to use BlockCeilIdx for endIdx calculation, making it consistent with setIsCached, isCached, and WriteZeroesAt to properly handle non-block-aligned end boundaries.

Create PR

Or push these changes by commenting:

@cursor push bd96e07c2a
Preview (bd96e07c2a)
diff --git a/packages/orchestrator/pkg/sandbox/block/cache.go b/packages/orchestrator/pkg/sandbox/block/cache.go
--- a/packages/orchestrator/pkg/sandbox/block/cache.go
+++ b/packages/orchestrator/pkg/sandbox/block/cache.go
@@ -350,7 +350,7 @@
 	// same-state run as a single bulk copy / punchHole / SetRange.
 	flush := func(runStart, runEnd int64, runZero bool) {
 		startIdx := uint32(header.BlockIdx(runStart, c.blockSize))
-		endIdx := uint32(header.BlockIdx(runEnd, c.blockSize))
+		endIdx := uint32(header.BlockCeilIdx(runEnd, c.blockSize))
 		if runZero {
 			c.punchHole(runStart, runEnd-runStart)
 			c.tracker.SetRange(startIdx, endIdx, Zero)

You can send follow-ups to the cloud agent here.

Reviewed by Cursor Bugbot for commit 11438b0. Configure here.

Comment thread packages/orchestrator/pkg/sandbox/block/cache.go Outdated
NBD_CMD_TRIM, NBD_CMD_WRITE_ZEROES, and all-zero plain WRITE now collapse
to Empty in the diff (mapped to uuid.Nil, already understood by the read
path) and the cache file is hole-punched via MADV_REMOVE so freed pages
return to tmpfs. Both NBD flags are advertised; rootfs is mounted with
discard.

Cache adds an `empty` bitset alongside the existing `dirty` (Empty is a
strict subset of dirty); on export, dirty.AndNot(empty) splits payload
from Empty. Diff format is unchanged (the Empty bitmap was always there,
just never populated), so old snapshots and old readers stay compatible.
@ValentaTomas ValentaTomas force-pushed the feat/nbd-zero-discard-detection branch from 11438b0 to 88beca9 Compare May 5, 2026 10:46
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 88beca939c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/orchestrator/pkg/sandbox/nbd/dispatch.go
Comment thread packages/orchestrator/pkg/sandbox/block/cache.go Outdated
- Fix WriteZeroesAt docstring (no head/tail handling exists).
- Collapse the multi-line WriteAtWithoutLock comment that narrated what
  the loop does into one line about intent.
- Tighten cmdWriteZeroes one-liner.
@ValentaTomas
Copy link
Copy Markdown
Member Author

@cla-bot check

1 similar comment
@tvi
Copy link
Copy Markdown
Contributor

tvi commented May 5, 2026

@cla-bot check

@cla-bot cla-bot Bot added the cla-signed label May 5, 2026
@cla-bot
Copy link
Copy Markdown

cla-bot Bot commented May 5, 2026

The cla-bot has been summoned, and re-checked this pull request!

1 similar comment
@cla-bot
Copy link
Copy Markdown

cla-bot Bot commented May 5, 2026

The cla-bot has been summoned, and re-checked this pull request!

@ValentaTomas ValentaTomas enabled auto-merge (squash) May 5, 2026 20:13
…-detection

# Conflicts:
#	packages/orchestrator/pkg/sandbox/block/cache_test.go
@ValentaTomas ValentaTomas disabled auto-merge May 5, 2026 22:30
@ValentaTomas ValentaTomas enabled auto-merge (squash) May 5, 2026 22:32
@ValentaTomas ValentaTomas merged commit 498acfa into main May 5, 2026
51 checks passed
@ValentaTomas ValentaTomas deleted the feat/nbd-zero-discard-detection branch May 5, 2026 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants