FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
0024 — ConstraintSolver(double, CoreBoundThreadPool*) takes ownership through a raw pointer
ID 0024
Class API
Severity 1
Status blocked

Models: —

Found: 2026-10-24, feature coribo-fail-loudly (review doc/reviews/fhsim_coribo-2026-10-24, R8)

Decision needed: whether the constructor should take std::unique_ptr<CoreBoundThreadPool>. It is a signature change in the contract surface used by fhsim_marine_elements (ConstraintSolverSetup.cpp hands the pool over with release()).

Evidence

include/fhsim_coribo/ConstraintSolver.h: ConstraintSolver(double, CoreBoundThreadPool*); the destructor deletes the pool. A pool that is shared or on the stack is deleted twice or invalidly. The header now states the ownership (feature coribo-fail-loudly).

Effect

Misuse is a double delete; the only caller hands over ownership on purpose.

Possible fix

Take std::unique_ptr<CoreBoundThreadPool>; update ME in the same feature.

Test that would prove it

Compile-time: passing a raw pointer no longer compiles.

Risk

Cross-repo signature change.