openstudiocoalition / OpenStudioApplication

The OpenStudio Application is a fully featured graphical interface to OpenStudio models including envelope, loads, schedules, and HVAC.
https://openstudiocoalition.org
Other
135 stars 25 forks source link

OS App 1.2.1 crashing when running simulation or saving #466

Closed nsimhai closed 2 years ago

nsimhai commented 3 years ago

Continuation of https://unmethours.com/question/64303/os-app-121-crashing-when-running-simulation/ Attached v1-0 is the copy I am trying to fix, v0-28 is where the issue originally started @jmarrec

NV v0-28.zip NV v1-0.zip

jmarrec commented 3 years ago

Ubuntu 20.04, openstudioapplication-1.2.1: I can open, save and run your model just fine.

At what exact path on disk is your model located? (looking for something like C:\...\NV v1-0.osm). I'm basically trying to see if there's anything unusual in your path, such as if your windows username has special characters or whatever

nsimhai commented 3 years ago

Exact path is C:\Users\nsimhai\Desktop\New Vista OSMs

I have tried a few different filepaths and get the same result. The issue seems to start with the invalid weather file error, which I originally got after moving the OSM and its folder to a new computer via a flash drive. Here is the original version of that file, directly off the flash drive, maybe you can replicate the originating issue: NV v0-28.zip

I should also point out that if I open and try save one of those first files I sent, it will then result in OS crashing when I try to save any files, even OSMs totally different and unassociated with the problematic ones. The issue will persist until I restart my computer. I've tried deleting any lingering OpenStudio processes in task manager first, but the crashes still happen with any files.

nsimhai commented 3 years ago

I opened the v1-0 model in OS 1.2.1 on the old computer, and I did not have any of the issues I'm having on the new one. So it seems to possibly be an issue with the new PC?

Here are the specs on both

NEW (OS crashes): Latitude 5520 Processor 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz 1.69 GHz Installed RAM 16.0 GB (15.7 GB usable) System type 64-bit operating system, x64-based processor Edition Windows 10 Enterprise Version 21H1 Installed on ‎11/‎5/‎2021 OS build 19043.1288 Experience Windows Feature Experience Pack 120.2212.3920.0

OLD (OS does not crash): Latitude E5570 Processor Intel(R) Core(TM) i5-6300U CPU @ 2.40GHz 2.50 GHz Installed RAM 8.0 GB (7.9 GB usable) System type 64-bit operating system, x64-based processor Edition Windows 10 Pro Version 21H1 Installed on ‎10/‎19/‎2021 OS build 19043.1288 Experience Windows Feature Experience Pack 120.2212.3920.0

macumber commented 2 years ago

I was also able to run v0-28 on Windows 10. You have not upgraded to Windows 11 correct? Do you have any extra anti-virus or other software running on your new computer? Could you run through the steps in https://openstudiocoalition.org/getting_started/troubleshooting/ ? Sending us the output from running OS with OPENSTUDIO_APPLICATION_DEBUG=1 might be useful

macumber commented 2 years ago

I don't think this is a missing dll issue otherwise you would crash on startup or accessing a certain tab every time, it would not clear on a restart.

nsimhai commented 2 years ago

Yes, I am using Windows 10, on the version/build specified above. Our IT cannot think of any new software running on the new computer that was not on the old. It does not seem to have Dell Backup and Recovery installed.

Here is the debug log that results from launching the OS app, opening the file, and saving (which results in a crash). The log says it saved the model, and the modified date in windows explorer reflects that. But if I make a change before saving and reopen the file, the change will not be saved.

out.txt

macumber commented 2 years ago

Thanks @nsimhai, I don't see anything suspicious in that log. Do you think you could get a crash dump file and send it (it will be a large file so probably need to share on DropBox or something).

You can create a dump file from Task Manager when the OS App is running:

You can also edit the registry to create a dump file when OpenStudioApp.exe crashes:

nsimhai commented 2 years ago

Here is a link to the dump file for the OS app while running (shared with your gmail address). I wasn't able to create a dump file for the crash, but I added one that looks like it was created on its own a few days ago, presumably for another crash, so perhaps that will be helpful.

I have noticed in Task Manager, when the crash happens, that OpenStudioApp.exe will disappear, and openstudio.exe will remain. I manually kill openstudio.exe before trying again.

Also, I tested another computer, a newer Dell Latitude similar to the problematic one, and I am not having this issue on it. So it does seem to be limited to this one specific machine, but again, I can't find anything unique about it that would be the cause. This turned out not to be the case, I tried again today and got the same crashes on the second new Dell.

macumber commented 2 years ago

@nsimhai I can't download the crash dumps, can you make them public?

nsimhai commented 2 years ago

@macumber Try this one, expires in a few days: https://iconergyco.sharepoint.com/:u:/s/Projects/EXzh_bWd4z1LhNb5-POWeJABEEyunplzKApEZIBDKYVAWQ?e=Xq4CtX

macumber commented 2 years ago

Thanks @nsimhai. Your file with a crash was due to a 0xc0000005 error, I have seen that occur before. Maybe it's possible that your new computer is faster and the timing is resulting in more crashes. Other things you might try:

nsimhai commented 2 years ago

Thanks @macumber, I tried both of those suggestions but neither worked.

Turns out I need to use an older version of OS anyway in order to use certain measures. I installed OS v2.9 on the new laptop, but that one crashes as soon as I launch. Seems similar to or #3827 or #3879. I've disabled or uninstalled every non-critical thing I could find - OneDrive, every Dell utility, etc. but no luck on either version.

The solution to those appears to be upgrading to OS App v1.0+. Unfortunately, I don't think that is an option, as 1) the later versions have their own issues seen above, 2) I need the Xcel EDA measures which gave me an error when I ran them on OS App 1.2.1 (on the old computer). So current goal is to get 2.9 working on the new machine. Any thoughts?

macumber commented 2 years ago

Which measures are you trying to run? XcelEDAReportingandQAQC and XcelEDATariffSelectionandModelSetup? I tried running those with your model and it seems like most of the issues are just with updating enums to match new fuel type enums. Do you have a contact at Xcel? Perhaps it would be easiest and best to update those two measures? Sticking with OS 2.9.1 seems problematic to me.

macumber commented 2 years ago

I was able to get those two measures running with your model by 1) adding electricity use, 2) changing AdditionalFuel to Diesel, 3) adding model=nil to the arguments method signature, and 4) protecting against using nil values. If Xcel is interested in updating these measures I could help. If you provide a DropBox upload, I could send you my changed files.

nsimhai commented 2 years ago

Much appreciated @macumber, I sent a Dropbox link to your Gmail.

Agreed, at least for me in particular I would like to stick with 1.2.1, since I've already built a bunch of the model, and going backwards in versions seems like quite an ordeal. I have been talking to some of my coworkers, and they are able to run OS on Dell Precision laptops, so I am asking IT to switch me to one of those. So hopefully between that and the corrected measures I should be up and running.

nsimhai commented 2 years ago

@macumber your fixed measures seemed to work, thanks.

Back to the original crashing issue on 1.2.1, I have tried it on multiple different Dell model laptops with different hardware, and eventually they all suffer the same fate. Like I mentioned back in the original post, it does seem to start when issues with the weather file arise.

Sometimes I get this message when I open the model, but not always: image

Here is the file that caused that, I haven't saved or altered it after I got that message NV 1-7.zip

macumber commented 2 years ago

That is odd. The zip file you uploaded does not have the weather file in the files directory, that is why you are getting that issue. I don't know what could have caused that file to go missing? Could you open the About dialog, look at the details section, and see where the temp directory is located? If you go look at that directory and the one above it do you see anything odd?

image

macumber commented 2 years ago

I finally saw this tonight when using Address Sanitizer in release mode. When I opened the file, the weather file name was empty, I changed tabs and came back to see the weather file name filled in. I ran a simulation, went to the results page, and got a crash. All output attached

asan.out.txt

I think the address sanitizer found an issue in QtWebEngineProcess, I'm not sure that is the same crash reported here (which occurs on save)

macumber commented 2 years ago

File a new bug for the first tab issue with location data https://github.com/openstudiocoalition/OpenStudioApplication/issues/468

macumber commented 2 years ago

@nsimhai I have looked into this issue more today and I am thinking this seems likely to be an issue with your anti-virus scanning files and temporarily locking them. Something like https://www.bleepingcomputer.com/news/security/google-chrome-fixes-antivirus-file-locking-bug-on-windows-10/.

What anti-virus software(s) are you using? Is it possible to temporarily stop real time scanning or exclude scanning of C:/Users/nsimhai/AppData/Local/Temp/ and your model directory to if that fixes the issue?

Also can you check your Windows Defender settings? Are you using Controlled Folder Access, https://support.microsoft.com/en-us/windows/allow-an-app-to-access-controlled-folders-b5b6627a-b008-2ca2-7931-7e51e912b034? Any other settings in here https://windowsreport.com/fix-games-crash-windows-10/

macumber commented 2 years ago

If you have a chance to download this private build: https://github.com/openstudiocoalition/OpenStudioApplication/suites/4488242575/artifacts/119592613

You can re-run the following commands to generate a little more debugging information, this would help us confirm where the crash is occurring:

set OPENSTUDIO_APPLICATION_DEBUG=1
C:\openstudio-%VERSION%\bin\OpenStudioApp.exe > out.txt 2>&1
nsimhai commented 2 years ago

I finally saw this tonight when using Address Sanitizer in release mode. When I opened the file, the weather file name was empty, I changed tabs and came back to see the weather file name filled in. I ran a simulation, went to the results page, and got a crash. All output attached

@macumber Yes, this behavior definitely seems similar to what I've seen with the weather file.

What anti-virus software(s) are you using? Is it possible to temporarily stop real time scanning or exclude scanning of C:/Users/nsimhai/AppData/Local/Temp/ and your model directory to if that fixes the issue?

We are using Acronis Cyber Protect. I got with IT and turns out they were receiving some messages that it was blocking OpenStudio. I think your guess is correct, it's probably doing something similar to what's described in that link. I had IT exclude OpenStudioApp.exe, openstudio.exe, and the entire C:\openstudioapplication-1.2.1 from real-time protection. So far that seems to have prevented any more crashes. Though I can't say whether or not it affected the disappearing weather file.

macumber commented 2 years ago

Thanks for the feedback, it sounds like excluding OpenStudio from real-time protection might be working so far, let us know if that turns out to be incorrect. We are working on digitally signing our application for the next release, that might enable a higher level of trust with your anti-virus software.

I'll wait a few days and if we don't hear any updates from you, I will close this issue with the fix being to exclude the app from real time scanning.