SlideShare a Scribd company logo
1 of 8
BinaryExe LLC
https://exebinary.wordpress.com/
How to use Valgrind
BinaryExe LLC
https://exebinary.wordpress.com/
Boundary Check
$ gcc -Wall -pedantic -g hello.c
$ valgrind ./a.out
==18584== Invalid write of size 4
==18584== at 0x400604: main (hello.c:9)
==18584== Address 0x52044a8 is 0 bytes after a block of size 40 alloc'd
==18584== at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-
linux.so)
==18584== by 0x4005D1: main (hello.c:6)
Va l g r i n d l o g
BinaryExe LLC
https://exebinary.wordpress.com/
Memory leak
$ gcc -Wall -pedantic -g hello.c
valgrind --leak-check=full
./a.out
BinaryExe LLC
https://exebinary.wordpress.com/
==18840== HEAP SUMMARY:
==18840== in use at exit: 40 bytes in 1 blocks
==18840== total heap usage: 3 allocs, 2 frees, 1,104 bytes allocated
==18840==
==18840== 40 bytes in 1 blocks are definitely lost in loss record 1 of 1
==18840== at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==18840== by 0x4005D1: main (hello.c:6)
==18840==
==18840== LEAK SUMMARY:
==18840== definitely lost: 40 bytes in 1 blocks
==18840== indirectly lost: 0 bytes in 0 blocks
==18840== possibly lost: 0 bytes in 0 blocks
==18840== still reachable: 0 bytes in 0 blocks
==18840== suppressed: 0 bytes in 0 blocks
==18840==
==18840== For counts of detected and suppressed errors, rerun with: -v
==18840== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
Va l g r i n d
l o g
BinaryExe LLC
https://exebinary.wordpress.com/
$ gcc -Wall -pedantic -g hello.c
valgrind --leak-check=full
./a.out
Access uninitialised variable
BinaryExe LLC
https://exebinary.wordpress.com/
==19095== Conditional jump or move depends on uninitialised value(s)
==19095== at 0x4E87B83: vfprintf (vfprintf.c:1631)
==19095== by 0x4E8F898: printf (printf.c:33)
==19095== by 0x40066A: main (hello.c:10)
==19095==
==19095== Use of uninitialised value of size 8
==19095== at 0x4E8476B: _itoa_word (_itoa.c:179)
==19095== by 0x4E8812C: vfprintf (vfprintf.c:1631)
==19095== by 0x4E8F898: printf (printf.c:33)
==19095== by 0x40066A: main (hello.c:10)
==19095==
==19095== Conditional jump or move depends on uninitialised value(s)
==19095== at 0x4E84775: _itoa_word (_itoa.c:179)
==19095== by 0x4E8812C: vfprintf (vfprintf.c:1631)
==19095== by 0x4E8F898: printf (printf.c:33)
==19095== by 0x40066A: main (hello.c:10)
...
==19095== ERROR SUMMARY: 8 errors from 8 contexts (suppressed: 0 from 0)
BinaryExe LLC
https://exebinary.wordpress.com/
What it doesn’t do?
 Static array boundary check
BinaryExe LLC
https://exebinary.wordpress.com/
Thanks
 If there is any question, send to
exebinary@gmail.com

More Related Content

What's hot

Anton Vasiljev: Continuations in Ruby.
Anton Vasiljev: Continuations in Ruby.Anton Vasiljev: Continuations in Ruby.
Anton Vasiljev: Continuations in Ruby.Sphere Consulting Inc
 
Mangling Ruby with TracePoint
Mangling Ruby with TracePointMangling Ruby with TracePoint
Mangling Ruby with TracePointMark
 
Pegomock, a mocking framework for Go
Pegomock, a mocking framework for GoPegomock, a mocking framework for Go
Pegomock, a mocking framework for GoPeter Goetz
 
Torchbearersnotebook.blogspot.com program to create a list in python and valu...
Torchbearersnotebook.blogspot.com program to create a list in python and valu...Torchbearersnotebook.blogspot.com program to create a list in python and valu...
Torchbearersnotebook.blogspot.com program to create a list in python and valu...SAKSHISINGH486
 
basic shell_programs
 basic shell_programs basic shell_programs
basic shell_programsmadhugvskr
 
Getting started with LLVM using Swift / Алексей Денисов (Blacklane)
Getting started with LLVM using Swift / Алексей Денисов (Blacklane)Getting started with LLVM using Swift / Алексей Денисов (Blacklane)
Getting started with LLVM using Swift / Алексей Денисов (Blacklane)Ontico
 
Damion Brown - The Missing Automation Layer - Superweek 2017
Damion Brown - The Missing Automation Layer - Superweek 2017Damion Brown - The Missing Automation Layer - Superweek 2017
Damion Brown - The Missing Automation Layer - Superweek 2017Damion Brown
 
C Programming Language Part 4
C Programming Language Part 4C Programming Language Part 4
C Programming Language Part 4Rumman Ansari
 
Array imp of list
Array imp of listArray imp of list
Array imp of listElavarasi K
 
Palindrome number program c
Palindrome number program cPalindrome number program c
Palindrome number program cmohdshanu
 
C언어 스터디 강의자료 - 1차시
C언어 스터디 강의자료 - 1차시C언어 스터디 강의자료 - 1차시
C언어 스터디 강의자료 - 1차시Junha Jang
 
Robot In OpenGL Using Line Function
Robot In OpenGL Using Line Function Robot In OpenGL Using Line Function
Robot In OpenGL Using Line Function Jannat Jamshed
 
Dti2143 lab sheet 8
Dti2143 lab sheet 8Dti2143 lab sheet 8
Dti2143 lab sheet 8alish sha
 
Data Structures : array operations in c program
Data Structures : array operations in c program Data Structures : array operations in c program
Data Structures : array operations in c program Raghavendra Narayan
 

What's hot (20)

Anton Vasiljev: Continuations in Ruby.
Anton Vasiljev: Continuations in Ruby.Anton Vasiljev: Continuations in Ruby.
Anton Vasiljev: Continuations in Ruby.
 
Mangling Ruby with TracePoint
Mangling Ruby with TracePointMangling Ruby with TracePoint
Mangling Ruby with TracePoint
 
Pegomock, a mocking framework for Go
Pegomock, a mocking framework for GoPegomock, a mocking framework for Go
Pegomock, a mocking framework for Go
 
Torchbearersnotebook.blogspot.com program to create a list in python and valu...
Torchbearersnotebook.blogspot.com program to create a list in python and valu...Torchbearersnotebook.blogspot.com program to create a list in python and valu...
Torchbearersnotebook.blogspot.com program to create a list in python and valu...
 
10740737 1599055096995598 1135912358_n
10740737 1599055096995598 1135912358_n10740737 1599055096995598 1135912358_n
10740737 1599055096995598 1135912358_n
 
basic shell_programs
 basic shell_programs basic shell_programs
basic shell_programs
 
Getting started with LLVM using Swift / Алексей Денисов (Blacklane)
Getting started with LLVM using Swift / Алексей Денисов (Blacklane)Getting started with LLVM using Swift / Алексей Денисов (Blacklane)
Getting started with LLVM using Swift / Алексей Денисов (Blacklane)
 
Damion Brown - The Missing Automation Layer - Superweek 2017
Damion Brown - The Missing Automation Layer - Superweek 2017Damion Brown - The Missing Automation Layer - Superweek 2017
Damion Brown - The Missing Automation Layer - Superweek 2017
 
C Programming Language Part 4
C Programming Language Part 4C Programming Language Part 4
C Programming Language Part 4
 
Array imp of list
Array imp of listArray imp of list
Array imp of list
 
Pratik Bakane C++
Pratik Bakane C++Pratik Bakane C++
Pratik Bakane C++
 
Es84
Es84Es84
Es84
 
Palindrome number program c
Palindrome number program cPalindrome number program c
Palindrome number program c
 
C언어 스터디 강의자료 - 1차시
C언어 스터디 강의자료 - 1차시C언어 스터디 강의자료 - 1차시
C언어 스터디 강의자료 - 1차시
 
Robot In OpenGL Using Line Function
Robot In OpenGL Using Line Function Robot In OpenGL Using Line Function
Robot In OpenGL Using Line Function
 
4. pointers, arrays
4. pointers, arrays4. pointers, arrays
4. pointers, arrays
 
Dti2143 lab sheet 8
Dti2143 lab sheet 8Dti2143 lab sheet 8
Dti2143 lab sheet 8
 
Data Structures : array operations in c program
Data Structures : array operations in c program Data Structures : array operations in c program
Data Structures : array operations in c program
 
Include
IncludeInclude
Include
 
Clojure lang
Clojure langClojure lang
Clojure lang
 

Similar to Valgrind docs - Boundary, leak, uninit checks

Fortran & Link with Library & Brief Explanation of MKL BLAS
Fortran & Link with Library & Brief Explanation of MKL BLASFortran & Link with Library & Brief Explanation of MKL BLAS
Fortran & Link with Library & Brief Explanation of MKL BLASJongsu "Liam" Kim
 
Writing Metasploit Plugins
Writing Metasploit PluginsWriting Metasploit Plugins
Writing Metasploit Pluginsamiable_indian
 
Verilog Lecture2 thhts
Verilog Lecture2 thhtsVerilog Lecture2 thhts
Verilog Lecture2 thhtsBéo Tú
 
Advanced Debugging Using Java Bytecodes
Advanced Debugging Using Java BytecodesAdvanced Debugging Using Java Bytecodes
Advanced Debugging Using Java BytecodesGanesh Samarthyam
 
Bytes in the Machine: Inside the CPython interpreter
Bytes in the Machine: Inside the CPython interpreterBytes in the Machine: Inside the CPython interpreter
Bytes in the Machine: Inside the CPython interpreterakaptur
 
An Embedded Error Recovery and Debugging Mechanism for Scripting Language Ext...
An Embedded Error Recovery and Debugging Mechanism for Scripting Language Ext...An Embedded Error Recovery and Debugging Mechanism for Scripting Language Ext...
An Embedded Error Recovery and Debugging Mechanism for Scripting Language Ext...David Beazley (Dabeaz LLC)
 
C++ memory leak detection
C++ memory leak detectionC++ memory leak detection
C++ memory leak detectionVõ Hòa
 
Checking Oracle VM VirtualBox. Part 1
Checking Oracle VM VirtualBox. Part 1Checking Oracle VM VirtualBox. Part 1
Checking Oracle VM VirtualBox. Part 1Andrey Karpov
 
Wap to implement bitwise operators
Wap to implement bitwise operatorsWap to implement bitwise operators
Wap to implement bitwise operatorsHarleen Sodhi
 
ReadyNow: Azul's Unconventional "AOT"
ReadyNow: Azul's Unconventional "AOT"ReadyNow: Azul's Unconventional "AOT"
ReadyNow: Azul's Unconventional "AOT"Doug Hawkins
 
computer notes - Data Structures - 25
computer notes - Data Structures - 25computer notes - Data Structures - 25
computer notes - Data Structures - 25ecomputernotes
 
Computer notes - Build Heap
Computer notes  - Build HeapComputer notes  - Build Heap
Computer notes - Build Heapecomputernotes
 
Crash_Report_Mechanism_In_Tizen
Crash_Report_Mechanism_In_TizenCrash_Report_Mechanism_In_Tizen
Crash_Report_Mechanism_In_TizenLex Yu
 
Feb crashlog
Feb crashlogFeb crashlog
Feb crashlogahmadyani
 
The forgotten art of assembly
The forgotten art of assemblyThe forgotten art of assembly
The forgotten art of assemblyMarian Marinov
 
EcmaScript unchained
EcmaScript unchainedEcmaScript unchained
EcmaScript unchainedEduard Tomàs
 

Similar to Valgrind docs - Boundary, leak, uninit checks (20)

Fortran & Link with Library & Brief Explanation of MKL BLAS
Fortran & Link with Library & Brief Explanation of MKL BLASFortran & Link with Library & Brief Explanation of MKL BLAS
Fortran & Link with Library & Brief Explanation of MKL BLAS
 
Valgrind
ValgrindValgrind
Valgrind
 
Writing Metasploit Plugins
Writing Metasploit PluginsWriting Metasploit Plugins
Writing Metasploit Plugins
 
Verilog Lecture2 thhts
Verilog Lecture2 thhtsVerilog Lecture2 thhts
Verilog Lecture2 thhts
 
Advanced Debugging Using Java Bytecodes
Advanced Debugging Using Java BytecodesAdvanced Debugging Using Java Bytecodes
Advanced Debugging Using Java Bytecodes
 
Bytes in the Machine: Inside the CPython interpreter
Bytes in the Machine: Inside the CPython interpreterBytes in the Machine: Inside the CPython interpreter
Bytes in the Machine: Inside the CPython interpreter
 
Debugging tools
Debugging toolsDebugging tools
Debugging tools
 
Scala to assembly
Scala to assemblyScala to assembly
Scala to assembly
 
An Embedded Error Recovery and Debugging Mechanism for Scripting Language Ext...
An Embedded Error Recovery and Debugging Mechanism for Scripting Language Ext...An Embedded Error Recovery and Debugging Mechanism for Scripting Language Ext...
An Embedded Error Recovery and Debugging Mechanism for Scripting Language Ext...
 
C++ memory leak detection
C++ memory leak detectionC++ memory leak detection
C++ memory leak detection
 
Checking Oracle VM VirtualBox. Part 1
Checking Oracle VM VirtualBox. Part 1Checking Oracle VM VirtualBox. Part 1
Checking Oracle VM VirtualBox. Part 1
 
Wap to implement bitwise operators
Wap to implement bitwise operatorsWap to implement bitwise operators
Wap to implement bitwise operators
 
Price of an Error
Price of an ErrorPrice of an Error
Price of an Error
 
ReadyNow: Azul's Unconventional "AOT"
ReadyNow: Azul's Unconventional "AOT"ReadyNow: Azul's Unconventional "AOT"
ReadyNow: Azul's Unconventional "AOT"
 
computer notes - Data Structures - 25
computer notes - Data Structures - 25computer notes - Data Structures - 25
computer notes - Data Structures - 25
 
Computer notes - Build Heap
Computer notes  - Build HeapComputer notes  - Build Heap
Computer notes - Build Heap
 
Crash_Report_Mechanism_In_Tizen
Crash_Report_Mechanism_In_TizenCrash_Report_Mechanism_In_Tizen
Crash_Report_Mechanism_In_Tizen
 
Feb crashlog
Feb crashlogFeb crashlog
Feb crashlog
 
The forgotten art of assembly
The forgotten art of assemblyThe forgotten art of assembly
The forgotten art of assembly
 
EcmaScript unchained
EcmaScript unchainedEcmaScript unchained
EcmaScript unchained
 

Recently uploaded

TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 

Recently uploaded (20)

TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 

Valgrind docs - Boundary, leak, uninit checks

  • 2. BinaryExe LLC https://exebinary.wordpress.com/ Boundary Check $ gcc -Wall -pedantic -g hello.c $ valgrind ./a.out ==18584== Invalid write of size 4 ==18584== at 0x400604: main (hello.c:9) ==18584== Address 0x52044a8 is 0 bytes after a block of size 40 alloc'd ==18584== at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64- linux.so) ==18584== by 0x4005D1: main (hello.c:6) Va l g r i n d l o g
  • 3. BinaryExe LLC https://exebinary.wordpress.com/ Memory leak $ gcc -Wall -pedantic -g hello.c valgrind --leak-check=full ./a.out
  • 4. BinaryExe LLC https://exebinary.wordpress.com/ ==18840== HEAP SUMMARY: ==18840== in use at exit: 40 bytes in 1 blocks ==18840== total heap usage: 3 allocs, 2 frees, 1,104 bytes allocated ==18840== ==18840== 40 bytes in 1 blocks are definitely lost in loss record 1 of 1 ==18840== at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==18840== by 0x4005D1: main (hello.c:6) ==18840== ==18840== LEAK SUMMARY: ==18840== definitely lost: 40 bytes in 1 blocks ==18840== indirectly lost: 0 bytes in 0 blocks ==18840== possibly lost: 0 bytes in 0 blocks ==18840== still reachable: 0 bytes in 0 blocks ==18840== suppressed: 0 bytes in 0 blocks ==18840== ==18840== For counts of detected and suppressed errors, rerun with: -v ==18840== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0) Va l g r i n d l o g
  • 5. BinaryExe LLC https://exebinary.wordpress.com/ $ gcc -Wall -pedantic -g hello.c valgrind --leak-check=full ./a.out Access uninitialised variable
  • 6. BinaryExe LLC https://exebinary.wordpress.com/ ==19095== Conditional jump or move depends on uninitialised value(s) ==19095== at 0x4E87B83: vfprintf (vfprintf.c:1631) ==19095== by 0x4E8F898: printf (printf.c:33) ==19095== by 0x40066A: main (hello.c:10) ==19095== ==19095== Use of uninitialised value of size 8 ==19095== at 0x4E8476B: _itoa_word (_itoa.c:179) ==19095== by 0x4E8812C: vfprintf (vfprintf.c:1631) ==19095== by 0x4E8F898: printf (printf.c:33) ==19095== by 0x40066A: main (hello.c:10) ==19095== ==19095== Conditional jump or move depends on uninitialised value(s) ==19095== at 0x4E84775: _itoa_word (_itoa.c:179) ==19095== by 0x4E8812C: vfprintf (vfprintf.c:1631) ==19095== by 0x4E8F898: printf (printf.c:33) ==19095== by 0x40066A: main (hello.c:10) ... ==19095== ERROR SUMMARY: 8 errors from 8 contexts (suppressed: 0 from 0)
  • 7. BinaryExe LLC https://exebinary.wordpress.com/ What it doesn’t do?  Static array boundary check
  • 8. BinaryExe LLC https://exebinary.wordpress.com/ Thanks  If there is any question, send to exebinary@gmail.com