Skip to content

Fix #5665 - ForwardTranslator segfault for SetpointManager on HeatPumpAirToWaterHeating - #5669

Closed
PranaySiddharthBhange wants to merge 1 commit into
NatLabRockies:developfrom
PranaySiddharthBhange:fix/5665-forwardtranslator-segfault-heatpumpairtowater-setpoint
Closed

PranaySiddharthBhange wants to merge 1 commit into
NatLabRockies:developfrom
PranaySiddharthBhange:fix/5665-forwardtranslator-segfault-heatpumpairtowater-setpoint

Conversation

@PranaySiddharthBhange

Copy link
Copy Markdown

Pull request overview

ForwardTranslator segfaults when a SetpointManager is placed on the
outlet node of a HeatPumpAirToWaterHeating that is on a plant loop's
supply side.

Root cause

setpointComponents() replaced each on-loop component with
operationSchemeComponent(comp) before the caller looked up the loop
inlet/outlet nodes and flow rate against it. For components reported via
their containing component (eg: HeatPumpAirToWaterHeating ->
HeatPumpAirToWater), that container isn't itself on the plant loop's
supply branch, so supplyComponents() can't locate it and the
OS_ASSERT in inletNode/outletNode trips, segfaulting in Release
builds.

Fix

Keep the actual on-loop component for node/flowrate/componentType
lookups, and only switch to the containing component for IDF translation
and naming. Also turn the OS_ASSERT in inletNode/outletNode into a
boost::none return so any other case where the component isn't found
on the branch fails gracefully instead of crashing.

Pull Request Author

  • Model API Changes / Additions
  • Any new or modified fields have been implemented in the EnergyPlus ForwardTranslator (and ReverseTranslator as appropriate)
  • Model API methods are tested (in src/model/test)
  • EnergyPlus ForwardTranslator Tests (in src/energyplus/Test)
  • If a new object or method, added a test in NREL/OpenStudio-resources: Add Link
  • If needed, added VersionTranslation rules for the objects (src/osversion/VersionTranslator.cpp)
  • Verified that C# bindings built fine on Windows, partial classes used as needed, etc.
  • All new and existing tests passes
  • If methods have been deprecated, update rest of code to use the new methods

No API changes, no new/modified IDD fields, no VersionTranslation needed - this is a pure logic fix in the ForwardTranslator plus a regression test. Built locally (Conan2/CMake/Ninja, Release) and ran the full openstudio_energyplus_tests suite: 636/636 passed, no regressions. Did not build C# bindings locally.

…terHeating

setpointComponents() replaced each on-loop component with
operationSchemeComponent(comp) before inletNode/outletNode/flowrate were looked
up against it. For components reported via their containing component (eg:
HeatPumpAirToWaterHeating -> HeatPumpAirToWater), that container isn't itself
on the plant loop's supply branch, so supplyComponents() can't locate it and
the OS_ASSERT in inletNode/outletNode trips, segfaulting in Release builds.

Keep the on-loop component for node/flowrate/componentType lookups, and only
switch to the containing component for IDF translation and naming. Also turn
the OS_ASSERT in inletNode/outletNode into a boost::none return so any other
case where the component isn't found on the branch fails gracefully instead
of crashing.

Fixes NatLabRockies#5665
@PranaySiddharthBhange
PranaySiddharthBhange deleted the fix/5665-forwardtranslator-segfault-heatpumpairtowater-setpoint branch October 23, 2026 10:20
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.

ForwardTranslator segfaults when a SetpointManager is on a HeatPumpAirToWaterHeating outlet node

2 participants