Measures of Central Tendency: Mean, Median and Mode
TDS decompose bug 126
1. Debugging TDS
decompose bug v126
Fixed v127
By Daniel Gomez-Prado
01/28/2010
Disclaimer: This is not a tutorial.
This is a debugging session
for anyone working on TDS
http://www.dgomezpr.com/
2. Bug 126 at rev 88..127 on 10/01/28
Trigger cmd: decompose
Tds 01> poly a*(b+c*e*(g+f))+c*e*(h+i)
Tds 02> decompose
Tds 03> purge
Tds 04> poly a*(b+c*e*(g+f))+c*e*(h+i)
Tds 05> decompose
Tds 06> purge
Tds 07> poly a*(b+c*e*(g+f))+c*e*(h+i)
Tds 08> decompose
segmentation fault
Error: 04011. There is no kid with the given index
Error: 04017,04019. Unable to find the top parent in Pos
Error: 04036. Pointer to deleted memory detected.
Error, after some debugging
Original error Fixed on ver 127
3. Normally
Decompose()
productTerm()
findProductSupport()
_allTerms has 2 items corresponding to 2 PTs
4. Problem
Some times after running findProductSupport(),
the resulting _allTerms has 3 items corresponding
to 2 PTs.
findProductSupport()
_bottomBFS
initially
0x0034e340
0x006b9c80 reinsertion
0x006ba218
0x006baec0
0x006bcc58
0x006b1840 PT1
0x0034e280 PT2
0x006b9c80
0x0034e160
0x006b1840 PT1 again
5. Problem
Some times after running findProductSupport(),
the resulting _allTerms has 3 items corresponding
to 2 PTs.
3 elements get inserted
findProductSupport() in the binaryTree
_bottomBFS During extractProductSupport()
initially each PT will be deleted from
0x0034e340 the TED, thus when entered
0x006b9c80 the last PT1, we try to access
0x006ba218 nodes that have been deleted
0x006baec0
0x006bcc58
0x006b1840 PT1
0x0034e280 PT2
0x006b9c80
0x0034e160
0x006b1840 PT1 again
6. Solution:
1. Validate the assumption
Lesson: always, always, always state clearly all assumptions
validate those assumptions with assert
use special causing with traversal assumptions!!
1. There is an implicit assumption on the traversal, that parent
nodes are ordered: from closest parent to farther parent.
2. This will require re-implementing TedParents, or implementing a
special case for the product extraction.
2. Avoid re-entry of a node into _allTerms
1. Check a mark to see if the element has been previously inserted
into the map.
Solution taken: 2
Reason: its implementation is faster.