-
Notifications
You must be signed in to change notification settings - Fork 192
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
Fix #4882 - Avoid a crash in createFluidProperties during FT that's due to Undefined Behavior #4884
Conversation
TEST_F(EnergyPlusFixture, ForwardTranslator_PlantLoop_createFluidProperties) { | ||
// test for #4482 - It crashes with 5 plantloops | ||
|
||
for (int n = 1; n <= 10; ++n) { | ||
Model m; | ||
|
||
for (int i = 0; i < n; ++i) { | ||
PlantLoop p(m); | ||
EXPECT_TRUE(p.setFluidType("PropyleneGlycol")); | ||
EXPECT_TRUE(p.setGlycolConcentration(50 + i)); | ||
} | ||
ForwardTranslator ft; | ||
// EXPECT_TRUE(false) << "Failed for " << n << " PlantLoops"; | ||
ASSERT_NO_THROW(ft.translateModel(m)) << "Failed for " << n << " PlantLoops"; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before fix it crashes at 5 PlantLoops
[ RUN ] EnergyPlusFixture.ForwardTranslator_PlantLoop_createFluidProperties
/Users/julien/Software/Others/OpenStudio/src/energyplus/Test/PlantLoop_GTest.cpp:186: Failure
Value of: false
Actual: false
Expected: true
Failed for 1 PlantLoops
/Users/julien/Software/Others/OpenStudio/src/energyplus/Test/PlantLoop_GTest.cpp:186: Failure
Value of: false
Actual: false
Expected: true
Failed for 2 PlantLoops
/Users/julien/Software/Others/OpenStudio/src/energyplus/Test/PlantLoop_GTest.cpp:186: Failure
Value of: false
Actual: false
Expected: true
Failed for 3 PlantLoops
/Users/julien/Software/Others/OpenStudio/src/energyplus/Test/PlantLoop_GTest.cpp:186: Failure
Value of: false
Actual: false
Expected: true
Failed for 4 PlantLoops
/Users/julien/Software/Others/OpenStudio/src/energyplus/Test/PlantLoop_GTest.cpp:186: Failure
Value of: false
Actual: false
Expected: true
Failed for 5 PlantLoops
[BOOST_ASSERT] <2> Assertion m_impl failed on line 2031 of openstudio::IdfObject::IdfObject(const openstudio::IdfObject &) in file /Users/julien/Software/Others/OpenStudio/src/utilities/idf/IdfObject.cpp.
Assertion failed: (false), function assertion_failed, file Assert.hpp, line 61.
0% tests passed, 1 tests failed out of 1
Total Test time (real) = 0.49 sec
The following tests FAILED:
2890 - EnergyPlusFixture.ForwardTranslator_PlantLoop_createFluidProperties (Subprocess aborted)
// NOTE: do not do another emplace_back before returning | ||
IdfObject& fluidPropName = m_idfObjects.emplace_back(openstudio::IddObjectType::FluidProperties_Name); | ||
fluidPropName.setString(FluidProperties_NameFields::FluidName, glycolName); | ||
fluidPropName.setString(FluidProperties_NameFields::FluidType, "Glycol"); | ||
|
||
return {fluidPropName}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix here
CI Results for 7386ea9:
|
I tested the Ubuntu 22.04 installer locally on WSL2, and it seems to correct the issue. |
Pull request overview
Pull Request Author
src/model/test
)src/energyplus/Test
)src/osversion/VersionTranslator.cpp
)Labels:
IDDChange
APIChange
Pull Request - Ready for CI
so that CI builds your PRReview Checklist
This will not be exhaustively relevant to every PR.