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

idf file causing segfault and mirrors of nonconvex shading surfaces are classified as convex #10490

Open
1 of 3 tasks
marklemay opened this issue May 2, 2024 · 3 comments · May be fixed by #10498
Open
1 of 3 tasks

Comments

@marklemay
Copy link
Contributor

marklemay commented May 2, 2024

Issue overview

This idf file causes a segfualt. It is likely there is bad geometry in the file, but this should be reported through the eplusout.err and not a crash.

The file may be failing the assert at: src\EnergyPlus\DataSurfaces.cc, line 183. But this should be confirmed.

Details

Some additional details for this issue (if relevant):

  • Platform: Windows
  • Version of EnergyPlus: 23.1.0-87ed9199d4 (also think it happens with 24.1.0-1c07712767)
  • Unmethours link or helpdesk ticket number

Checklist

Add to this list or remove from it as applicable. This is a simple templated set of guidelines.

  • Defect file: in.zip
  • Ticket added to Pivotal for defect (development team task)
  • Pull request created (the pull request will have additional tasks related to reviewing changes that fix this defect)
@marklemay
Copy link
Contributor Author

@MatthewSteen this is the issue we were discussing earlier.

@mjwitte
Copy link
Contributor

mjwitte commented May 2, 2024

@marklemay Yes, it is failing at that assert (when running a debug build). The surface that it's failing on appears to be Mir-AIM108660 which is the mirror of AIM108660 a shading surface with 24 vertices.

I see why it's failing the assert. The surface is convex with 24 vertices, so it falls into this block:

} else if ((shapeCat == ShapeCat::Nonconvex) || (n >= nVerticesBig)) { // Set up slabs

It goes through some gymnastics and fails here, because crossEdges.size()=4.

assert((shapeCat == ShapeCat::Nonconvex) || (crossEdges.size() == 2));

For reference:

// Parameters for PierceSurface
constexpr std::size_t nVerticesBig(20); // Number of convex surface vertices at which to switch to PierceSurface O( log N ) method

However, deleting all of the shading surfaces with >=20 vertices doesn't solve the crash (for release builds).

@mjwitte
Copy link
Contributor

mjwitte commented May 2, 2024

The root of the segfault problem is here:

if (state.dataHeatBalSurf->InterZoneWindow) {
if (state.dataHeatBalSurfMgr->InitSurfaceHeatBalancefirstTime) {
DisplayString(state, "Computing Interior Diffuse Solar Exchange through Interzone Windows");
}
ComputeDifSolExcZonesWIZWindows(state, state.dataGlobal->NumOfZones);
}

The second argument should be state.dataViewFactor->NumOfSolarEnclosures which is 363 for this file, not NumOfZones which is 115 for this file. This argument is used to size some arrays that are only used for interzone windows and this results in an array bounds error later on.

So, there are actually two issues here:

  1. The surface geometry problem that fails the assert.
  2. The array size problem for models with interzone (or interspace) windows where NumZones < NumOfSolarEnclosures.

If the interior window(s) are not important for this simulation, the easiest (possibly only) workaround is to delete them.

Surfaces "aim39809" and "aim39809 Reversed" are the interzone window surfaces. With these removed, the simulation runs to completion.

@mjwitte mjwitte changed the title idf file causing segfualt idf file causing segfault May 7, 2024
@mjwitte mjwitte changed the title idf file causing segfault idf file causing segfault and mirrors of nonconvex shading surfaces are classified as convex May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants