Skip to content

Give SoCallbackList copy and assignment a strong exception guarantee - #832

Draft
Dikluwe wants to merge 10 commits into
coin3d:masterfrom
Dikluwe:codex/pr/socallbacklist-copy-atomic
Draft

Dikluwe wants to merge 10 commits into
coin3d:masterfrom
Dikluwe:codex/pr/socallbacklist-copy-atomic

Conversation

@Dikluwe

@Dikluwe Dikluwe commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Problem

Implicit copy/assignment and ownership-registry updates could partially change a destination on allocation failure. Cleanup also copied registry entries and could allocate while destroying callbacks.

Changes

  • Stage copy/assignment completely before committing pointer storage and ownership state.
  • Add explicit out-of-line SoCallbackList copy constructor and assignment operator; handle self-assignment and empty/mixed owned and raw callbacks.
  • Inspect existing SbHash values by pointer so removal/cleanup can release records without allocation.
  • Add narrow internal SbPList friendship without changing its layout, and deterministic bad_alloc copy/assignment/lifetime oracles.

The public class layout remains unchanged, but new copy methods add symbols. Recompiled clients use the strong guarantee; clients retaining the old inline/implicit implementation do not acquire that guarantee automatically. Old/new-header client link/run and sizeof/alignof checks passed in the reviewed combined library; formal ABI and native-platform checks remain CI gates. The fault oracle runs on Linux shared builds and concerns throwing C++ allocations, not generalized recoverable OOM.

Dependencies — keep as draft

Depends on #831. The diff against master includes the prerequisite stack. The contribution over the reviewed base is linked below; narrow/rebase the PR after its prerequisites are integrated.

Base: ffba47d0b5ff664790ab6277b39dc71c6f07ab65 (codex/pr/socallbacklist-add-atomic). Review this contribution over its base.

Validation

Linux candidate 87/87 CTests at ee516a61ecd17ae79178d9cf5d007768ebb3f242, with no skips. Dedicated integration lab previously passed 141/141 at f987241ef1b686e287fa43a2c143d5d7644e4988; that lab count is a separate reviewed snapshot.

Fresh publication gate of all eight exact heads: 35/35 directed and 153/153 total CTests, no skips, at e6687c088077082e6839b4fc39c632d5267b07d8. GCC/Ninja Debug shared build with COIN_THREADSAFE=ON and external Expat, build and compiler temporary files in RAM; Xvfb/software GLX environment. git diff --check passed for the proposed delta. Native Windows/macOS and formal ABI checks rerun on this published head.

This branch has not been deployed

No deployments
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