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

Schedules Sub-tab causing App to Crash #57

Closed
eomere opened this issue Dec 6, 2019 · 5 comments · Fixed by #61
Closed

Schedules Sub-tab causing App to Crash #57

eomere opened this issue Dec 6, 2019 · 5 comments · Fixed by #61

Comments

@eomere
Copy link

eomere commented Dec 6, 2019

Seen On: Windows 10

Steps to Reproduce: Generate a Prototype Building using the using the "Create DOE Prototype Building" OR "Create DEER Prototype Building ALPHA Version" Measure. Go to the Schedules Resource. Go to the Schedule Sub-tab.

Observed Result: Error Message, then OS Crash
Sub-tabs - Schedules Resource

Expected Result: Access the Schedule Sub-tab within the Schedules Resource.

Desired Action: Address App Crashing

Reason to think this is a bug: App should not be crashing upon GUI interaction.

NB: OSMs for some buildings that were not generated using Measures exhibit the same behavior. I have posted an example of a manually generated OSM that you can access via Dropbox

@jmarrec
Copy link
Collaborator

jmarrec commented Dec 10, 2019

@eomere Thanks for the feedback. I was able to reproduce the crash with your dropboxed file, and to isolate the problem.

MCVE:

include OpenStudio::Model
m = Model.new
sch_type_lim = ScheduleTypeLimits.new(m)
sch_type_lim.setUnitType("Velocity")
siUnits = sch_type_lim.units(false).get
q = OpenStudio::Quantity.new(1, siUnits)
quantities = OpenStudio::OSQuantityVector.new()
quantities.push_back(q)

[openstudio.units.OSQuantityVector] <2> Quantity 1 m/s is incompatible with this OSQuantityVector, which has units .
RuntimeError: /home/julien/Software/Others/OpenStudioApplication/openstudio/src/utilities/units/OSQuantityVector.cpp@157 : Quantity 1 m/s is incompatible with this OSQuantityVector, which has units .

Interestingly I can produce the same crash using 2.9.1 in ruby, but the OS App in 2.9.1 won't crash because of it...

@jmarrec
Copy link
Collaborator

jmarrec commented Dec 10, 2019

Trackback of the crash (at frame 12, schedule is "Air Velocity Schedule")

[openstudio.units.OSQuantityVector] <2> Quantity 39.3701 ft/min is incompatible with this OSQuantityVector, which has units .
terminate called after throwing an instance of 'openstudio::Exception'
  what():  /home/julien/Software/Others/OpenStudioApplication/openstudio/src/utilities/units/OSQuantityVector.cpp@157 : Quantity 39.3701 ft/min is incompatible with this OSQuantityVector, which has units .
Process 27757 stopped
* thread #1, name = 'OpenStudioApp', stop reason = signal SIGABRT
    frame #0: 0x00007ffff5992e97 libc.so.6`__GI_raise(sig=2) at raise.c:51
(lldb) bt
error: OpenStudioApp :: Class 'OSQObjectController' has a base class 'QObject' which does not have a complete definition.
error: OpenStudioApp :: Class 'MainTabView' has a base class 'QWidget' which does not have a complete definition.
* thread #1, name = 'OpenStudioApp', stop reason = signal SIGABRT
  * frame #0: 0x00007ffff5992e97 libc.so.6`__GI_raise(sig=2) at raise.c:51
    frame #1: 0x00007ffff5994801 libc.so.6`__GI_abort at abort.c:79
    frame #2: 0x00007ffff6387957 libstdc++.so.6`___lldb_unnamed_symbol24$$libstdc++.so.6 + 89
    frame #3: 0x00007ffff638dab6 libstdc++.so.6`___lldb_unnamed_symbol287$$libstdc++.so.6 + 6
    frame #4: 0x00007ffff638daf1 libstdc++.so.6`std::terminate() + 17
    frame #5: 0x00007ffff638dd24 libstdc++.so.6`__cxa_throw + 68
    frame #6: 0x0000555557a50d90 OpenStudioApp`openstudio::OSQuantityVector::push_back(this=0x00007fffffffb040, q=Quantity @ 0x00007fffffffb010) at OSQuantityVector.cpp:156
    frame #7: 0x0000555555a60b33 OpenStudioApp`openstudio::DayScheduleScene::refresh(this=0x000055555c480c10) at ScheduleDayView.cpp:2043
    frame #8: 0x0000555555a60708 OpenStudioApp`openstudio::DayScheduleScene::DayScheduleScene(this=0x000055555c480c10, scheduleDayView=0x000055555c466050, scheduleDay=0x000055555c4660b8) at ScheduleDayView.cpp:1999
    frame #9: 0x0000555555a5855f OpenStudioApp`openstudio::ScheduleDayView::ScheduleDayView(this=0x000055555c466050, isIP=true, scheduleDay=0x00007fffffffb3c0, schedulesView=0x000055555c213070) at ScheduleDayView.cpp:120
    frame #10: 0x0000555555894d78 OpenStudioApp`openstudio::DefaultScheduleDayView::DefaultScheduleDayView(this=0x000055555c2f3170, isIP=true, scheduleRuleset=0x000055555b2aef98, schedulesView=0x000055555c213070) at SchedulesView.cpp:1515
    frame #11: 0x000055555588ef9f OpenStudioApp`openstudio::SchedulesView::showDefaultScheduleDay(this=0x000055555c213070, schedule=0x000055555b2aef98) at SchedulesView.cpp:498
    frame #12: 0x000055555588e827 OpenStudioApp`openstudio::SchedulesView::setCurrentSchedule(this=0x000055555c213070, schedule=0x000055555b2aef98) at SchedulesView.cpp:407
    frame #13: 0x000055555588d88a OpenStudioApp`openstudio::SchedulesView::SchedulesView(this=0x000055555c213070, isIP=true, model=0x000055555b198260) at SchedulesView.cpp:213
    frame #14: 0x0000555555884ed1 OpenStudioApp`openstudio::SchedulesTabController::setSubTab(this=0x000055555b198220, index=1) at SchedulesTabController.cpp:497
    frame #15: 0x000055555588b690 OpenStudioApp`QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<int>, void, void (openstudio::SchedulesTabController::*)(int)>::call(f=61 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00, o=0x000055555b198220, arg=0x00007fffffffbdc0)(int), openstudio::SchedulesTabController*, void**) at qobjectdefs_impl.h:134
    frame #16: 0x000055555588aab8 OpenStudioApp`void QtPrivate::FunctionPointer<void (openstudio::SchedulesTabController::*)(int)>::call<QtPrivate::List<int>, void>(f=61 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00, o=0x000055555b198220, arg=0x00007fffffffbdc0)(int), openstudio::SchedulesTabController*, void**) at qobjectdefs_impl.h:167
    frame #17: 0x000055555588931a OpenStudioApp`QtPrivate::QSlotObject<void (openstudio::SchedulesTabController::*)(int), QtPrivate::List<int>, void>::impl(which=1, this_=0x000055555b289230, r=0x000055555b198220, a=0x00007fffffffbdc0, ret=0x0000000000000000) at qobjectdefs_impl.h:396
    frame #18: 0x00007ffff693c1bf libQt5Core.so.5`QMetaObject::activate(QObject*, int, int, void**) + 2431
    frame #19: 0x000055555598b241 OpenStudioApp`openstudio::MainTabView::tabSelected(this=0x000055555ae19dc0, _t1=1) at moc_MainTabView.cxx:151
    frame #20: 0x0000555555a36944 OpenStudioApp`openstudio::MainTabView::setCurrentIndex(this=0x000055555ae19dc0, index=1) at MainTabView.cpp:228
    frame #21: 0x0000555555a36615 OpenStudioApp`openstudio::MainTabView::select(this=0x000055555ae19dc0) at MainTabView.cpp:176
    frame #22: 0x0000555555a36fa7 OpenStudioApp`QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, void (openstudio::MainTabView::*)()>::call(f=5a 65 a3 55 55 55 00 00 00 00 00 00 00 00 00 00, o=0x000055555ae19dc0, arg=0x00007fffffffc070)(), openstudio::MainTabView*, void**) at qobjectdefs_impl.h:134
    frame #23: 0x0000555555a36f2a OpenStudioApp`void QtPrivate::FunctionPointer<void (openstudio::MainTabView::*)()>::call<QtPrivate::List<>, void>(f=5a 65 a3 55 55 55 00 00 00 00 00 00 00 00 00 00, o=0x000055555ae19dc0, arg=0x00007fffffffc070)(), openstudio::MainTabView*, void**) at qobjectdefs_impl.h:167
    frame #24: 0x0000555555a36e94 OpenStudioApp`QtPrivate::QSlotObject<void (openstudio::MainTabView::*)(), QtPrivate::List<>, void>::impl(which=1, this_=0x000055555b2934f0, r=0x000055555ae19dc0, a=0x00007fffffffc070, ret=0x0000000000000000) at qobjectdefs_impl.h:396
    frame #25: 0x00007ffff693c1bf libQt5Core.so.5`QMetaObject::activate(QObject*, int, int, void**) + 2431
    frame #26: 0x00007ffff73f9672 libQt5Widgets.so.5`QAbstractButton::clicked(bool) + 66
    frame #27: 0x00007ffff73f988a libQt5Widgets.so.5`___lldb_unnamed_symbol1091$$libQt5Widgets.so.5 + 58
    frame #28: 0x00007ffff73fac6a libQt5Widgets.so.5`___lldb_unnamed_symbol1097$$libQt5Widgets.so.5 + 186
    frame #29: 0x00007ffff73fae5d libQt5Widgets.so.5`QAbstractButton::mouseReleaseEvent(QMouseEvent*) + 253
    frame #30: 0x00007ffff7353128 libQt5Widgets.so.5`QWidget::event(QEvent*) + 504
    frame #31: 0x00007ffff731449c libQt5Widgets.so.5`QApplicationPrivate::notify_helper(QObject*, QEvent*) + 156
    frame #32: 0x00007ffff731c607 libQt5Widgets.so.5`QApplication::notify(QObject*, QEvent*) + 3719
    frame #33: 0x0000555555844711 OpenStudioApp`openstudio::OSAppBase::notify(this=0x00007fffffffcd70, receiver=0x000055555b3d5230, e=0x00007fffffffc5a0) at OSAppBase.cpp:83
    frame #34: 0x000055555581a7f8 OpenStudioApp`openstudio::OpenStudioApp::notify(this=0x00007fffffffcd70, receiver=0x000055555b3d5230, event=0x00007fffffffc5a0) at OpenStudioApp.cpp:1017
    frame #35: 0x00007ffff690d008 libQt5Core.so.5`QCoreApplication::notifyInternal2(QObject*, QEvent*) + 280
    frame #36: 0x00007ffff731af52 libQt5Widgets.so.5`QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) + 466
    frame #37: 0x00007ffff736e2b3 libQt5Widgets.so.5`___lldb_unnamed_symbol546$$libQt5Widgets.so.5 + 1603
    frame #38: 0x00007ffff73708c9 libQt5Widgets.so.5`___lldb_unnamed_symbol555$$libQt5Widgets.so.5 + 809
    frame #39: 0x00007ffff731449c libQt5Widgets.so.5`QApplicationPrivate::notify_helper(QObject*, QEvent*) + 156
    frame #40: 0x00007ffff731ba6f libQt5Widgets.so.5`QApplication::notify(QObject*, QEvent*) + 751
    frame #41: 0x0000555555844711 OpenStudioApp`openstudio::OSAppBase::notify(this=0x00007fffffffcd70, receiver=0x000055555b490160, e=0x00007fffffffca20) at OSAppBase.cpp:83
    frame #42: 0x000055555581a7f8 OpenStudioApp`openstudio::OpenStudioApp::notify(this=0x00007fffffffcd70, receiver=0x000055555b490160, event=0x00007fffffffca20) at OpenStudioApp.cpp:1017
    frame #43: 0x00007ffff690d008 libQt5Core.so.5`QCoreApplication::notifyInternal2(QObject*, QEvent*) + 280
    frame #44: 0x00007ffff6d09adb libQt5Gui.so.5`QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) + 2347
    frame #45: 0x00007ffff6d0b655 libQt5Gui.so.5`QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) + 309
    frame #46: 0x00007ffff6ce42cb libQt5Gui.so.5`QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) + 171
    frame #47: 0x00007fffe550b98b libQt5XcbQpa.so.5`___lldb_unnamed_symbol1476$$libQt5XcbQpa.so.5 + 27
    frame #48: 0x00007ffff690b32a libQt5Core.so.5`QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) + 314
    frame #49: 0x00007ffff69144f0 libQt5Core.so.5`QCoreApplication::exec() + 144
    frame #50: 0x000055555580eafa OpenStudioApp`main(argc=1, argv=0x00007fffffffcff8) at main.cpp:249
    frame #51: 0x00007ffff5975b97 libc.so.6`__libc_start_main(main=(OpenStudioApp`main at main.cpp:122), argc=1, argv=0x00007fffffffcff8, init=<unavailable>, fini=<unavailable>, rtld_fini=<unavailable>, stack_end=0x00007fffffffcfe8) at libc-start.c:310
    frame #52: 0x000055555580dd7a OpenStudioApp`_start + 42

@eomere
Copy link
Author

eomere commented Dec 10, 2019 via email

@jmarrec
Copy link
Collaborator

jmarrec commented Dec 11, 2019

I'm pretty sure something changed in the way OS_ASSERT works. I think these aren't effective when built in Release mode using develop but they seem to be effective in Release here.

@jmarrec
Copy link
Collaborator

jmarrec commented Dec 11, 2019

Nope, this is not it. I didn't isolate the problem correctly. This happens because of a change I introduced in d35baa7 when we started develop3 and removed Quantities from the model API. ScheduleDay::getValues(bool isIP) was removed from the API as a result, so the conversion had to be moved to OpenStudioApplication.

This line is the problem:

https://github.com/NREL/OpenStudioApplication/blob/04c47eab982efc2384492322acee29292b278cd5/src/openstudio_lib/ScheduleDayView.cpp#L2037

The OSQuantityVector should be initialized with _toUnits.get(). I'll try that, double check it fixes it and then open a PR.

jmarrec added a commit that referenced this issue Dec 11, 2019
@jmarrec jmarrec added this to the Prerelease 1 milestone Dec 11, 2019
@jmarrec jmarrec self-assigned this Dec 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants