-
Notifications
You must be signed in to change notification settings - Fork 216
Open
Description
Issue overview
Cloning a CoilCoolingDX crashes when it's cloned to another model.
Steps to Reproduce
m = Model.new
spd_1 = CoilCoolingDXCurveFitSpeed.new(m)
op_mode_base = CoilCoolingDXCurveFitOperatingMode.new(m)
performance_base = CoilCoolingDXCurveFitPerformance.new(m, op_mode_base)
cooling_coil_dx_1 = CoilCoolingDX.new(m, performance_base)
# Ok
cooling_coil_dx_1.clone(m)
m2 = Model.new
# Crash
cooling_coil_dx_1.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:Coil:Cooling:DX:CurveFit:OperatingMode', named 'Coil Cooling DX Curve Fit Operating Mode 1'.
Additional information about the error type: two objects of the same type or with overlapping references also have the same name.
[utilities.idf.Workspace] <1> Unable to add objectsToAdd and objectsToInsert to their own Workspace as an intermediate step.
[BOOST_ASSERT] <2> Assertion result.size() > 0u failed on line 602 of virtual openstudio::model::ModelObject openstudio::model::detail::ModelObject_Impl::clone(openstudio::model::Model) const in file /srv/jenkins/openstudio/git/nightly/ubuntu_2004/src/model/ModelObject.cpp.
[BOOST_ASSERT] <2> Assertion result.size() > 0u failed on line 602 of virtual openstudio::model::ModelObject openstudio::model::detail::ModelObject_Impl::clone(openstudio::model::Model) const in file /srv/jenkins/openstudio/git/nightly/ubuntu_2004/src/model/ModelObject.cpp.
(pry):8: [BUG] Segmentation fault at 0x0000000000000008
ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-linux]
-- Control frame information -----------------------------------------------
c:0026 p:---- s:0136 e:000135 CFUNC :clone
c:0025 p:0007 s:0131 e:000130 EVAL (pry):8 [FINISH]
c:0024 p:---- s:0128 e:000127 CFUNC :eval
c:0023 p:0042 s:0121 e:000120 METHOD /usr/share/rvm/gems/ruby-2.7.2/gems/pry-0.14.1/lib/pry/pry_instance.rb:290
c:0022 p:0240 s:0115 e:000114 METHOD /usr/share/rvm/gems/ruby-2.7.2/gems/pry-0.14.1/lib/pry/pry_instance.rb:659
c:0021 p:0010 s:0104 e:000103 BLOCK /usr/share/rvm/gems/ruby-2.7.2/gems/pry-0.14.1/lib/pry/pry_instance.rb:261 [FINISH]
Possible Solution
A double clone or mishandling of a required children is the likely cause.
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.3.0, current develop as well d75af8b
Context
Reported by @j-lorrey