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 Debugging Techniques and Tools

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 Debugging Techniques and Tools (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

Tree View Decoration Attribute in the Odoo 17
Tree View Decoration Attribute in the Odoo 17Tree View Decoration Attribute in the Odoo 17
Tree View Decoration Attribute in the Odoo 17Celine George
 
4.9.24 School Desegregation in Boston.pptx
4.9.24 School Desegregation in Boston.pptx4.9.24 School Desegregation in Boston.pptx
4.9.24 School Desegregation in Boston.pptxmary850239
 
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
Unraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptxUnraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptx
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptxDhatriParmar
 
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQ-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQuiz Club NITW
 
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQ-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQuiz Club NITW
 
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...DhatriParmar
 
How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17Celine George
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 
Indexing Structures in Database Management system.pdf
Indexing Structures in Database Management system.pdfIndexing Structures in Database Management system.pdf
Indexing Structures in Database Management system.pdfChristalin Nelson
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
How to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseHow to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseCeline George
 
ARTERIAL BLOOD GAS ANALYSIS........pptx
ARTERIAL BLOOD  GAS ANALYSIS........pptxARTERIAL BLOOD  GAS ANALYSIS........pptx
ARTERIAL BLOOD GAS ANALYSIS........pptxAneriPatwari
 
Mythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWMythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWQuiz Club NITW
 
4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptxmary850239
 
Using Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea DevelopmentUsing Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea Developmentchesterberbo7
 
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvRicaMaeCastro1
 
How to Manage Buy 3 Get 1 Free in Odoo 17
How to Manage Buy 3 Get 1 Free in Odoo 17How to Manage Buy 3 Get 1 Free in Odoo 17
How to Manage Buy 3 Get 1 Free in Odoo 17Celine George
 
CHEST Proprioceptive neuromuscular facilitation.pptx
CHEST Proprioceptive neuromuscular facilitation.pptxCHEST Proprioceptive neuromuscular facilitation.pptx
CHEST Proprioceptive neuromuscular facilitation.pptxAneriPatwari
 
Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1GloryAnnCastre1
 

Recently uploaded (20)

Tree View Decoration Attribute in the Odoo 17
Tree View Decoration Attribute in the Odoo 17Tree View Decoration Attribute in the Odoo 17
Tree View Decoration Attribute in the Odoo 17
 
4.9.24 School Desegregation in Boston.pptx
4.9.24 School Desegregation in Boston.pptx4.9.24 School Desegregation in Boston.pptx
4.9.24 School Desegregation in Boston.pptx
 
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
Unraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptxUnraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptx
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
 
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQ-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
 
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQ-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
 
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
 
How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 
Indexing Structures in Database Management system.pdf
Indexing Structures in Database Management system.pdfIndexing Structures in Database Management system.pdf
Indexing Structures in Database Management system.pdf
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
How to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseHow to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 Database
 
ARTERIAL BLOOD GAS ANALYSIS........pptx
ARTERIAL BLOOD  GAS ANALYSIS........pptxARTERIAL BLOOD  GAS ANALYSIS........pptx
ARTERIAL BLOOD GAS ANALYSIS........pptx
 
Mythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWMythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITW
 
prashanth updated resume 2024 for Teaching Profession
prashanth updated resume 2024 for Teaching Professionprashanth updated resume 2024 for Teaching Profession
prashanth updated resume 2024 for Teaching Profession
 
4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx
 
Using Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea DevelopmentUsing Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea Development
 
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
 
How to Manage Buy 3 Get 1 Free in Odoo 17
How to Manage Buy 3 Get 1 Free in Odoo 17How to Manage Buy 3 Get 1 Free in Odoo 17
How to Manage Buy 3 Get 1 Free in Odoo 17
 
CHEST Proprioceptive neuromuscular facilitation.pptx
CHEST Proprioceptive neuromuscular facilitation.pptxCHEST Proprioceptive neuromuscular facilitation.pptx
CHEST Proprioceptive neuromuscular facilitation.pptx
 
Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1
 

Debugging Techniques and Tools

  • 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