SlideShare a Scribd company logo
1 of 31
Download to read offline
Debugging
Juan A. Suárez Romero
  <jasuarez@igalia.com>

          Master on Free Software
What is a bug?
●   Basically, an error in a program
●    When a program performs as it shouldn't
    perform
●   All software have bugs
    –   Programming is complex
    –   Human task -> errors



                       Master on Free Software
Type of bugs
●   Resource-accessing bugs
●   Semantic bugs
    –   Wrong results
    –   Unfullfil specifications
●   Performance bugs
●   Memory bugs
    –   Overflows => crashes
    –   Leaks
●   Concurrent bugs
                            Master on Free Software
Bugfixing
●   Find a bug
    –   By developers
    –   By users
●   Report a bug
    –   Bugzilla
●   Locate the problem
    –   Debugging tools
●   Fix it
                          Master on Free Software
Finding bugs
●   By developers
     –   Compile-time errors are not bugs!
     –   Running time
          ●   By chance
          ●   Running tests
          ●   Using tools (see debugging)
●   By users
     –   They don't look for, but bugs turn up!
     –   Reported to developers
●   By testers
     –   Mix between developers and users
     –   Use more sophisticated techniques
                                      Master on Free Software
Reporting bugs
●   Crash-report applications
●   Bugtrackers: issue tracker system
    –   Open a ticket (bug)
    –   Add comments and/or other stuff
    –   Tickets have states (life cycle)
    –   Close ticket (bug)
    –   Examples
         ●   Bugzilla (from Mozilla Project)
         ●   Mantis Bug Tracker
                                Master on Free Software
Finding the problem
●   To find something, we need to know
    about it
    –   Develop small tests to reproduce the problem
    –   Use debugging tools
         ●   Debuggers
         ●   Profilers
         ●   Memory checkers
         ●   ...



                               Master on Free Software
Fixing bugs
●   Using input from the last point
●   Verify tests perform fine
    –   Bug is fixed
    –   Not introduce new bugs
●   Document and commit




                         Master on Free Software
Bugzilla
●   Developed by Mozilla Foundation (1998)
●   Web-based (LAMP)
●   Widely used
●   Highly configurable




                      Master on Free Software
Bugzilla




Master on Free Software
Bugzilla




Master on Free Software
Bugzilla




Where is the bug?




                Master on Free Software
Bugzilla



Severity of bug
   ­ Blocker
   ­ Critical
   ­ Major
   ­ Normal
   ­ Minor




              Master on Free Software
Bugzilla




            Bug description
               ­ Overview
               ­ Preconditions
               ­ Steps to reproduce
               ­ Actual results
               ­ Expected results
               ­ Frequency
               ­ Other relevant information


Master on Free Software
Bugzilla
●   Priority: How urgent is to fix the bug?
●   Differences between severity and priority
    –   Severity is a technical matter
    –   Priority is a business matter
    –   Severity is absolute
    –   Priority is relative
    –   Priority can be calculated from severity


                               Master on Free Software
Bugzilla




Master on Free Software
Bugzilla




Master on Free Software
Triagging
●   Medical term: choose which patient would
    receive medical cares
●   Useful when there are a lot of bugs, but
    few developers
    –   Share bugs among developers
    –   Use bug features and developers habilities to
        assign the bugs



                          Master on Free Software
Bugzilla




Master on Free Software
Bugzilla




                          From Bugzilla 
                          Documentation


Master on Free Software
Some tools
●   Printf ;-)
●   GDB (GNU Debugger)
●   Valgrind
●   Electric Fence
●   OProfile
●   G_DEBUG (fatal_warnings, fatal_criticals)


                      Master on Free Software
OProfile
●   Profile all running code




                       Master on Free Software
Electric Fence
●   Find overflows / underflows
●   Easy to use: preload/link against efence
    library
●   Mark with “red zones” buffers
    –   Crash inmediately when touching them
    –   Thus, errors don't turn up in a future time




                           Master on Free Software
G_DEBUG
●   Useful to debug problems in Glib
●   Environment variable
    –   fatal_criticals: g_critical generates a core
        dump
    –   fatal_warnings: g_warning generates a core
        dump




                            Master on Free Software
Valgrind
●   Tool suite for debugging and profiling
●   Simulates a x86 processor
    –   Memcheck: memory problems
         ●   Memory accesses not allowed
         ●   Memory leaks
         ●   Bad frees
    –   Cachegrind: cache profiler
    –   Massif: heap profiler
    –   Helgrind: thread debugger
                              Master on Free Software
GDB
●   GNU Debugger
●   Text mode
    –   Other frontends: IDEs, emacs, DDD, XXGDB
●   Trace the code
    –   See what is doing
    –   Inspect the data



                            Master on Free Software
GDB
●   Requirements to debug an application
    –   Add debugging symbols -> not stripped
    –   Remove optimizations (-O0)




                         Master on Free Software
GDB
●   How to use
    –   Run process with gdb
    –   Inspect core dumps
    –   Attach to running process




                          Master on Free Software
Core dumps
●   Dump of information of a process when it
    crashes
    –   See while it crashed
    –   Inspect data
●   ulimit -c <size of core>
●   ./gdb <program> <core>



                          Master on Free Software
GDB
●   Run: runs the program from start
●   Continue: continues running a stopped program
●   Backtrace: show the stack
●   Break: add a breakpoint
●   Delete: delete a breakpoint
●   Next: runs the current line to next
●   Step: same as Next, but if current is a function, enter
    inside
●   Print: print the content of a variable
●   Display: same as Print, but more permanent

                              Master on Free Software
References
●   http://www.google.es
●   http://www.wikipedia.org
●   http://www.bugzilla.org
●   http://www.mantisbt.org
●   http://library.gnome.org/devel/glib/unstable/glib-running.html
●   http://sourceware.org/gdb/
●   http://oprofile.sourceforge.net
●   http://valgrind.org
                               Master on Free Software

More Related Content

What's hot

Continuous testing of a terminal font
Continuous testing of a terminal fontContinuous testing of a terminal font
Continuous testing of a terminal fontRicardo Bánffy
 
Scripting Recipes for Testers
Scripting Recipes for TestersScripting Recipes for Testers
Scripting Recipes for TestersAdam Goucher
 
Test driven development with sonarQube
Test driven development with sonarQubeTest driven development with sonarQube
Test driven development with sonarQubeNanthakumar Suvethan
 
Александр Качур - "Android и MeeGo: автоматизация тестовых сценариев"
Александр Качур - "Android и MeeGo: автоматизация тестовых сценариев"Александр Качур - "Android и MeeGo: автоматизация тестовых сценариев"
Александр Качур - "Android и MeeGo: автоматизация тестовых сценариев"QA Dnepropetrovsk Community (Ukraine)
 
How to write a well-behaved Python command line application
How to write a well-behaved Python command line applicationHow to write a well-behaved Python command line application
How to write a well-behaved Python command line applicationgjcross
 
Application Development Using Java - DIYComputerScience Course
Application Development Using Java - DIYComputerScience CourseApplication Development Using Java - DIYComputerScience Course
Application Development Using Java - DIYComputerScience Courseparag
 
Behaviour Testing and Continuous Integration with Drupal
Behaviour Testing and Continuous Integration with DrupalBehaviour Testing and Continuous Integration with Drupal
Behaviour Testing and Continuous Integration with Drupalsmithmilner
 
Civilized Git Process
Civilized Git ProcessCivilized Git Process
Civilized Git ProcessTu Hoang
 
PHPUnit with Magento
PHPUnit with MagentoPHPUnit with Magento
PHPUnit with MagentoTu Hoang
 
Python debuggers slides
Python debuggers slidesPython debuggers slides
Python debuggers slidesmattboehm
 
The Evil Tester's Guide to HTTP proxies Tutorial
The Evil Tester's Guide to HTTP proxies TutorialThe Evil Tester's Guide to HTTP proxies Tutorial
The Evil Tester's Guide to HTTP proxies TutorialAlan Richardson
 
Controlling NAO with Java
Controlling NAO with JavaControlling NAO with Java
Controlling NAO with JavaNicolas Rigaud
 
Nicholas Gustilo "Clean Android: building great mobile apps"
Nicholas Gustilo "Clean Android: building great mobile apps"Nicholas Gustilo "Clean Android: building great mobile apps"
Nicholas Gustilo "Clean Android: building great mobile apps"IT Event
 

What's hot (20)

Php unit (eng)
Php unit (eng)Php unit (eng)
Php unit (eng)
 
Continuous testing of a terminal font
Continuous testing of a terminal fontContinuous testing of a terminal font
Continuous testing of a terminal font
 
TAP In Depth
TAP In DepthTAP In Depth
TAP In Depth
 
Scripting Recipes for Testers
Scripting Recipes for TestersScripting Recipes for Testers
Scripting Recipes for Testers
 
Test driven development with sonarQube
Test driven development with sonarQubeTest driven development with sonarQube
Test driven development with sonarQube
 
Александр Качур - "Android и MeeGo: автоматизация тестовых сценариев"
Александр Качур - "Android и MeeGo: автоматизация тестовых сценариев"Александр Качур - "Android и MeeGo: автоматизация тестовых сценариев"
Александр Качур - "Android и MeeGo: автоматизация тестовых сценариев"
 
How to write a well-behaved Python command line application
How to write a well-behaved Python command line applicationHow to write a well-behaved Python command line application
How to write a well-behaved Python command line application
 
Go lang
Go langGo lang
Go lang
 
Application Development Using Java - DIYComputerScience Course
Application Development Using Java - DIYComputerScience CourseApplication Development Using Java - DIYComputerScience Course
Application Development Using Java - DIYComputerScience Course
 
Behaviour Testing and Continuous Integration with Drupal
Behaviour Testing and Continuous Integration with DrupalBehaviour Testing and Continuous Integration with Drupal
Behaviour Testing and Continuous Integration with Drupal
 
Civilized Git Process
Civilized Git ProcessCivilized Git Process
Civilized Git Process
 
Besut Kode Challenge 1
Besut Kode Challenge 1Besut Kode Challenge 1
Besut Kode Challenge 1
 
PHPUnit with Magento
PHPUnit with MagentoPHPUnit with Magento
PHPUnit with Magento
 
Python debuggers slides
Python debuggers slidesPython debuggers slides
Python debuggers slides
 
Rfselenium2 redhat
Rfselenium2 redhatRfselenium2 redhat
Rfselenium2 redhat
 
The Evil Tester's Guide to HTTP proxies Tutorial
The Evil Tester's Guide to HTTP proxies TutorialThe Evil Tester's Guide to HTTP proxies Tutorial
The Evil Tester's Guide to HTTP proxies Tutorial
 
Controlling NAO with Java
Controlling NAO with JavaControlling NAO with Java
Controlling NAO with Java
 
Neo4j Graph Database, from PHP
Neo4j Graph Database, from PHPNeo4j Graph Database, from PHP
Neo4j Graph Database, from PHP
 
Nicholas Gustilo "Clean Android: building great mobile apps"
Nicholas Gustilo "Clean Android: building great mobile apps"Nicholas Gustilo "Clean Android: building great mobile apps"
Nicholas Gustilo "Clean Android: building great mobile apps"
 
Groovy android
Groovy androidGroovy android
Groovy android
 

Viewers also liked

An add-on for managing behaviours with priority in JADE
An add-on for managing behaviours with priority in JADEAn add-on for managing behaviours with priority in JADE
An add-on for managing behaviours with priority in JADEJuan A. Suárez Romero
 
Integrating a Priority-Based Scheduler of Behaviours in JADE
Integrating a Priority-Based Scheduler of Behaviours in JADEIntegrating a Priority-Based Scheduler of Behaviours in JADE
Integrating a Priority-Based Scheduler of Behaviours in JADEJuan A. Suárez Romero
 
Grilo: Easy Access to Online Multimedia Content
Grilo: Easy Access to Online Multimedia ContentGrilo: Easy Access to Online Multimedia Content
Grilo: Easy Access to Online Multimedia ContentJuan A. Suárez Romero
 
Writing multimedia applications with Grilo
Writing multimedia applications with GriloWriting multimedia applications with Grilo
Writing multimedia applications with GriloJuan A. Suárez Romero
 

Viewers also liked (7)

An add-on for managing behaviours with priority in JADE
An add-on for managing behaviours with priority in JADEAn add-on for managing behaviours with priority in JADE
An add-on for managing behaviours with priority in JADE
 
Rygel-Grilo
Rygel-GriloRygel-Grilo
Rygel-Grilo
 
Integrating a Priority-Based Scheduler of Behaviours in JADE
Integrating a Priority-Based Scheduler of Behaviours in JADEIntegrating a Priority-Based Scheduler of Behaviours in JADE
Integrating a Priority-Based Scheduler of Behaviours in JADE
 
D’Angelo Moore
D’Angelo MooreD’Angelo Moore
D’Angelo Moore
 
Grilo: Easy Access to Online Multimedia Content
Grilo: Easy Access to Online Multimedia ContentGrilo: Easy Access to Online Multimedia Content
Grilo: Easy Access to Online Multimedia Content
 
Grilo: present and future
Grilo: present and futureGrilo: present and future
Grilo: present and future
 
Writing multimedia applications with Grilo
Writing multimedia applications with GriloWriting multimedia applications with Grilo
Writing multimedia applications with Grilo
 

Similar to MSL2008. Debugging

Debugging Modern C++ Application with Gdb
Debugging Modern C++ Application with GdbDebugging Modern C++ Application with Gdb
Debugging Modern C++ Application with GdbSenthilKumar Selvaraj
 
Introduction of Tools for providing rich user experience in debugger
Introduction of Tools for providing rich user experience in debuggerIntroduction of Tools for providing rich user experience in debugger
Introduction of Tools for providing rich user experience in debuggerNaoto Ono
 
Java Code Quality Tools
Java Code Quality ToolsJava Code Quality Tools
Java Code Quality ToolsAnju ML
 
Teaching Open Source In The University
Teaching Open Source In The UniversityTeaching Open Source In The University
Teaching Open Source In The UniversityDominique Cimafranca
 
Debuggers in system software
Debuggers in system softwareDebuggers in system software
Debuggers in system softwaregayathri ravi
 
debugging (1).ppt
debugging (1).pptdebugging (1).ppt
debugging (1).pptjerlinS1
 
An important characteristic of a test suite that is computed by a dynamic ana...
An important characteristic of a test suite that is computed by a dynamic ana...An important characteristic of a test suite that is computed by a dynamic ana...
An important characteristic of a test suite that is computed by a dynamic ana...jeyasrig
 
CNIT 126: 8: Debugging
CNIT 126: 8: DebuggingCNIT 126: 8: Debugging
CNIT 126: 8: DebuggingSam Bowne
 
Open source software best practices
Open source software best practicesOpen source software best practices
Open source software best practicesparewalabs
 
Working With Legacy Code
Working With Legacy CodeWorking With Legacy Code
Working With Legacy CodeAndrea Polci
 
Introduction to segmentation fault handling
Introduction to segmentation fault handling Introduction to segmentation fault handling
Introduction to segmentation fault handling Larion
 
CNIT 126 8: Debugging
CNIT 126 8: DebuggingCNIT 126 8: Debugging
CNIT 126 8: DebuggingSam Bowne
 
PyConUK 2014 - PostMortem Debugging and Web Development Updated
PyConUK 2014 - PostMortem Debugging and Web Development UpdatedPyConUK 2014 - PostMortem Debugging and Web Development Updated
PyConUK 2014 - PostMortem Debugging and Web Development UpdatedAlessandro Molina
 
My "Perfect" Toolchain Setup for Grails Projects
My "Perfect" Toolchain Setup for Grails ProjectsMy "Perfect" Toolchain Setup for Grails Projects
My "Perfect" Toolchain Setup for Grails ProjectsGR8Conf
 

Similar to MSL2008. Debugging (20)

MSL2009. Gdb
MSL2009. GdbMSL2009. Gdb
MSL2009. Gdb
 
MSL2009. Valgrind
MSL2009. ValgrindMSL2009. Valgrind
MSL2009. Valgrind
 
Debugging Modern C++ Application with Gdb
Debugging Modern C++ Application with GdbDebugging Modern C++ Application with Gdb
Debugging Modern C++ Application with Gdb
 
Introduction of Tools for providing rich user experience in debugger
Introduction of Tools for providing rich user experience in debuggerIntroduction of Tools for providing rich user experience in debugger
Introduction of Tools for providing rich user experience in debugger
 
Java Code Quality Tools
Java Code Quality ToolsJava Code Quality Tools
Java Code Quality Tools
 
Sensible scaling
Sensible scalingSensible scaling
Sensible scaling
 
PHP - Introduction to PHP Bugs - Debugging
PHP -  Introduction to  PHP Bugs - DebuggingPHP -  Introduction to  PHP Bugs - Debugging
PHP - Introduction to PHP Bugs - Debugging
 
Teaching Open Source In The University
Teaching Open Source In The UniversityTeaching Open Source In The University
Teaching Open Source In The University
 
Debuggers in system software
Debuggers in system softwareDebuggers in system software
Debuggers in system software
 
debugging (1).ppt
debugging (1).pptdebugging (1).ppt
debugging (1).ppt
 
An important characteristic of a test suite that is computed by a dynamic ana...
An important characteristic of a test suite that is computed by a dynamic ana...An important characteristic of a test suite that is computed by a dynamic ana...
An important characteristic of a test suite that is computed by a dynamic ana...
 
Zombie chaser 0.1
Zombie chaser 0.1Zombie chaser 0.1
Zombie chaser 0.1
 
CNIT 126: 8: Debugging
CNIT 126: 8: DebuggingCNIT 126: 8: Debugging
CNIT 126: 8: Debugging
 
Open source software best practices
Open source software best practicesOpen source software best practices
Open source software best practices
 
Working With Legacy Code
Working With Legacy CodeWorking With Legacy Code
Working With Legacy Code
 
Introduction to segmentation fault handling
Introduction to segmentation fault handling Introduction to segmentation fault handling
Introduction to segmentation fault handling
 
CNIT 126 8: Debugging
CNIT 126 8: DebuggingCNIT 126 8: Debugging
CNIT 126 8: Debugging
 
PyConUK 2014 - PostMortem Debugging and Web Development Updated
PyConUK 2014 - PostMortem Debugging and Web Development UpdatedPyConUK 2014 - PostMortem Debugging and Web Development Updated
PyConUK 2014 - PostMortem Debugging and Web Development Updated
 
Software quality-libreplan
Software quality-libreplanSoftware quality-libreplan
Software quality-libreplan
 
My "Perfect" Toolchain Setup for Grails Projects
My "Perfect" Toolchain Setup for Grails ProjectsMy "Perfect" Toolchain Setup for Grails Projects
My "Perfect" Toolchain Setup for Grails Projects
 

More from Juan A. Suárez Romero

Graphics stack updates for Raspberry Pi devices (FOSDEM 2024)
Graphics stack updates for Raspberry Pi devices (FOSDEM 2024)Graphics stack updates for Raspberry Pi devices (FOSDEM 2024)
Graphics stack updates for Raspberry Pi devices (FOSDEM 2024)Juan A. Suárez Romero
 
On-going challenges in the Raspberry Pi driver stack: OpenGL 3, Vulkan and mo...
On-going challenges in the Raspberry Pi driver stack: OpenGL 3, Vulkan and mo...On-going challenges in the Raspberry Pi driver stack: OpenGL 3, Vulkan and mo...
On-going challenges in the Raspberry Pi driver stack: OpenGL 3, Vulkan and mo...Juan A. Suárez Romero
 
Logical Volume Manager. An Introduction
Logical Volume Manager. An IntroductionLogical Volume Manager. An Introduction
Logical Volume Manager. An IntroductionJuan A. Suárez Romero
 
Una Arquitectura Multiagente Inteligente para la Detección de Intrusos
Una Arquitectura Multiagente Inteligente para la Detección de IntrusosUna Arquitectura Multiagente Inteligente para la Detección de Intrusos
Una Arquitectura Multiagente Inteligente para la Detección de IntrusosJuan A. Suárez Romero
 
A New Learning Method for Single Layer Neural Networks Based on a Regularized...
A New Learning Method for Single Layer Neural Networks Based on a Regularized...A New Learning Method for Single Layer Neural Networks Based on a Regularized...
A New Learning Method for Single Layer Neural Networks Based on a Regularized...Juan A. Suárez Romero
 
A Tool for Agent Communication in Mozart/Oz
A Tool for Agent Communication in Mozart/OzA Tool for Agent Communication in Mozart/Oz
A Tool for Agent Communication in Mozart/OzJuan A. Suárez Romero
 
A Multi-Agent Architecture for Intrusion Detection
A Multi-Agent Architecture for Intrusion DetectionA Multi-Agent Architecture for Intrusion Detection
A Multi-Agent Architecture for Intrusion DetectionJuan A. Suárez Romero
 

More from Juan A. Suárez Romero (8)

Graphics stack updates for Raspberry Pi devices (FOSDEM 2024)
Graphics stack updates for Raspberry Pi devices (FOSDEM 2024)Graphics stack updates for Raspberry Pi devices (FOSDEM 2024)
Graphics stack updates for Raspberry Pi devices (FOSDEM 2024)
 
On-going challenges in the Raspberry Pi driver stack: OpenGL 3, Vulkan and mo...
On-going challenges in the Raspberry Pi driver stack: OpenGL 3, Vulkan and mo...On-going challenges in the Raspberry Pi driver stack: OpenGL 3, Vulkan and mo...
On-going challenges in the Raspberry Pi driver stack: OpenGL 3, Vulkan and mo...
 
Logical Volume Manager. An Introduction
Logical Volume Manager. An IntroductionLogical Volume Manager. An Introduction
Logical Volume Manager. An Introduction
 
Una Arquitectura Multiagente Inteligente para la Detección de Intrusos
Una Arquitectura Multiagente Inteligente para la Detección de IntrusosUna Arquitectura Multiagente Inteligente para la Detección de Intrusos
Una Arquitectura Multiagente Inteligente para la Detección de Intrusos
 
A New Learning Method for Single Layer Neural Networks Based on a Regularized...
A New Learning Method for Single Layer Neural Networks Based on a Regularized...A New Learning Method for Single Layer Neural Networks Based on a Regularized...
A New Learning Method for Single Layer Neural Networks Based on a Regularized...
 
A Tool for Agent Communication in Mozart/Oz
A Tool for Agent Communication in Mozart/OzA Tool for Agent Communication in Mozart/Oz
A Tool for Agent Communication in Mozart/Oz
 
A Multi-Agent Architecture for Intrusion Detection
A Multi-Agent Architecture for Intrusion DetectionA Multi-Agent Architecture for Intrusion Detection
A Multi-Agent Architecture for Intrusion Detection
 
The KNITTER System: KQML for Erlang
The KNITTER System: KQML for ErlangThe KNITTER System: KQML for Erlang
The KNITTER System: KQML for Erlang
 

Recently uploaded

Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
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...Shubhangi Sonawane
 
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 ConsultingTechSoup
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
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 ...EduSkills OECD
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
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 ImpactPECB
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...KokoStevan
 
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 ModeThiyagu K
 
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 SDThiyagu K
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 

Recently uploaded (20)

Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
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...
 
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
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
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 ...
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
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
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
 
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
 
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
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 

MSL2008. Debugging

  • 2. What is a bug? ● Basically, an error in a program ● When a program performs as it shouldn't perform ● All software have bugs – Programming is complex – Human task -> errors Master on Free Software
  • 3. Type of bugs ● Resource-accessing bugs ● Semantic bugs – Wrong results – Unfullfil specifications ● Performance bugs ● Memory bugs – Overflows => crashes – Leaks ● Concurrent bugs Master on Free Software
  • 4. Bugfixing ● Find a bug – By developers – By users ● Report a bug – Bugzilla ● Locate the problem – Debugging tools ● Fix it Master on Free Software
  • 5. Finding bugs ● By developers – Compile-time errors are not bugs! – Running time ● By chance ● Running tests ● Using tools (see debugging) ● By users – They don't look for, but bugs turn up! – Reported to developers ● By testers – Mix between developers and users – Use more sophisticated techniques Master on Free Software
  • 6. Reporting bugs ● Crash-report applications ● Bugtrackers: issue tracker system – Open a ticket (bug) – Add comments and/or other stuff – Tickets have states (life cycle) – Close ticket (bug) – Examples ● Bugzilla (from Mozilla Project) ● Mantis Bug Tracker Master on Free Software
  • 7. Finding the problem ● To find something, we need to know about it – Develop small tests to reproduce the problem – Use debugging tools ● Debuggers ● Profilers ● Memory checkers ● ... Master on Free Software
  • 8. Fixing bugs ● Using input from the last point ● Verify tests perform fine – Bug is fixed – Not introduce new bugs ● Document and commit Master on Free Software
  • 9. Bugzilla ● Developed by Mozilla Foundation (1998) ● Web-based (LAMP) ● Widely used ● Highly configurable Master on Free Software
  • 12. Bugzilla Where is the bug? Master on Free Software
  • 13. Bugzilla Severity of bug ­ Blocker ­ Critical ­ Major ­ Normal ­ Minor Master on Free Software
  • 14. Bugzilla Bug description ­ Overview ­ Preconditions ­ Steps to reproduce ­ Actual results ­ Expected results ­ Frequency ­ Other relevant information Master on Free Software
  • 15. Bugzilla ● Priority: How urgent is to fix the bug? ● Differences between severity and priority – Severity is a technical matter – Priority is a business matter – Severity is absolute – Priority is relative – Priority can be calculated from severity Master on Free Software
  • 18. Triagging ● Medical term: choose which patient would receive medical cares ● Useful when there are a lot of bugs, but few developers – Share bugs among developers – Use bug features and developers habilities to assign the bugs Master on Free Software
  • 20. Bugzilla From Bugzilla  Documentation Master on Free Software
  • 21. Some tools ● Printf ;-) ● GDB (GNU Debugger) ● Valgrind ● Electric Fence ● OProfile ● G_DEBUG (fatal_warnings, fatal_criticals) Master on Free Software
  • 22. OProfile ● Profile all running code Master on Free Software
  • 23. Electric Fence ● Find overflows / underflows ● Easy to use: preload/link against efence library ● Mark with “red zones” buffers – Crash inmediately when touching them – Thus, errors don't turn up in a future time Master on Free Software
  • 24. G_DEBUG ● Useful to debug problems in Glib ● Environment variable – fatal_criticals: g_critical generates a core dump – fatal_warnings: g_warning generates a core dump Master on Free Software
  • 25. Valgrind ● Tool suite for debugging and profiling ● Simulates a x86 processor – Memcheck: memory problems ● Memory accesses not allowed ● Memory leaks ● Bad frees – Cachegrind: cache profiler – Massif: heap profiler – Helgrind: thread debugger Master on Free Software
  • 26. GDB ● GNU Debugger ● Text mode – Other frontends: IDEs, emacs, DDD, XXGDB ● Trace the code – See what is doing – Inspect the data Master on Free Software
  • 27. GDB ● Requirements to debug an application – Add debugging symbols -> not stripped – Remove optimizations (-O0) Master on Free Software
  • 28. GDB ● How to use – Run process with gdb – Inspect core dumps – Attach to running process Master on Free Software
  • 29. Core dumps ● Dump of information of a process when it crashes – See while it crashed – Inspect data ● ulimit -c <size of core> ● ./gdb <program> <core> Master on Free Software
  • 30. GDB ● Run: runs the program from start ● Continue: continues running a stopped program ● Backtrace: show the stack ● Break: add a breakpoint ● Delete: delete a breakpoint ● Next: runs the current line to next ● Step: same as Next, but if current is a function, enter inside ● Print: print the content of a variable ● Display: same as Print, but more permanent Master on Free Software
  • 31. References ● http://www.google.es ● http://www.wikipedia.org ● http://www.bugzilla.org ● http://www.mantisbt.org ● http://library.gnome.org/devel/glib/unstable/glib-running.html ● http://sourceware.org/gdb/ ● http://oprofile.sourceforge.net ● http://valgrind.org Master on Free Software