-
Notifications
You must be signed in to change notification settings - Fork 391
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
Segfault with MoisturePenetrationDepth #10777
Comments
Backtrace:
|
Seems like @amirroth did a large refactor around that line: 268cdbb#diff-de4da079faf74cbae6f81f415fd5cdb57a88db449e51c118b2929b949be27517R257 |
If I'm reading correctly, you should just check if hasEMPD on the MaterialBase before trying to dynamic_cast it to the MaterialEMPD Material::MaterialBase const * base_mat = s_mat->materials(constr.LayerPoint(constr.TotLayers));
if (base_mat->hasEMPD()) {
auto const *mat = dynamic_cast<const MaterialEMPD *>(base_mat);
// ...
} That may not be the only issue though. |
Incidentally, this is happening for a Slab, which has zero EPMD layers on purpose, and the inner layer on which it throws is Material:NoMass.
The way the test file is prepared: Set the HBAlgorithm to MoisturePenetrationDepthConductionTransferFunction
Wall constructions get EMPDFor each Opaque layer in constructions used for Walls, create a |
Greetings, fellow |
Seems like the HeatTransferModel is an EMPD though? Because it's defaulted to that one, given that there is a high level EnergyPlus/src/EnergyPlus/SurfaceGeometry.cc Lines 8596 to 8597 in b422061
|
I see. I didn't realize that this is how things went. Seems silly, but I guess that's a separate discussion. Your suggested fix, i.e., to guard the first code block with |
Alright, so in the original code, there was this material member variable called In the input routine, it loops over all the "middle" layers to detect any EMPD layers. This would be an error condition if so. This loop uses the That member variable is defaulted to false. And ... never ... assigned. So even though that material does have EMPD props listed in the IDF, and even though there are EMPD physical properties assigned to that layer in memory, that little I am going to push up a PR that "fixes" it, but that test file will still fail gracefully, and should never have run. If I'm misunderstanding the EMPD limitations, someone please speak up. |
Original code produces this in the error file:
In the current develop it seg faults. With my fix to the seg fault, I get this:
I think this is the right move. I'm going to confirm tests pass and open a PR. |
Ok, so with the original test files, I now get that Fatal error message, no issue. I removed the MaterialProp:EMPD from the middle layer of one construction. and I get another segfault. The thing is that one of the two constructions is a symmetric inner wall construction:
|
It crashes here:
|
Here is the modified file: moisture_settings_osm2.idf.txt If I don't add an EMPD for the Inner wall construction, it fatals out because the Core zone has zero EMPD materials in the inside layer.
If I try to use two separate materials, it still crashes on line 524. |
I can look at this, but probably not until Wed. |
There's no rush. I don't think this object is being used much TBH. I'm just saying ideally we should fix it at some point, as a segfault isn't great. |
Issue overview
An OpenStudio-resources regression test that uses MoisturePenetrationDepth:
Version
object)Details
Some additional details for this issue (if relevant):
Checklist
Add to this list or remove from it as applicable. This is a simple templated set of guidelines.
The text was updated successfully, but these errors were encountered: