NatLabRockies / NatLabRockies/OpenStudio

Cloning a VersionTranslated HeatExchangerAirToAirSensibleAndLatent to another model causes a boost assert failure

Open
#5,239 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

component - HVAC component - Model
Dominant language
C++
Stars
646
Forks
237
Avg merge
3d 11h
Merged PRs (30d)
10

Description

Issue overview

Current Behavior

Seems like it's the combination of:

Expected Behavior

Should not crash

Steps to Reproduce

https://github.com/NREL/OpenStudio/blob/ba1b94b6542c1f1d4cdcdb775886852b9a82bc4f/src/osversion/test/3_8_0/test_vt_HeatExchangerAirToAirSensibleAndLatent.osm#L2

cd src/osversion/test/3_8_0/, then use the following ruby code

m = OpenStudio::Model::Model.load('test_vt_HeatExchangerAirToAirSensibleAndLatent.osm').get

[8] 3_8_0(main)> m2 = Model.new
=> #<OpenStudio::Model::Model:0x00007f367b2f4000 @__swigtype__="_p_openstudio__model__Model">
[9] 3_8_0(main)> erv = m.getZoneHVACEnergyRecoveryVentilators[0]
=> nil
[10] 3_8_0(main)> hx = m.getHeatExchangerAirToAirSensibleAndLatents.first
=> #<OpenStudio::Model::HeatExchangerAirToAirSensibleAndLatent:0x00007f367b2d4250 @__swigtype__="_p_openstudio__model__HeatExchangerAirToAirSensibleAndLatent">
[11] 3_8_0(main)> hx.clone(m2)
[utilities.idf.Workspace] <-1> Unable to add cloned objects to Workspace. The validity report is: 
The collection is INVALID at strictness level 'Draft', because of the errors:
Object     level data error of type NameConflict      .
Error pertains to an object of type 'OS:ModelObjectList', named 'ERV_IndependentVariableList'.
Additional information about the error type: two objects of the same type or with overlapping references also have the same name.
[BOOST_ASSERT] <2> Assertion it != m_targetData->reversePointers.end() failed on line 1024 of void openstudio::detail::WorkspaceObject_Impl::nullifyReversePointer(const Handle&, unsigned int) in file /srv/jenkins/openstudio/git/nightly/ubuntu_2004/Openstudio/src/utilities/idf/WorkspaceObject.cpp.
[BOOST_ASSERT] <2> Assertion it != m_targetData->reversePointers.end() failed on line 1024 of void openstudio::detail::WorkspaceObject_Impl::nullifyReversePointer(const Handle&, unsigned int) in file /srv/jenkins/openstudio/git/nightly/ubuntu_2004/Openstudio/src/utilities/idf/WorkspaceObject.cpp.

Possible Solution

Details

Environment

Some additional details about your environment for this issue (if relevant):

  • Platform (Operating system, version): All
  • Version of OpenStudio (if using an intermediate build, include SHA): 3.8.0
Context

This was reported on unmethours: https://unmethours.com/question/99873/adding-erv-crashes-openstudio-180-rc1/

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/osversion/test/3_8_0/ by loading test_vt_HeatExchangerAirToAirSensibleAndLatent.osm and reproducing hx.clone(m2) with the Ruby snippet. Read the referenced VersionTranslator.cpp section and the assertion location in src/utilities/idf/WorkspaceObject.cpp; done means cloning to another model completes without the NameConflict failure or BOOST_ASSERT.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.