Skip to content

fix(core,kernel): subscription-path + buildQuery correctness fixes - #78

Open
EnriqueParodi wants to merge 1 commit into
ci/test-reportfrom
fix/kernel-subscription-bugs
Open

fix(core,kernel): subscription-path + buildQuery correctness fixes#78
EnriqueParodi wants to merge 1 commit into
ci/test-reportfrom
fix/kernel-subscription-bugs

Conversation

@EnriqueParodi

Copy link
Copy Markdown
Collaborator

Three crashes/dangling-pointer bugs in the subscription + query path, plus a
handful of tightening fixes found while auditing the path.

Backend correctness:

  • SEGV in NativeObjectProxy::senImplEventEmitted on subscribeAll churn:
    a subscriber being added while another was being removed could see a
    half-initialised slot. Iteration now snapshots-and-walks; mutation goes
    through a deferred queue. Regression test in test_kernel.
  • ObjectFilter::addSubscriber no longer carries a two-step "subscribe,
    then seedFromExistingObjects" handshake; the combined seedFromExisting
    call is the single API. Half-initialised state is no longer reachable.
  • buildQuery drops the cached raw ClassType*. The cache was the source
    of one of the SEGV stacks (stale pointer after a type was unregistered);
    inlining the lookup is cheaper than the cache it replaced.
  • Half-empty bus addresses (s. or .b) used to be permissive-skipped
    in selectFrom; now they fail loud at config-validation time.

Documentation:

  • selectAllFrom / selectFrom now document the callback-lifetime contract
    (callbacks may fire after the caller's lifetime; capture state through
    a shared_ptr that the callback owns). Pre-existing core convention,
    newly written down.
  • EventBuffer's invalidate-before-erase comment now matches its actual
    failure mode (was misnamed).
  • Renamed Event*-flavored proxy state to Property* where it was tracking
    property changes, not events.

Testing:

  • Added three regression tests covering the SEGV, the addSubscriber
    seed race, and half-empty-bus-address rejection.

This branch is the chain's foundation: every downstream branch (libs/gen,
jsonrpc, web-explorer) is sensitive to kernel subscription correctness.
The fixes here are root-cause; nothing downstream needs a workaround.

@EnriqueParodi
EnriqueParodi force-pushed the fix/kernel-subscription-bugs branch 4 times, most recently from 96f0ada to b57b06b Compare August 19, 2026 13:26
@EnriqueParodi
EnriqueParodi marked this pull request as ready for review August 19, 2026 13:31
@EnriqueParodi
EnriqueParodi force-pushed the fix/kernel-subscription-bugs branch 4 times, most recently from 4253da1 to 19eb568 Compare August 19, 2026 19:05
@EnriqueParodi
EnriqueParodi changed the base branch from main to ci/test-report August 19, 2026 19:06
@EnriqueParodi
EnriqueParodi force-pushed the fix/kernel-subscription-bugs branch from 19eb568 to 1143a58 Compare August 19, 2026 21:21
@EnriqueParodi
EnriqueParodi force-pushed the fix/kernel-subscription-bugs branch from 1143a58 to 159154c Compare August 20, 2026 11:26
Three crashes in the subscription and query path, found while auditing it: a
half-initialised slot during subscribeAll churn, a two-step addSubscriber
handshake, and a cached raw ClassType pointer that went stale. The fixes are
root-cause, so nothing downstream needs a workaround, and three regression
tests cover them.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant