Potential fatal errors in box-related loops that fire traps
Bug #292448 reported by
Charles Goodwin
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Vexi |
Fix Released
|
Low
|
Charles Goodwin |
Bug Description
e.g. from fireVisibleTraps:
for (int i=0; i<treeSize(); i++) {
Box b = getChild(i);
if (b.test(DISPLAY))
}
Originally Adam had a concept of 'nextSibling' and 'prevSibling'. It's obvious that he did this because the trap firing may alter the state of the box tree, thus the current loop must be flexible to deal with this.
Changed in vexi: | |
assignee: | nobody → charlesgoodwin |
importance: | Undecided → Critical |
milestone: | none → 3.0.0 |
status: | New → Confirmed |
Changed in vexi: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
Its not a race conditon, as js and all box operations are performed in one thread.
What it does mean that in certain sensitive points vexi code could potentially get executed with bad logic or core exceptions may get thrown. This could be potentially confusing for a vexi application developer.
.
One solution would be to lock the box or possibley a box tree at certain points, preventing add/remove child operations. Ideally we would just lock the box before entering the loop and unlock it after.