Skip to content
New issue

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

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

Already on GitHub? # to your account

App Crash During OSM File Save #59

Closed
eomere opened this issue Dec 10, 2019 · 9 comments
Closed

App Crash During OSM File Save #59

eomere opened this issue Dec 10, 2019 · 9 comments

Comments

@eomere
Copy link

eomere commented Dec 10, 2019

Seen On: Windows 10

Steps to Reproduce: Save OSM. Using File Explorer, Enter to the accompanying folder that is created due to the OSM save action. Return to the OS App and Save OSM again.

Observed Result: Unhandled Exception Message, then OS Crash.
OSM Save

Expected Result: OSM should save even when User is inside the accompanying folder that was generated from a previous Save.

Desired Action: Address App Crashing.

Reason to think this is a bug: This issue does not occur when the OS App is run within Linux. It also doesn't occur on other versions of OS that are run in Windows 10.

@jmarrec
Copy link
Collaborator

jmarrec commented Dec 11, 2019

Can you do me a favor and try in a different folder that doesn't include a space?

@jmarrec jmarrec added the Triage Issue needs to be assessed and labeled, further information on reported might be needed label Dec 11, 2019
@eomere
Copy link
Author

eomere commented Dec 13, 2019

I just did, and got the same error
OSM Save2

@jmarrec jmarrec added severity - Blocker 🚫 and removed Triage Issue needs to be assessed and labeled, further information on reported might be needed labels Dec 16, 2019
@jmarrec
Copy link
Collaborator

jmarrec commented Dec 16, 2019

I suspect this is pretty much the same issue as #21 (fixed via #34): mixed / and \ on windows are creating problems.
The reason why this happens here and not in OpenStudioApp 2.x is probably because we upgraded Qt and something changed there (though I am speculating, it is my best guess)

@jmarrec
Copy link
Collaborator

jmarrec commented Dec 16, 2019

Oh I probably read the description too quickly. THis happens only if you are inside the companion directory in File Explorer right?

@eomere
Copy link
Author

eomere commented Dec 16, 2019 via email

@jmarrec
Copy link
Collaborator

jmarrec commented Dec 16, 2019

I'm having trouble building OS App on Windows right now, but as soon as I fix the build error I'm confident I'll be able to reproduce now, thank you @eomere.

My guess is that it's happening here: https://github.com/NREL/OpenStudio/blob/2c4dd5c9d790d1e1a019b328ca06957660733478/src/model/FileOperations.cpp#L89:L148

Maybe a side effect of bumping from boost 1.55 to 1.69.

@jmarrec
Copy link
Collaborator

jmarrec commented Dec 16, 2019

Built and ran in Debug, confirmed that it crashes on https://github.com/NREL/OpenStudio/blob/2c4dd5c9d790d1e1a019b328ca06957660733478/src/model/FileOperations.cpp#L126

 	KernelBase.dll!00007ffc900da839()	Unknown
 	vcruntime140d.dll!00007ffc8bb982b0()	Unknown
 	OpenStudioApp.exe!boost::filesystem::detail::create_directory(const boost::filesystem::path & p, boost::system::error_code * ec) Line 1064	C++
 	OpenStudioApp.exe!boost::filesystem::create_directory(const boost::filesystem::path & p) Line 574	C++
>	OpenStudioApp.exe!openstudio::model::replaceDir(const boost::filesystem::path & sourceDir, const boost::filesystem::path & destinationDir) Line 126	C++
 	OpenStudioApp.exe!openstudio::model::saveModelTempDir(const boost::filesystem::path & modelTempDir, const boost::filesystem::path & osmPath) Line 363	C++
 	OpenStudioApp.exe!openstudio::model::saveModel(openstudio::model::Model model, const boost::filesystem::path & osmPath, const boost::filesystem::path & modelTempDir) Line 402	C++
 	OpenStudioApp.exe!openstudio::OSDocument::save() Line 1464	C++
 	OpenStudioApp.exe!QtPrivate::FunctorCall<QtPrivate::IndexesList<>,QtPrivate::List<>,void,bool (__cdecl openstudio::OSDocument::*)(void)>::call(bool(openstudio::OSDocument::*)() f, openstudio::OSDocument * o, void * * arg) Line 134	C++
 	OpenStudioApp.exe!QtPrivate::FunctionPointer<bool (__cdecl openstudio::OSDocument::*)(void)>::call<QtPrivate::List<>,void>(bool(openstudio::OSDocument::*)() f, openstudio::OSDocument * o, void * * arg) Line 168	C++
 	OpenStudioApp.exe!QtPrivate::QSlotObject<bool (__cdecl openstudio::OSDocument::*)(void),QtPrivate::List<>,void>::impl(int which, QtPrivate::QSlotObjectBase * this_, QObject * r, void * * a, bool * ret) Line 397	C++
 	[External Code]	
 	OpenStudioApp.exe!openstudio::MainWindow::saveFileClicked() Line 632	C++
 	OpenStudioApp.exe!QtPrivate::FunctorCall<QtPrivate::IndexesList<>,QtPrivate::List<>,void,void (__cdecl openstudio::MainWindow::*)(void)>::call(void(openstudio::MainWindow::*)() f, openstudio::MainWindow * o, void * * arg) Line 134	C++
 	OpenStudioApp.exe!QtPrivate::FunctionPointer<void (__cdecl openstudio::MainWindow::*)(void)>::call<QtPrivate::List<>,void>(void(openstudio::MainWindow::*)() f, openstudio::MainWindow * o, void * * arg) Line 168	C++
 	OpenStudioApp.exe!QtPrivate::QSlotObject<void (__cdecl openstudio::MainWindow::*)(void),QtPrivate::List<>,void>::impl(int which, QtPrivate::QSlotObjectBase * this_, QObject * r, void * * a, bool * ret) Line 397	C++
 	[External Code]	
 	OpenStudioApp.exe!openstudio::MainMenu::saveFileClicked() Line 562	C++
 	OpenStudioApp.exe!QtPrivate::FunctorCall<QtPrivate::IndexesList<>,QtPrivate::List<>,void,void (__cdecl openstudio::MainMenu::*)(void)>::call(void(openstudio::MainMenu::*)() f, openstudio::MainMenu * o, void * * arg) Line 134	C++
 	OpenStudioApp.exe!QtPrivate::FunctionPointer<void (__cdecl openstudio::MainMenu::*)(void)>::call<QtPrivate::List<>,void>(void(openstudio::MainMenu::*)() f, openstudio::MainMenu * o, void * * arg) Line 168	C++
 	OpenStudioApp.exe!QtPrivate::QSlotObject<void (__cdecl openstudio::MainMenu::*)(void),QtPrivate::List<>,void>::impl(int which, QtPrivate::QSlotObjectBase * this_, QObject * r, void * * a, bool * ret) Line 397	C++
 	[External Code]	
 	OpenStudioApp.exe!openstudio::OSAppBase::notify(QObject * receiver, QEvent * e) Line 84	C++
 	OpenStudioApp.exe!openstudio::OpenStudioApp::notify(QObject * receiver, QEvent * event) Line 1101	C++
 	[External Code]	
 	OpenStudioApp.exe!openstudio::OSAppBase::notify(QObject * receiver, QEvent * e) Line 84	C++
 	OpenStudioApp.exe!openstudio::OpenStudioApp::notify(QObject * receiver, QEvent * event) Line 1101	C++
 	[External Code]	
 	OpenStudioApp.exe!main(int argc, char * * argv) Line 249	C++
 	OpenStudioApp.exe!WinMain(HINSTANCE__ * __formal, HINSTANCE__ * __formal, char * __formal, int __formal) Line 104	C++

@jmarrec
Copy link
Collaborator

jmarrec commented Dec 16, 2019

From a convo with boost developers:

You cannot remove a directory with an open handle to anything inside it on Windows. Explorer having it or anything within it open means there is an open handle. I would expect Boost 1.55 was simply buggy.

I don't think we actually need to clean out the user directory, just delete / overwrite the files. I'll try that

@eomere
Copy link
Author

eomere commented May 19, 2020

Hi Julien, I'm still hitting this bug. Since it was filed during testing, would NREL release a fixed version of the App?

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

3 participants