SlideShare a Scribd company logo
Debugging toolsDebugging tools
Мариян HackMan Маринов
<mm@1h.com>
Tools used for debugging
Кой съм аз?Кой съм аз?
➢ Chief system architect of
➢ Sysadmin since the stone age
➢ The longest course in SoftUni
Linux System Administration
What is this talk about?What is this talk about?
Debugging is twice as hard as writing the code inDebugging is twice as hard as writing the code in
the first place.the first place.
Therefore, if you write the code AS CLEVERLY ASTherefore, if you write the code AS CLEVERLY AS
POSSIBLE, you are by DEFINITION, not smartPOSSIBLE, you are by DEFINITION, not smart
enough to debug it.enough to debug it.
-- Brian Kernighan-- Brian Kernighan
Tools used for debugging
Tools used for debugging
Tools used for debugging
LDDLDD
$ ldd
$ ldd -r
$ ldd -v
STRACESTRACE
Tools used for debugging
stracestrace
-o logfile
-f follow
-s string size
-p PID
-n NUM
stracestrace
-e
trace=open (syscall)
trace=file
trace=network
trace=desc
LTRACELTRACE
Nasty bugsNasty bugs
-o logfile
-f follow
-p PID
-n 4
$ ltrace -n 4 sed -v
-l library
{[+-][symbol_pattern][@library_pattern]}
GDBGDB
Tools used for debugging
GDB ­ GNU debuggerGDB ­ GNU debugger
$ gcc -g$ gcc -g
➢ backtrace (bt)backtrace (bt)
➢ bt with core.dumpbt with core.dump
➢ frameframe
➢ printprint
GDB configurationGDB configuration
➢set follow-fork-mode childset follow-fork-mode child
➢parent - do not trace the childparent - do not trace the child
➢child - trace the child alsochild - trace the child also
➢ask - ask the userask - ask the user
GDB configurationGDB configuration
Should we stop the trace after exec ?Should we stop the trace after exec ?
➢set follow-exec-mode newset follow-exec-mode new
➢ new - follow the new processnew - follow the new process
➢ same - keep the same processsame - keep the same process
GDB configurationGDB configuration
Should we trace the child processes?Should we trace the child processes?
➢set detach-on-fork onset detach-on-fork on
➢ on - detach the child processon - detach the child process
➢ off - do not detachoff - do not detach
Въпроси?Въпроси?
Мариян HackMan MarinovМариян HackMan Marinov
E-Mail:E-Mail: mm@1h.commm@1h.com
IRC: irc.freenode.net HackManIRC: irc.freenode.net HackMan
ICQ: 7556201ICQ: 7556201
Jabber/Gtalk:Jabber/Gtalk: hackman@jabber.orghackman@jabber.org
http://github.com/hackman/http://github.com/hackman/

More Related Content

ODP
Perl dancer
PDF
Backing up thousands of containers
PDF
Eduardo Silva - monkey http-server everywhere
PDF
T.Pollak y C.Yaconi - Prey
PDF
A little systemtap
PDF
Velocity 2011 - Our first DDoS attack
PDF
Haproxy - zastosowania
Perl dancer
Backing up thousands of containers
Eduardo Silva - monkey http-server everywhere
T.Pollak y C.Yaconi - Prey
A little systemtap
Velocity 2011 - Our first DDoS attack
Haproxy - zastosowania

What's hot (20)

PDF
PyGotham 2014 Introduction to Profiling
PDF
Rails Deployment with NginX
PDF
Performance comparison of Distributed File Systems on 1Gbit networks
ODP
WebSockets with PHP: Mission impossible
PDF
Improve your storage with bcachefs
DOC
X64服务器 lnmp服务器部署标准 new
PDF
Control your service resources with systemd
ODP
Varnish: Making eZ Publish sites fly
PDF
Dev ops
PDF
Nginx + PHP
PDF
5 issues
PDF
Максим Барышиков-«WoT: Geographically distributed cluster of clusters»
PPTX
PPTX
PDF
Django and Nginx reverse proxy cache
PDF
SiteGround Tech TeamBuilding
PDF
톰캣 #04-환경설정
PDF
Scaling WordPress
KEY
Genkidama:実装と課題
PPTX
Windows kernel debugging workshop in florida
PyGotham 2014 Introduction to Profiling
Rails Deployment with NginX
Performance comparison of Distributed File Systems on 1Gbit networks
WebSockets with PHP: Mission impossible
Improve your storage with bcachefs
X64服务器 lnmp服务器部署标准 new
Control your service resources with systemd
Varnish: Making eZ Publish sites fly
Dev ops
Nginx + PHP
5 issues
Максим Барышиков-«WoT: Geographically distributed cluster of clusters»
Django and Nginx reverse proxy cache
SiteGround Tech TeamBuilding
톰캣 #04-환경설정
Scaling WordPress
Genkidama:実装と課題
Windows kernel debugging workshop in florida
Ad

Viewers also liked (8)

PDF
Maintaining Linux kernel patches away from upstream
ODP
Why it is important to FAIL?
PDF
Network namespaces
ODP
Pulseaudio
PDF
Linux Containers
PDF
How penetration testing techniques can help you improve your qa skills
PPTX
LUG-BG - Kostadin Slavkov - PostgreSQL 10
PDF
Protecting your home and office in the era of IoT
Maintaining Linux kernel patches away from upstream
Why it is important to FAIL?
Network namespaces
Pulseaudio
Linux Containers
How penetration testing techniques can help you improve your qa skills
LUG-BG - Kostadin Slavkov - PostgreSQL 10
Protecting your home and office in the era of IoT
Ad

Similar to Tools used for debugging (20)

PPTX
Java/Scala Lab 2016. Владимир Гарбуз: Написание безопасного кода на Java.
PDF
Metasploit: Pwnage and Ponies
PDF
DoS and DDoS mitigations with eBPF, XDP and DPDK
PPT
Security & ethical hacking p2
PDF
Securing Rails
PDF
Filip palian mateuszkocielski. simplest ownage human observed… routers
PDF
Simplest-Ownage-Human-Observed… - Routers
PDF
An Express Guide ~ SNMP for Secure Rremote Resource Monitoring
PPT
Sp Security 101 Primer 2 1
PDF
Intrusion Techniques
PPT
Security & ethical hacking
ODP
BSides Algiers - Nmap Scripting Engine - Hani Benhabiles
PDF
How to manage your data in Node.js API
PDF
Pentesting111111 Cheat Sheet_OSCP_2023.pdf
PDF
PDF Offensive Security V3 Linuxhackingid (New Version)
PPTX
Data compression in Modern Application
PDF
The Dirty Little Secrets They Didn’t Teach You In Pentesting Class
PDF
WordPress Security - A Top Down Approach
PDF
A Battle Against the Industry - Beating Antivirus for Meterpreter and More
Java/Scala Lab 2016. Владимир Гарбуз: Написание безопасного кода на Java.
Metasploit: Pwnage and Ponies
DoS and DDoS mitigations with eBPF, XDP and DPDK
Security & ethical hacking p2
Securing Rails
Filip palian mateuszkocielski. simplest ownage human observed… routers
Simplest-Ownage-Human-Observed… - Routers
An Express Guide ~ SNMP for Secure Rremote Resource Monitoring
Sp Security 101 Primer 2 1
Intrusion Techniques
Security & ethical hacking
BSides Algiers - Nmap Scripting Engine - Hani Benhabiles
How to manage your data in Node.js API
Pentesting111111 Cheat Sheet_OSCP_2023.pdf
PDF Offensive Security V3 Linuxhackingid (New Version)
Data compression in Modern Application
The Dirty Little Secrets They Didn’t Teach You In Pentesting Class
WordPress Security - A Top Down Approach
A Battle Against the Industry - Beating Antivirus for Meterpreter and More

More from Marian Marinov (20)

PDF
How to start and then move forward in IT
PDF
Thinking about highly-available systems and their setup
PDF
Understanding your memory usage under Linux
PDF
How to implement PassKeys in your application
PDF
Dev.bg DevOps March 2024 Monitoring & Logging
PDF
Basic presentation of cryptography mechanisms
PDF
Microservices: Benefits, drawbacks and are they for me?
PDF
Introduction and replication to DragonflyDB
PDF
Message Queuing - Gearman, Mosquitto, Kafka and RabbitMQ
PDF
How to successfully migrate to DevOps .pdf
PDF
How to survive in the work from home era
PDF
Managing sysadmins
PDF
Comparison of-foss-distributed-storage
PDF
Защо и как да обогатяваме знанията си?
PDF
Securing your MySQL server
PDF
Sysadmin vs. dev ops
PDF
Challenges with high density networks
PDF
SiteGround building automation
PDF
Preventing cpu side channel attacks with kernel tracking
PDF
Managing a lot of servers
How to start and then move forward in IT
Thinking about highly-available systems and their setup
Understanding your memory usage under Linux
How to implement PassKeys in your application
Dev.bg DevOps March 2024 Monitoring & Logging
Basic presentation of cryptography mechanisms
Microservices: Benefits, drawbacks and are they for me?
Introduction and replication to DragonflyDB
Message Queuing - Gearman, Mosquitto, Kafka and RabbitMQ
How to successfully migrate to DevOps .pdf
How to survive in the work from home era
Managing sysadmins
Comparison of-foss-distributed-storage
Защо и как да обогатяваме знанията си?
Securing your MySQL server
Sysadmin vs. dev ops
Challenges with high density networks
SiteGround building automation
Preventing cpu side channel attacks with kernel tracking
Managing a lot of servers

Recently uploaded (20)

PPTX
L1 - Introduction to python Backend.pptx
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
PTS Company Brochure 2025 (1).pdf.......
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PPTX
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PDF
top salesforce developer skills in 2025.pdf
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PPT
Introduction Database Management System for Course Database
PPTX
Reimagine Home Health with the Power of Agentic AI​
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
Digital Strategies for Manufacturing Companies
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PPTX
Transform Your Business with a Software ERP System
PDF
System and Network Administration Chapter 2
PDF
medical staffing services at VALiNTRY
L1 - Introduction to python Backend.pptx
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PTS Company Brochure 2025 (1).pdf.......
CHAPTER 2 - PM Management and IT Context
How to Migrate SBCGlobal Email to Yahoo Easily
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
top salesforce developer skills in 2025.pdf
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Introduction Database Management System for Course Database
Reimagine Home Health with the Power of Agentic AI​
wealthsignaloriginal-com-DS-text-... (1).pdf
2025 Textile ERP Trends: SAP, Odoo & Oracle
Digital Strategies for Manufacturing Companies
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Transform Your Business with a Software ERP System
System and Network Administration Chapter 2
medical staffing services at VALiNTRY

Tools used for debugging