Skip to content

feat(ci/tests): heap-poisoning debug board + json machinery regression tests (#3588) - #3598

Merged
zackees merged 1 commit into
masterfrom
feat/heapdbg-board-json-tests-3588
Jul 2, 2026
Merged

zackees merged 1 commit into
masterfrom
feat/heapdbg-board-json-tests-3588

Conversation

@zackees

@zackees zackees commented Jul 2, 2026 •

Copy link
Copy Markdown
Member
  • esp32dev_heapdbg board: pioarduino + custom_sdkconfig=CONFIG_HEAP_POISONING_COMPREHENSIVE=y → IDF libs rebuilt from source with comprehensive heap poisoning. Verified end-to-end: option lands in the built sdkconfig + firmware; the Classic ESP32: heap corruption crash (LoadProhibited, garbage pointer) when AutoResearch HTTP server + client traffic runs alongside RPC response building #3588 repro runs under it. Result: poisoning canaries do NOT fire before the crash — the stray write lands inside a live allocation (rules out classic out-of-block overflow).
  • json_pair_traits test: locks the vector-ops classification invariants for the json object pair (the properties the relocation/double-destroy theories hinged on).
  • json_response_assembly test: verbatim host replica of the response-assembly choreography the device crash fires inside — 200 iterations with fragmentation churn, ASAN-clean.

Host: 349/349; lint clean.

Refs #3588.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added a new CI build target for ESP32 development boards with enhanced heap debugging enabled.
  • Tests
    • Added coverage for JSON pair handling in STL containers.
    • Added an AddressSanitizer test that validates JSON response assembly remains clean and produces substantial output.

…n tests (#3588)

- ci/boards.py: esp32dev_heapdbg — same pioarduino platform as
  esp32dev but with custom_sdkconfig=CONFIG_HEAP_POISONING_COMPREHENSIVE=y,
  which makes pioarduino rebuild the IDF libs from source with
  comprehensive heap poisoning. Verified end-to-end this session:
  the option lands in the built sdkconfig.h and the final firmware,
  and the #3588 repro runs under it (result: the poisoning canaries do
  NOT fire before the crash — the stray write lands INSIDE a live
  allocation, ruling out classic out-of-block overflow).

- tests/fl/stl/json_pair_traits.cpp: locks the vector-ops
  classification invariants for the json object pair (not trivially
  copyable; ops table present with real move/destroy fns) — the exact
  properties the #3588 relocation/double-destroy theories hinged on.

- tests/fl/stl/json_response_assembly.cpp: verbatim host replica of
  runSingleTestImpl's response-assembly choreography (the code the
  device crash fires inside), 200 iterations with fragmentation churn.
  ASAN-clean — pinning that the fl::json machinery is address-clean
  off-device and the corruption is environment-specific.

Host: 349/349, lint clean.

Co-Authored-By: Claude Fable 5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Jul 2, 2026 •

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: e8cc9637-39a7-45df-a889-93f4e9baa37f

📥 Commits

Reviewing files that changed from the base of the PR and between b42b3d3 and 86fac5c.

📒 Files selected for processing (3)
  • ci/boards.py
  • tests/fl/stl/json_pair_traits.cpp
  • tests/fl/stl/json_response_assembly.cpp

📝 Walkthrough

Walkthrough

This PR adds a new CI board constant ESP32DEV_HEAPDBG configured with comprehensive heap poisoning sdkconfig for the esp32dev platform, and introduces two new test files validating JSON vector element-ops traits and JSON response assembly serialization under AddressSanitizer.

Changes

CI Board and JSON Test Additions

Layer / File(s) Summary
New heap-debug CI board
ci/boards.py
Adds ESP32DEV_HEAPDBG board mapped to esp32dev real board, using ESP32_IDF_5_3_PIOARDUINO platform with CONFIG_HEAP_POISONING_COMPREHENSIVE=y sdkconfig.
JSON pair trait test
tests/fl/stl/json_pair_traits.cpp
New test verifies non-trivial-copyability of json pair types and validates fl::vector_element_ops_for returns expected move/destroy function pointers.
JSON response assembly ASan test
tests/fl/stl/json_response_assembly.cpp
New test builds patterns via buildPattern, churns allocator buffers across iterations, assembles and serializes a full response JSON, and checks output size for ASan-clean assembly.

Estimated code review effort: 2 (Simple) | ~10 minutes

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/heapdbg-board-json-tests-3588

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant