SlideShare a Scribd company logo
1 of 6
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/
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
Normally
  Decompose()
   productTerm()
    findProductSupport()
    _allTerms has 2 items corresponding to 2 PTs
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
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
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.

More Related Content

Viewers also liked (17)

Química inorgánica
Química inorgánicaQuímica inorgánica
Química inorgánica
 
Medios tecnológicos power point
Medios tecnológicos power pointMedios tecnológicos power point
Medios tecnológicos power point
 
Webdesign
WebdesignWebdesign
Webdesign
 
Comunicacion humana por medios masivos
Comunicacion humana por medios masivosComunicacion humana por medios masivos
Comunicacion humana por medios masivos
 
History of The Genre
History of The GenreHistory of The Genre
History of The Genre
 
Diapositivas de informatica
Diapositivas de informaticaDiapositivas de informatica
Diapositivas de informatica
 
Exploitation in Indian Industrial Sector
Exploitation in Indian Industrial SectorExploitation in Indian Industrial Sector
Exploitation in Indian Industrial Sector
 
BABY SHOWER
BABY SHOWERBABY SHOWER
BABY SHOWER
 
Casos y controles. metodologia
Casos y controles. metodologiaCasos y controles. metodologia
Casos y controles. metodologia
 
Osiel ppt computacion
Osiel ppt computacionOsiel ppt computacion
Osiel ppt computacion
 
E Mail
E MailE Mail
E Mail
 
Juan Perez[1]
Juan Perez[1]Juan Perez[1]
Juan Perez[1]
 
Why do people love social networking, but hate their enterprise social software?
Why do people love social networking, but hate their enterprise social software?Why do people love social networking, but hate their enterprise social software?
Why do people love social networking, but hate their enterprise social software?
 
Agenda de trabajo ft agos2011
Agenda de trabajo ft agos2011Agenda de trabajo ft agos2011
Agenda de trabajo ft agos2011
 
Plan
PlanPlan
Plan
 
880 Research Project
880 Research Project880 Research Project
880 Research Project
 
Abençoada Semana Santa
Abençoada Semana SantaAbençoada Semana Santa
Abençoada Semana Santa
 

More from Daniel Gomez-Prado (11)

Tutorial on FPGA Routing
Tutorial on FPGA RoutingTutorial on FPGA Routing
Tutorial on FPGA Routing
 
Design of an Embedded Micro controller
Design of an Embedded Micro controllerDesign of an Embedded Micro controller
Design of an Embedded Micro controller
 
TDS Manual
TDS ManualTDS Manual
TDS Manual
 
Brief GAUT tutorial
Brief GAUT tutorialBrief GAUT tutorial
Brief GAUT tutorial
 
Slideshare with animations
Slideshare with animationsSlideshare with animations
Slideshare with animations
 
unsplitted slideshare
unsplitted slideshareunsplitted slideshare
unsplitted slideshare
 
Basic data structures part I
Basic data structures part IBasic data structures part I
Basic data structures part I
 
TDS show bug 106
TDS show bug 106TDS show bug 106
TDS show bug 106
 
TDS decompose bug 111
TDS decompose bug 111TDS decompose bug 111
TDS decompose bug 111
 
TDS decompose bug 119
TDS decompose bug 119TDS decompose bug 119
TDS decompose bug 119
 
TDS Bug 221
TDS Bug 221TDS Bug 221
TDS Bug 221
 

Recently uploaded

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
heathfieldcps1
 

Recently uploaded (20)

Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptx
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
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.