Closed
Bug 529540
Opened 15 years ago
Closed 15 years ago
Unbounded recursion in Traits::resolveSignatures, countInterfaces, addInterfaces
Categories
(Tamarin Graveyard :: Virtual Machine, defect, P3)
Tamarin Graveyard
Virtual Machine
Tracking
(Not tracked)
VERIFIED
FIXED
flash10.1
People
(Reporter: edwsmith, Assigned: edwsmith)
References
Details
Attachments
(1 file, 2 obsolete files)
5.48 KB,
patch
|
stejohns
:
review+
lhansen
:
superreview+
|
Details | Diff | Splinter Review |
more unwanted recursion:
* Traits::resolveSignatures recurses up the inheritance and the interface dag
* Traits::countInterfaces and addInterfaces recurse up the interface dag, too.
Simple but somewhat heavy fix for each case is a working queue of Traits* to
visit.
Assignee | ||
Updated•15 years ago
|
Assignee | ||
Comment 1•15 years ago
|
||
Assignee: nobody → edwsmith
Attachment #413605 -
Flags: superreview?(lhansen)
Comment 2•15 years ago
|
||
Comment on attachment 413605 [details] [diff] [review]
Fix unbounded recursion in Traits::countNewInterfaces()
Is every item we push onto the stack guarded against being garbage collected by virtue of being linked from some other structure that, unlike Stack<>, is visible to the GC?
Assignee | ||
Comment 3•15 years ago
|
||
Each interface is rooted by being present in PoolObject and Domain, obtained by calling pool->resolveTypeName. I can add a comment to that effect or use List<GCobjects>; at this point making GC references obvious maybe outweighs any tiny performance gain.
Comment 4•15 years ago
|
||
Comment on attachment 413605 [details] [diff] [review]
Fix unbounded recursion in Traits::countNewInterfaces()
A comment probably suffices.
(If we ever want a partly-moving GC we'll have to fix all cases like this, though - it becomes vital that references from unmanaged memory are all seen.)
Attachment #413605 -
Flags: superreview?(lhansen) → superreview+
Assignee | ||
Comment 5•15 years ago
|
||
Comment on attachment 413605 [details] [diff] [review]
Fix unbounded recursion in Traits::countNewInterfaces()
pushed http://hg.mozilla.org/tamarin-redux/rev/6297a734323d
Attachment #413605 -
Attachment is obsolete: true
Assignee | ||
Comment 6•15 years ago
|
||
Attachment #414075 -
Flags: superreview?
Attachment #414075 -
Flags: review?(stejohns)
Assignee | ||
Updated•15 years ago
|
Attachment #414075 -
Flags: superreview? → superreview?(lhansen)
Assignee | ||
Comment 7•15 years ago
|
||
(In reply to comment #6)
> Created an attachment (id=414075) [details]
> Fix unbounded recursion in Traits::resolveSignatures()
The existing code will recurse into resolveSupertypes at various points in the middle; base types are handled first, interfaces of concrete types are handled while fixing up interface bindings, and finally interfaces of other interfaces are handled last.
This patch resolves all supertypes before doing anything on "self"; this is not beleived to cause problems and since even the old code ultimately would resolve all supertypes, it is beleived that this won't make anything get resolved materially sooner than before.
Since we have arrays holding all supertypes (m_primary_supertypes and m_secondary_supertypes), the fix is to just put those types in top-down order, without recursion, then iterate through and resolve each type.
Assignee | ||
Comment 8•15 years ago
|
||
Attachment #414075 -
Attachment is obsolete: true
Attachment #414078 -
Flags: superreview?(lhansen)
Attachment #414078 -
Flags: review?(stejohns)
Attachment #414075 -
Flags: superreview?(lhansen)
Attachment #414075 -
Flags: review?(stejohns)
Comment 9•15 years ago
|
||
Comment on attachment 414078 [details] [diff] [review]
no recursion in Traits::resolveSignatures() (2nd try)
The commented-out assertion in resolveSignatures can go. (I know, it was like that before.)
In the second loop in resolveSignatures the test for t != NULL is redundant because t = *st which is already checked for NULL by the loop condition.
Attachment #414078 -
Flags: superreview?(lhansen) → superreview+
Updated•15 years ago
|
Attachment #414078 -
Flags: review?(stejohns) → review+
Assignee | ||
Comment 10•15 years ago
|
||
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•