View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001712 | OpenFOAM | Bug | public | 2015-05-27 16:35 | 2015-05-28 16:24 |
Reporter | Assigned To | henry | |||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Platform | GNU/Linux | OS | Ubuntu | OS Version | 15.04 |
Summary | 0001712: Bad container resizings in viewFactorsGen.C | ||||
Description | The container triSurfaceToAgglom is being resized with one element too short, s. patch file. This might lead to a crash if a ray hits the very last triangle of the detailed surface, which then could not be mapped to the correct coarse face. | ||||
Steps To Reproduce | Look at the loop above "triSurfaceToAgglom.resize(localTriFaceI-1)". The counter localTriFaceI already tracks the correct size of the container. It is not needed to subtract 1 after the loop. There is actually some second mistake in "viewFactorsPatches.resize(count--)", s. patch file. It does not lead to a wrong size, but to a potentially unexpected value of count. Fortunately, count is not (yet) being reused. | ||||
Additional Information | The bug is there at least since 2.3 and is still there in dev. | ||||
Tags | No tags attached. | ||||
2015-05-27 16:35
|
viewFactorsGen.patch (703 bytes)
diff -r 9673e8cd8d75 applications/utilities/preProcessing/viewFactorsGen/viewFactorsGen.C --- a/applications/utilities/preProcessing/viewFactorsGen/viewFactorsGen.C Tue May 26 11:32:46 2015 +0100 +++ b/applications/utilities/preProcessing/viewFactorsGen/viewFactorsGen.C Tue May 26 15:51:07 2015 +0200 @@ -130,7 +130,7 @@ newPatchI++; } - triSurfaceToAgglom.resize(localTriFaceI-1); + triSurfaceToAgglom.resize(localTriFaceI); triangles.shrink(); @@ -369,7 +369,7 @@ } } - viewFactorsPatches.resize(count--); + viewFactorsPatches.resize(count); // total number of coarse faces label totalNCoarseFaces = nCoarseFaces; |
|
This seems somewhat similar to the issue reported in #1157: http://www.openfoam.org/mantisbt/view.php?id=1157 |
|
Yes, in the best case #1157 is caused by a similar typo (though hard to find). In the maybe worst case #1157 is caused by inconsistencies from mesh generation. This bug here generates segfaults even if #1157 was fixed and vice versa. Hence I would regard it to be possibly similar, but in any case independent. |
|
Thanks for the bug-report and patch. Resolved by commit 59134ff9f8ed71523f75b0a4f3f81bcd444a7955 in OpenFOAM-dev Resolved by commit 5eb755819f9ca83664a1f40a54e6e6c9ffd311ec in OpenFOAM-2.4.x |
Date Modified | Username | Field | Change |
---|---|---|---|
2015-05-27 16:35 |
|
New Issue | |
2015-05-27 16:35 |
|
File Added: viewFactorsGen.patch | |
2015-05-28 13:03 | wyldckat | Note Added: 0004826 | |
2015-05-28 16:18 |
|
Note Added: 0004827 | |
2015-05-28 16:24 | henry | Note Added: 0004828 | |
2015-05-28 16:24 | henry | Status | new => resolved |
2015-05-28 16:24 | henry | Resolution | open => fixed |
2015-05-28 16:24 | henry | Assigned To | => henry |