Skip to content

Restore safe SoNodeKitPath object semantics - #1

Closed
Dikluwe wants to merge 13 commits into
fix/sopath-fullpath-downcast-ubfrom
fix/sonodekitpath-object-model-safety
Closed

Dikluwe wants to merge 13 commits into
fix/sopath-fullpath-downcast-ubfrom
fix/sonodekitpath-object-model-safety

Conversation

@Dikluwe

@Dikluwe Dikluwe commented Sep 16, 2026

Copy link
Copy Markdown
Owner

Stacked draft: this PR is based on the head of coin3d#714 and must be rebased/retargeted after coin3d#714 merges. The comparison intentionally contains only the two SoNodeKitPath commits.

Summary

  • construct genuine SoNodeKitPath objects instead of treating SoPath storage as a derived object
  • add SoNodeKitPath::fromPath() as the checked conversion boundary
  • preserve the nodekit-facing path projection for length, node, index, tail, truncation, pop, append, equality, and I/O operations
  • remove remaining manipulator code that treated an arbitrary SoPath* as SoNodeKitPath*

Motivation

SoNodeKitPath was used as an interface lens over storage created as SoPath. Unlike a valid base-to-derived relationship, the dynamic object was never a SoNodeKitPath; calling derived members through that pointer is undefined behavior and UBSan/vptr detects it. PR coin3d#714 fixes the analogous SoFullPath pattern and supplies the full-route accessors used by this follow-up.

This PR preserves the Open Inventor-facing projection while restoring a real C++ object model: objects returned as SoNodeKitPath* are now actually constructed as SoNodeKitPath.

Validation

  • 11/11 focused contract tests pass in Debug and Release with UBSan/vptr
  • 23/23 targeted mutation checks are killed by the contract suite
  • the full CoinTests suite passes in Debug and Release
  • ABI review shows no removals or layout changes; the public surface is additive (fromPath and operator!=)

Compatibility

The public nodekit projection remains intact. This is stacked on coin3d#714 because it depends on the new full-path accessors and must not be reviewed as a duplicate of that PR.

@Dikluwe
Dikluwe force-pushed the fix/sonodekitpath-object-model-safety branch from cd9e740 to f3c72da Compare September 16, 2026 19:57
@Dikluwe

Dikluwe commented Sep 16, 2026

Copy link
Copy Markdown
Owner Author

Superseded by coin3d#747. The branch was rebased directly onto upstream master and the SoNodeKitPath fix is now independent from coin3d#714, so this stacked fork-only draft is no longer needed.

@Dikluwe Dikluwe closed this Sep 16, 2026
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.

2 participants