View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0027367 | Open CASCADE | OCCT:Foundation Classes | public | 2016-04-08 18:14 | 2016-11-22 23:27 |
| Reporter | Assigned To | ||||
| Priority | normal | Severity | minor | ||
| Status | closed | Resolution | no change required | ||
| Product Version | 7.0.0 | ||||
| Summary | 0027367: The last element remove crash during NCollection_List iteration | ||||
| Description | The NCollection_List iteration crashes if the list last element is removed during the iteration. | ||||
| Steps To Reproduce | NCollection_List<Standard_Integer> aList; aList.Prepend(0); aList.Prepend(1); NCollection_List<Standard_Integer>::Iterator aIt(aList); for (; aIt.More(); aIt.Next()) { if (aIt.Value() == 0) { aList.Remove(aIt); } } | ||||
| Tags | No tags attached. | ||||
| Test case number | |||||
|
|
The cycle given in Steps to Reproduce is organized in incorrect way. When element is removed from the list, iterator is modified to point to the next element, and Next() should not be called. If the cycle is corrected, the problem will not appear any more. Note that this is not specific to lists, but relevant for iteration by any collection. The immediate reason of exception is that method Next() causes access violation if iterator is in stop state (More() returns False). The protection could be added, however it may affect performance and would be rather useless, letting the problem to remain unnoticed. Alexander, please confirm that you agree with my conclusion (you might need to correct the code where you found this issue), so that I could close the issue. |
|
|
The conclusion is acceptable for me. Please process the bug by a way that is right in your opinion. |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2016-04-08 18:14 |
|
New Issue | |
| 2016-04-08 18:14 |
|
Assigned To | => abv |
| 2016-11-21 11:21 |
|
Note Added: 0060599 | |
| 2016-11-21 11:21 |
|
Assigned To | abv => abk |
| 2016-11-21 11:21 |
|
Status | new => feedback |
| 2016-11-22 14:27 |
|
Note Added: 0060677 | |
| 2016-11-22 14:27 |
|
Assigned To | abk => abv |
| 2016-11-22 14:27 |
|
Status | feedback => assigned |
| 2016-11-22 23:27 |
|
Status | assigned => closed |
| 2016-11-22 23:27 |
|
Resolution | open => no change required |
| 2016-11-22 23:27 |
|
Target Version | 7.1.0 => |