Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App crashes when multiplying (cloning) Dual Duct AirLoopHVAC #217

Closed
Ski90Moo opened this issue Aug 19, 2020 · 5 comments
Closed

App crashes when multiplying (cloning) Dual Duct AirLoopHVAC #217

Ski90Moo opened this issue Aug 19, 2020 · 5 comments
Labels
component - Backend OpenStudio SDK Issue An issue that is not related to OpenStudioApplication but to NREL/OpenStudio SDK severity - Normal Bug 🐛

Comments

@Ski90Moo
Copy link

Issue overview

When attempting to use the x2 button on an air loop, the app crashes

Current Behavior

see gif:

mkDPjqFF7y

Expected Behavior

It should replicate the air loop.

Steps to Reproduce

  1. Create a dual duct air loop. No thermal zones added.
  2. Click the x2 button.

Possible Solution

Details

Environment Windows 10, App Version 1.01

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

  • Platform (Operating system, version):
  • Version of OpenStudioApplication (if using an intermediate build, include SHA):

Context

@Ski90Moo Ski90Moo added the Triage Issue needs to be assessed and labeled, further information on reported might be needed label Aug 19, 2020
@jmarrec
Copy link
Collaborator

jmarrec commented Aug 22, 2020

Worth noting that I can reproduce this with a dual duct air loop but NOT with a single duct airloop.

It does seem like a OSApp issue, since it works in the SDK bindings without crashing

[1] OSApp-build(main)> m = Model.new
=> #<OpenStudio::Model::Model:0x000056168ee431f8
 @__swigtype__="_p_openstudio__model__Model">
(reverse-i-search)`': 
[2] OSApp-build(main)> a = AirLoopHVAC.new(m, true)
=> #<OpenStudio::Model::AirLoopHVAC:0x00005616909d81c0
 @__swigtype__="_p_openstudio__model__AirLoopHVAC">
[3] OSApp-build(main)> a.clone(m)
[utilities.idf.Workspace] <-1> Renamed Object of type 'OS:AirLoopHVAC' and named 'Air Loop HVAC 1' to 'Air Loop HVAC 2' to avoid a name conflict upon WorkspaceObject addition.
[utilities.idf.Workspace] <-1> Renamed Object of type 'OS:Schedule:Constant' and named 'Always On Discrete' to 'Always On Discrete 1' to avoid a name conflict upon WorkspaceObject addition.
[utilities.idf.Workspace] <-1> Renamed Object of type 'OS:Connector:Splitter' and named 'Connector Splitter 1' to 'Connector Splitter 2' to avoid a name conflict upon WorkspaceObject addition.
=> #<OpenStudio::Model::ModelObject:0x000056169027f3b0
 @__swigtype__="_p_openstudio__model__ModelObject">

@jmarrec jmarrec added component - Backend severity - Normal Bug 🐛 and removed Triage Issue needs to be assessed and labeled, further information on reported might be needed labels Aug 22, 2020
@eringold
Copy link
Contributor

eringold commented Aug 23, 2020

@jmarrec I noticed that cloning the dual duct loop results in some dangling nodes, which I think the App has problems displaying (but OpenStudio translates just fine):

irb(main):002:0> m = OpenStudio::Model::Model.new
=> #<OpenStudio::Model::Model:0x00000007571e38 @__swigtype__="_p_openstudio__model__Model">
irb(main):003:0> a = OpenStudio::Model::AirLoopHVAC.new(m,true)
=> #<OpenStudio::Model::AirLoopHVAC:0x000000074218d0 @__swigtype__="_p_openstudio__model__AirLoopHVAC">
irb(main):004:0> m.getStraightComponents.select {|c| c.inletModelObject.empty? || c.outletModelObject.empty?}.size
0
=> nil
irb(main):005:0> a.clone(m)
=> #<OpenStudio::Model::ModelObject:0x00000006e195c8 @__swigtype__="_p_openstudio__model__ModelObject">
irb(main):006:0> m.getStraightComponents.select {|c| c.inletModelObject.empty? || c.outletModelObject.empty?}.size
3
=> nil
irb(main):007:0> m.getStraightComponents.select {|c| c.inletModelObject.empty? || c.outletModelObject.empty?}.each {|n| puts n.name.get}
Node 1
Node 2
Node 6
OS:Node,
  {47b87830-7e6d-4b05-a7ea-d7800a44216e}, !- Handle
  Node 1,                                 !- Name
  {6da76a94-e75f-4db2-9813-9894270d11f1}, !- Inlet Port
  ;                                       !- Outlet Port

OS:Node,
  {ea5a5977-a141-4dda-ac95-ea8c67a470ad}, !- Handle
  Node 2,                                 !- Name
  ,                                       !- Inlet Port
  {ff8bffcf-8881-4624-9821-da06d2560095}; !- Outlet Port

OS:Node,
  {ccf05e5f-853e-4ba9-88c5-27a849189c6d}, !- Handle
  Node 6,                                 !- Name
  ,                                       !- Inlet Port
  {a6be0595-fea9-4543-8829-11dd03fec248}; !- Outlet Port

=> nil

@jmarrec jmarrec changed the title App crashes when multiplying air loops App crashes when multiplying (cloning) Dual Duct AirLoopHVAC Aug 24, 2020
@jmarrec
Copy link
Collaborator

jmarrec commented Aug 24, 2020

Backtrace:

[utilities.idf.Workspace] <-1> Renamed Object of type 'OS:AirLoopHVAC' and named 'Air Loop HVAC 1' to 'Air Loop HVAC 2' to avoid a name conflict upon WorkspaceObject addition.
[utilities.idf.Workspace] <-1> Renamed Object of type 'OS:Schedule:Constant' and named 'Always On Discrete' to 'Always On Discrete 1' to avoid a name conflict upon WorkspaceObject addition.
[utilities.idf.Workspace] <-1> Renamed Object of type 'OS:Connector:Splitter' and named 'Connector Splitter 1' to 'Connector Splitter 2' to avoid a name conflict upon WorkspaceObject addition.
OpenStudioApp: /home/julien/.conan/data/boost/1.73.0/_/_/package/98840bee667d85752087af56a9d418e93e4c8027/include/boost/optional/optional.hpp:1212: boost::optional<T>::reference_type boost::optional<T>::get() [with T = openstudio::model::Loop; boost::optional<T>::reference_type = openstudio::model::Loop&]: Assertion `this->is_initialized()' failed.
Process 1249 stopped
* thread #1, name = 'OpenStudioApp', stop reason = hit program assert
    frame #4: 0x0000555555e8ccb3 OpenStudioApp`boost::optional<openstudio::model::Loop>::get(this=0x00007fffffffacf0) at optional.hpp:1212
   1209	    // the behaviour is UNDEFINED
   1210	    // No-throw
   1211	    reference_const_type get() const { BOOST_ASSERT(this->is_initialized()) ; return this->get_impl(); }
-> 1212	    reference_type       get()       { BOOST_ASSERT(this->is_initialized()) ; return this->get_impl(); }
   1213	
   1214	    // Returns a copy of the value if this is initialized, 'v' otherwise
   1215	    reference_const_type get_value_or ( reference_const_type v ) const { return this->is_initialized() ? get() : v ; }
(lldb) bt
* thread #1, name = 'OpenStudioApp', stop reason = hit program assert
    frame #0: 0x00007fffee2eaf47 libc.so.6`__GI_raise(sig=<unavailable>) at raise.c:51
    frame #1: 0x00007fffee2ec8b1 libc.so.6`__GI_abort at abort.c:79
    frame #2: 0x00007fffee2dc42a libc.so.6`__assert_fail_base(fmt="%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion="this->is_initialized()", file="/home/julien/.conan/data/boost/1.73.0/_/_/package/98840bee667d85752087af56a9d418e93e4c8027/include/boost/optional/optional.hpp", line=1212, function="boost::optional<T>::reference_type boost::optional<T>::get() [with T = openstudio::model::Loop; boost::optional<T>::reference_type = openstudio::model::Loop&]") at assert.c:92
    frame #3: 0x00007fffee2dc4a2 libc.so.6`__GI___assert_fail(assertion=<unavailable>, file=<unavailable>, line=<unavailable>, function=<unavailable>) at assert.c:101
  * frame #4: 0x0000555555e8ccb3 OpenStudioApp`boost::optional<openstudio::model::Loop>::get(this=0x00007fffffffacf0) at optional.hpp:1212
    frame #5: 0x0000555555e859b4 OpenStudioApp`openstudio::SupplySideItem::SupplySideItem(this=0x0000555557b34040, parent=0x0000555557aa83c0, supplyInletNode=Node @ 0x00007fffffffae70, supplyOutletNodes=size=2) at GridItem.cpp:2947
    frame #6: 0x0000555555e73ed9 OpenStudioApp`openstudio::SystemItem::SystemItem(this=0x0000555557aa83b0, loop=Loop @ 0x00007fffffffafa0, loopScene=0x0000555557fd9950) at GridItem.cpp:1180
    frame #7: 0x0000555555edddc5 OpenStudioApp`openstudio::LoopScene::layout(this=0x0000555557fd9950) at LoopScene.cpp:81
    frame #8: 0x000055555601a930 OpenStudioApp`openstudio::LoopScene::qt_static_metacall(_o=0x0000555557fd9950, _c=InvokeMetaMethod, _id=2, _a=0x00005555598ce4d0) at moc_LoopScene.cxx:89
    frame #9: 0x00007fffef2dfc12 libQt5Core.so.5`QObject::event(QEvent*) + 226
    frame #10: 0x00007fffeffcb95b libQt5Widgets.so.5`QGraphicsScene::event(QEvent*) + 1243
    frame #11: 0x00007fffefcb749c libQt5Widgets.so.5`QApplicationPrivate::notify_helper(QObject*, QEvent*) + 156
    frame #12: 0x00007fffefcbea6f libQt5Widgets.so.5`QApplication::notify(QObject*, QEvent*) + 751
    frame #13: 0x000055555598f63d OpenStudioApp`openstudio::OSAppBase::notify(this=0x00007fffffffc010, receiver=0x0000555557fd9950, e=0x000055555994ad70) at OSAppBase.cpp:78
    frame #14: 0x0000555555964524 OpenStudioApp`openstudio::OpenStudioApp::notify(this=0x00007fffffffc010, receiver=0x0000555557fd9950, event=0x000055555994ad70) at OpenStudioApp.cpp:1073
    frame #15: 0x00007fffef2b0008 libQt5Core.so.5`QCoreApplication::notifyInternal2(QObject*, QEvent*) + 280
    frame #16: 0x00007fffef2b2b4d libQt5Core.so.5`QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) + 429
    frame #17: 0x00007fffef30aa23 libQt5Core.so.5`___lldb_unnamed_symbol2507$$libQt5Core.so.5 + 19
    frame #18: 0x00007fffe5b82417 libglib-2.0.so.0`g_main_context_dispatch + 743
    frame #19: 0x00007fffe5b82650 libglib-2.0.so.0`___lldb_unnamed_symbol192$$libglib-2.0.so.0 + 512
    frame #20: 0x00007fffe5b826dc libglib-2.0.so.0`g_main_context_iteration + 44
    frame #21: 0x00007fffef30a05f libQt5Core.so.5`QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) + 95
    frame #22: 0x00007fffde538981 libQt5XcbQpa.so.5`___lldb_unnamed_symbol1476$$libQt5XcbQpa.so.5 + 17
    frame #23: 0x0000555555ea7e4e OpenStudioApp`openstudio::HVACSystemsController::update(this=0x0000555557911240) at HVACSystemsController.cpp:336
    frame #24: 0x0000555555dc1ada OpenStudioApp`openstudio::HVACSystemsController::qt_static_metacall(_o=0x0000555557911240, _c=InvokeMetaMethod, _id=2, _a=0x00005555580aefa0) at moc_HVACSystemsController.cxx:142
    frame #25: 0x00007fffef2dfc12 libQt5Core.so.5`QObject::event(QEvent*) + 226
    frame #26: 0x00007fffefcb749c libQt5Widgets.so.5`QApplicationPrivate::notify_helper(QObject*, QEvent*) + 156
    frame #27: 0x00007fffefcbea6f libQt5Widgets.so.5`QApplication::notify(QObject*, QEvent*) + 751
    frame #28: 0x000055555598f63d OpenStudioApp`openstudio::OSAppBase::notify(this=0x00007fffffffc010, receiver=0x0000555557911240, e=0x00007fffd0018bf0) at OSAppBase.cpp:78
    frame #29: 0x0000555555964524 OpenStudioApp`openstudio::OpenStudioApp::notify(this=0x00007fffffffc010, receiver=0x0000555557911240, event=0x00007fffd0018bf0) at OpenStudioApp.cpp:1073
    frame #30: 0x00007fffef2b0008 libQt5Core.so.5`QCoreApplication::notifyInternal2(QObject*, QEvent*) + 280
    frame #31: 0x00007fffef2b2b4d libQt5Core.so.5`QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) + 429
    frame #32: 0x00007fffef30aa23 libQt5Core.so.5`___lldb_unnamed_symbol2507$$libQt5Core.so.5 + 19
    frame #33: 0x00007fffe5b82417 libglib-2.0.so.0`g_main_context_dispatch + 743
    frame #34: 0x00007fffe5b82650 libglib-2.0.so.0`___lldb_unnamed_symbol192$$libglib-2.0.so.0 + 512
    frame #35: 0x00007fffe5b826dc libglib-2.0.so.0`g_main_context_iteration + 44
    frame #36: 0x00007fffef30a05f libQt5Core.so.5`QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) + 95
    frame #37: 0x00007fffde538981 libQt5XcbQpa.so.5`___lldb_unnamed_symbol1476$$libQt5XcbQpa.so.5 + 17
    frame #38: 0x00007fffef2ae32a libQt5Core.so.5`QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) + 314
    frame #39: 0x00007fffef2b74f0 libQt5Core.so.5`QCoreApplication::exec() + 144
    frame #40: 0x0000555555956f17 OpenStudioApp`main(argc=1, argv=0x00007fffffffc298) at main.cpp:234
    frame #41: 0x00007fffee2cdb97 libc.so.6`__libc_start_main(main=(OpenStudioApp`main at main.cpp:119), argc=1, argv=0x00007fffffffc298, init=<unavailable>, fini=<unavailable>, rtld_fini=<unavailable>, stack_end=0x00007fffffffc288) at libc-start.c:310
    frame #42: 0x000055555595611a OpenStudioApp`_start + 42
(lldb) 

@jmarrec jmarrec added the OpenStudio SDK Issue An issue that is not related to OpenStudioApplication but to NREL/OpenStudio SDK label Aug 28, 2020
@jmarrec
Copy link
Collaborator

jmarrec commented Aug 28, 2020

Moved to NREL/OpenStudio#4060 as it should. Leaving open until we can test in App that there isn't something else to be done.

@jmarrec
Copy link
Collaborator

jmarrec commented Aug 28, 2020

Thanks for looking into this @eringold

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component - Backend OpenStudio SDK Issue An issue that is not related to OpenStudioApplication but to NREL/OpenStudio SDK severity - Normal Bug 🐛
Projects
None yet
Development

No branches or pull requests

3 participants