SlideShare ist ein Scribd-Unternehmen logo
1 von 14
Downloaden Sie, um offline zu lesen
PHILIPP SCHUBERT, RICHARD LEER,
BEN HERMANN, AND ERIC BODDEN
STATIC ANALYSIS
AIDS UNDERSTANDING
HOW INSTRUMENTATION
KNOW YOUR ANALYSIS:
Static analysis development
Ø Frameworks
Ø And many more …
Ø Type hierarchy struct Other : Super { void f() override {}};
Ø Pointer Super *S = new Other;
Ø Call-graph S->f();
Ø What we are interested in here: Data-flow
KNOW YOUR ANALYSIS
UNDERSTANDING STATIC ANALYSIS
2
Encoding a Data-Flow Analysis
3
KNOW YOUR ANALYSIS
A. Rules
B. Flow functions
Ø Complex and demanding task
Ø Specify parameters
Ø Precision vs scalability
Ø Solving the data-flow problem
Ø e.g. imperative framework
Ø Call-string approach
Ø Summary approach
Ø e.g. IFDS / IDE / WPDS
Ø Multiple steps involved
Ø Test cases / analysis code are developed
incrementally
Implement Evaluate Optimize
Concrete
Analysis
Framework
UNDERSTANDING STATIC ANALYSIS
Focus
4
KNOW YOUR ANALYSIS
UNDERSTANDING STATIC ANALYSIS
Static Program Analysis of
Programs written in C/C++
statement s
Λ 𝑑#$ 𝑑#% … 𝑑#'
Λ 𝑑($ 𝑑(% … 𝑑()
(𝜆𝑥. 𝑥)
Analysis encoding in IFDS/IDE style
What makes debugging these analyses hard?
5
KNOW YOUR ANALYSIS
UNDERSTANDING STATIC ANALYSIS
Ø Complex algorithms and concepts
Ø Data-flow solvers / engines
Ø Framework parametrization
Ø Real-world target programs
Ø Intermediate representation(s)
Ø OS’s default limits
Ø Interactions of all of the above
Ø Standard debugging techniques not
sufficient
Ø Debugger à large portions of
framework code
Ø Logger à huge log files
Ø Dynamic analysis à expensive
Ø Testing à outlandish corner
cases
PerformAnce Measurement Mechanism (PAMM)
6
KNOW YOUR ANALYSIS
UNDERSTANDING STATIC ANALYSIS
Ø Ready-to-use mechanism
Ø Timer, Counter, Histograms
Ø Implemented as a singleton
Ø Registration of arbitrary measures
Ø Instrumentation wrapped in macros
Ø Multiple measures can be grouped
Ø Variable amount of details
Ø Export reports in JSON
Ø Visualize using Python Pandas
void foo() {
PAMM_FACTORY;
REG_HISTOGRAM("MyHist");
std::set<int> res = compute();
ADD_TO_HIST("MyHist",
res.size(), 1);
}
void bar() {
PAMM_FACTORY;
while(...) {
START_TIMER("MyTimer");
// Code to be timed
PAUSE_TIMER("MyTimer");
}
}
Fully instrumented
framework
Instrumentable
analysis
Narrowing the bug(s)
KNOW YOUR ANALYSIS
UNDERSTANDING STATIC ANALYSIS
7
Ø Run PhASAR on Coreutils
Ø Runs > 20k call-sites likely to fail
Ø Runs > 240k instructions fail
Ø Recursive IFDS/IDE solver
implementation
Ø OS stack limit problematic
Ø Increasing stack fixed most
failures
Ø Remaining runs could be
debugged using standard
debugger
Finding anomalies
KNOW YOUR ANALYSIS
UNDERSTANDING STATIC ANALYSIS
8
Ø # of data-flow facts propagated
through the program (ESG edges)
Ø Outliers sets
Ø Generating several tens/hundreds
of facts is unreasonable
Ø “Over-tainting” in one flow function
Ø Generated all context-insensitive
aliases at a store instruction
Optimizing for container types
Ø Most sets are small
Ø Use more compact set
implementation like
boost::flatset
Ø Not relevant
Ø More copying or
accessing would be
required
KNOW YOUR ANALYSIS
UNDERSTANDING STATIC ANALYSIS
9
Using shared pointers for memory allocation
Ø std::shared_ptr
Ø How bad are they?
Ø Difference is noticeable
Ø Introduction of a manager class
(owner)
Ø Manager hands out raw-pointers
Ø Cleans up at end of life time
KNOW YOUR ANALYSIS
UNDERSTANDING STATIC ANALYSIS
10
Revealing the runtime distribution
Ø Precise runtime distribution
Ø What to sacrifice / optimize?
KNOW YOUR ANALYSIS
UNDERSTANDING STATIC ANALYSIS
11
1000 s = 16.67 min
Evaluating the data-flow domain
Ø Summary reuse
Ø Indicator for
domain quality
12
KNOW YOUR ANALYSIS
UNDERSTANDING STATIC ANALYSIS
How can we help analysis / framework developers?
Ø Combine debugging techniques
Ø Debugger, logger, runtime analysis, instrumentation, data visualization
Ø Do not burden developers with yet more work
Ø We need ready-to-use mechanisms / techniques
Ø Instrument and visualize what happens in an analysis run
Ø Spot anomalies and implausible figures
Ø Evaluate analysis performance
Ø VisuFlow static analysis debugger
Ø Separation of concerns
Ø What is your experience in debugging static analysis?
13
KNOW YOUR ANALYSIS
UNDERSTANDING STATIC ANALYSIS
http://lisanqd.com/wp-content/uploads/2018/02/icse18demo.pdf
http://www.thewhitespace.de/publications/lh15-design.pdf
Using PhASAR and PAMM
Ø PhASAR is open-source (MIT license)
Ø Find us on
Ø https://phasar.org
Ø Get in touch to discuss ideas and problems
Ø Use it, report bugs / issues, help us improve PhASAR
philipp.schubert@upb.de
ben.hermann@upb.de
14
KNOW YOUR ANALYSIS
UNDERSTANDING STATIC ANALYSIS
@phasarframework

Weitere ähnliche Inhalte

Ähnlich wie Know Your Analysis: How Instrumentation Aids Static Analysis

Pragmatic Optimization in Modern Programming - Ordering Optimization Approaches
Pragmatic Optimization in Modern Programming - Ordering Optimization ApproachesPragmatic Optimization in Modern Programming - Ordering Optimization Approaches
Pragmatic Optimization in Modern Programming - Ordering Optimization ApproachesMarina Kolpakova
 
Stored-Procedures-Presentation
Stored-Procedures-PresentationStored-Procedures-Presentation
Stored-Procedures-PresentationChuck Walker
 
Writting Better Software
Writting Better SoftwareWritting Better Software
Writting Better Softwaresvilen.ivanov
 
Leveraging Open Source to Manage SAN Performance
Leveraging Open Source to Manage SAN PerformanceLeveraging Open Source to Manage SAN Performance
Leveraging Open Source to Manage SAN Performancebrettallison
 
[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdf
[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdf[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdf
[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdfSteve Caron
 
Kill mysql-performance
Kill mysql-performanceKill mysql-performance
Kill mysql-performancekriptonium
 
Don't you (forget about me) - PHP Meetup Lisboa 2023
Don't you (forget about me) - PHP Meetup Lisboa 2023Don't you (forget about me) - PHP Meetup Lisboa 2023
Don't you (forget about me) - PHP Meetup Lisboa 2023Bernd Alter
 
Challenges and patterns for semantics at scale
Challenges and patterns for semantics at scaleChallenges and patterns for semantics at scale
Challenges and patterns for semantics at scaleRob Vesse
 
MySQL Optimizer: What's New in 8.0
MySQL Optimizer: What's New in 8.0MySQL Optimizer: What's New in 8.0
MySQL Optimizer: What's New in 8.0Manyi Lu
 
Survey of Program Transformation Technologies
Survey of Program Transformation TechnologiesSurvey of Program Transformation Technologies
Survey of Program Transformation TechnologiesChunhua Liao
 
C++14 - Modern Programming for Demanding Times
C++14 - Modern Programming for Demanding TimesC++14 - Modern Programming for Demanding Times
C++14 - Modern Programming for Demanding TimesCarlos Miguel Ferreira
 
Craftsmanship in Computational Work
Craftsmanship in Computational WorkCraftsmanship in Computational Work
Craftsmanship in Computational WorkYung-Yu Chen
 
SFScon 22 - Fiete Lüer - Heading towards reproducible machine learning resear...
SFScon 22 - Fiete Lüer - Heading towards reproducible machine learning resear...SFScon 22 - Fiete Lüer - Heading towards reproducible machine learning resear...
SFScon 22 - Fiete Lüer - Heading towards reproducible machine learning resear...South Tyrol Free Software Conference
 
MySQL Monitoring Mechanisms
MySQL Monitoring MechanismsMySQL Monitoring Mechanisms
MySQL Monitoring MechanismsMark Leith
 
MySQL Monitoring Mechanisms
MySQL Monitoring MechanismsMySQL Monitoring Mechanisms
MySQL Monitoring MechanismsMark Leith
 
Fundamentals of Data Structures Unit 1.pptx
Fundamentals of Data Structures Unit 1.pptxFundamentals of Data Structures Unit 1.pptx
Fundamentals of Data Structures Unit 1.pptxVigneshkumar Ponnusamy
 
My Database Skills Killed the Server
My Database Skills Killed the ServerMy Database Skills Killed the Server
My Database Skills Killed the ServerColdFusionConference
 

Ähnlich wie Know Your Analysis: How Instrumentation Aids Static Analysis (20)

Pragmatic Optimization in Modern Programming - Ordering Optimization Approaches
Pragmatic Optimization in Modern Programming - Ordering Optimization ApproachesPragmatic Optimization in Modern Programming - Ordering Optimization Approaches
Pragmatic Optimization in Modern Programming - Ordering Optimization Approaches
 
Stored-Procedures-Presentation
Stored-Procedures-PresentationStored-Procedures-Presentation
Stored-Procedures-Presentation
 
Writting Better Software
Writting Better SoftwareWritting Better Software
Writting Better Software
 
Leveraging Open Source to Manage SAN Performance
Leveraging Open Source to Manage SAN PerformanceLeveraging Open Source to Manage SAN Performance
Leveraging Open Source to Manage SAN Performance
 
[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdf
[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdf[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdf
[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdf
 
Ch23 system administration
Ch23 system administration Ch23 system administration
Ch23 system administration
 
Core java
Core javaCore java
Core java
 
Kill mysql-performance
Kill mysql-performanceKill mysql-performance
Kill mysql-performance
 
Don't you (forget about me) - PHP Meetup Lisboa 2023
Don't you (forget about me) - PHP Meetup Lisboa 2023Don't you (forget about me) - PHP Meetup Lisboa 2023
Don't you (forget about me) - PHP Meetup Lisboa 2023
 
Challenges and patterns for semantics at scale
Challenges and patterns for semantics at scaleChallenges and patterns for semantics at scale
Challenges and patterns for semantics at scale
 
MySQL Optimizer: What's New in 8.0
MySQL Optimizer: What's New in 8.0MySQL Optimizer: What's New in 8.0
MySQL Optimizer: What's New in 8.0
 
Survey of Program Transformation Technologies
Survey of Program Transformation TechnologiesSurvey of Program Transformation Technologies
Survey of Program Transformation Technologies
 
C++14 - Modern Programming for Demanding Times
C++14 - Modern Programming for Demanding TimesC++14 - Modern Programming for Demanding Times
C++14 - Modern Programming for Demanding Times
 
Sql ppt
Sql pptSql ppt
Sql ppt
 
Craftsmanship in Computational Work
Craftsmanship in Computational WorkCraftsmanship in Computational Work
Craftsmanship in Computational Work
 
SFScon 22 - Fiete Lüer - Heading towards reproducible machine learning resear...
SFScon 22 - Fiete Lüer - Heading towards reproducible machine learning resear...SFScon 22 - Fiete Lüer - Heading towards reproducible machine learning resear...
SFScon 22 - Fiete Lüer - Heading towards reproducible machine learning resear...
 
MySQL Monitoring Mechanisms
MySQL Monitoring MechanismsMySQL Monitoring Mechanisms
MySQL Monitoring Mechanisms
 
MySQL Monitoring Mechanisms
MySQL Monitoring MechanismsMySQL Monitoring Mechanisms
MySQL Monitoring Mechanisms
 
Fundamentals of Data Structures Unit 1.pptx
Fundamentals of Data Structures Unit 1.pptxFundamentals of Data Structures Unit 1.pptx
Fundamentals of Data Structures Unit 1.pptx
 
My Database Skills Killed the Server
My Database Skills Killed the ServerMy Database Skills Killed the Server
My Database Skills Killed the Server
 

Kürzlich hochgeladen

Bioteknologi kelas 10 kumer smapsa .pptx
Bioteknologi kelas 10 kumer smapsa .pptxBioteknologi kelas 10 kumer smapsa .pptx
Bioteknologi kelas 10 kumer smapsa .pptx023NiWayanAnggiSriWa
 
Four Spheres of the Earth Presentation.ppt
Four Spheres of the Earth Presentation.pptFour Spheres of the Earth Presentation.ppt
Four Spheres of the Earth Presentation.pptJoemSTuliba
 
The dark energy paradox leads to a new structure of spacetime.pptx
The dark energy paradox leads to a new structure of spacetime.pptxThe dark energy paradox leads to a new structure of spacetime.pptx
The dark energy paradox leads to a new structure of spacetime.pptxEran Akiva Sinbar
 
User Guide: Pulsar™ Weather Station (Columbia Weather Systems)
User Guide: Pulsar™ Weather Station (Columbia Weather Systems)User Guide: Pulsar™ Weather Station (Columbia Weather Systems)
User Guide: Pulsar™ Weather Station (Columbia Weather Systems)Columbia Weather Systems
 
Citronella presentation SlideShare mani upadhyay
Citronella presentation SlideShare mani upadhyayCitronella presentation SlideShare mani upadhyay
Citronella presentation SlideShare mani upadhyayupadhyaymani499
 
Pests of Blackgram, greengram, cowpea_Dr.UPR.pdf
Pests of Blackgram, greengram, cowpea_Dr.UPR.pdfPests of Blackgram, greengram, cowpea_Dr.UPR.pdf
Pests of Blackgram, greengram, cowpea_Dr.UPR.pdfPirithiRaju
 
Call Girls in Majnu Ka Tilla Delhi 🔝9711014705🔝 Genuine
Call Girls in Majnu Ka Tilla Delhi 🔝9711014705🔝 GenuineCall Girls in Majnu Ka Tilla Delhi 🔝9711014705🔝 Genuine
Call Girls in Majnu Ka Tilla Delhi 🔝9711014705🔝 Genuinethapagita
 
Vision and reflection on Mining Software Repositories research in 2024
Vision and reflection on Mining Software Repositories research in 2024Vision and reflection on Mining Software Repositories research in 2024
Vision and reflection on Mining Software Repositories research in 2024AyushiRastogi48
 
Microteaching on terms used in filtration .Pharmaceutical Engineering
Microteaching on terms used in filtration .Pharmaceutical EngineeringMicroteaching on terms used in filtration .Pharmaceutical Engineering
Microteaching on terms used in filtration .Pharmaceutical EngineeringPrajakta Shinde
 
THE ROLE OF PHARMACOGNOSY IN TRADITIONAL AND MODERN SYSTEM OF MEDICINE.pptx
THE ROLE OF PHARMACOGNOSY IN TRADITIONAL AND MODERN SYSTEM OF MEDICINE.pptxTHE ROLE OF PHARMACOGNOSY IN TRADITIONAL AND MODERN SYSTEM OF MEDICINE.pptx
THE ROLE OF PHARMACOGNOSY IN TRADITIONAL AND MODERN SYSTEM OF MEDICINE.pptxNandakishor Bhaurao Deshmukh
 
Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...
Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...
Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...lizamodels9
 
FREE NURSING BUNDLE FOR NURSES.PDF by na
FREE NURSING BUNDLE FOR NURSES.PDF by naFREE NURSING BUNDLE FOR NURSES.PDF by na
FREE NURSING BUNDLE FOR NURSES.PDF by naJASISJULIANOELYNV
 
REVISTA DE BIOLOGIA E CIÊNCIAS DA TERRA ISSN 1519-5228 - Artigo_Bioterra_V24_...
REVISTA DE BIOLOGIA E CIÊNCIAS DA TERRA ISSN 1519-5228 - Artigo_Bioterra_V24_...REVISTA DE BIOLOGIA E CIÊNCIAS DA TERRA ISSN 1519-5228 - Artigo_Bioterra_V24_...
REVISTA DE BIOLOGIA E CIÊNCIAS DA TERRA ISSN 1519-5228 - Artigo_Bioterra_V24_...Universidade Federal de Sergipe - UFS
 
Pests of jatropha_Bionomics_identification_Dr.UPR.pdf
Pests of jatropha_Bionomics_identification_Dr.UPR.pdfPests of jatropha_Bionomics_identification_Dr.UPR.pdf
Pests of jatropha_Bionomics_identification_Dr.UPR.pdfPirithiRaju
 
User Guide: Capricorn FLX™ Weather Station
User Guide: Capricorn FLX™ Weather StationUser Guide: Capricorn FLX™ Weather Station
User Guide: Capricorn FLX™ Weather StationColumbia Weather Systems
 
Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Base editing, prime editing, Cas13 & RNA editing and organelle base editing
Base editing, prime editing, Cas13 & RNA editing and organelle base editingBase editing, prime editing, Cas13 & RNA editing and organelle base editing
Base editing, prime editing, Cas13 & RNA editing and organelle base editingNetHelix
 
Pests of Bengal gram_Identification_Dr.UPR.pdf
Pests of Bengal gram_Identification_Dr.UPR.pdfPests of Bengal gram_Identification_Dr.UPR.pdf
Pests of Bengal gram_Identification_Dr.UPR.pdfPirithiRaju
 
(9818099198) Call Girls In Noida Sector 14 (NOIDA ESCORTS)
(9818099198) Call Girls In Noida Sector 14 (NOIDA ESCORTS)(9818099198) Call Girls In Noida Sector 14 (NOIDA ESCORTS)
(9818099198) Call Girls In Noida Sector 14 (NOIDA ESCORTS)riyaescorts54
 
《Queensland毕业文凭-昆士兰大学毕业证成绩单》
《Queensland毕业文凭-昆士兰大学毕业证成绩单》《Queensland毕业文凭-昆士兰大学毕业证成绩单》
《Queensland毕业文凭-昆士兰大学毕业证成绩单》rnrncn29
 

Kürzlich hochgeladen (20)

Bioteknologi kelas 10 kumer smapsa .pptx
Bioteknologi kelas 10 kumer smapsa .pptxBioteknologi kelas 10 kumer smapsa .pptx
Bioteknologi kelas 10 kumer smapsa .pptx
 
Four Spheres of the Earth Presentation.ppt
Four Spheres of the Earth Presentation.pptFour Spheres of the Earth Presentation.ppt
Four Spheres of the Earth Presentation.ppt
 
The dark energy paradox leads to a new structure of spacetime.pptx
The dark energy paradox leads to a new structure of spacetime.pptxThe dark energy paradox leads to a new structure of spacetime.pptx
The dark energy paradox leads to a new structure of spacetime.pptx
 
User Guide: Pulsar™ Weather Station (Columbia Weather Systems)
User Guide: Pulsar™ Weather Station (Columbia Weather Systems)User Guide: Pulsar™ Weather Station (Columbia Weather Systems)
User Guide: Pulsar™ Weather Station (Columbia Weather Systems)
 
Citronella presentation SlideShare mani upadhyay
Citronella presentation SlideShare mani upadhyayCitronella presentation SlideShare mani upadhyay
Citronella presentation SlideShare mani upadhyay
 
Pests of Blackgram, greengram, cowpea_Dr.UPR.pdf
Pests of Blackgram, greengram, cowpea_Dr.UPR.pdfPests of Blackgram, greengram, cowpea_Dr.UPR.pdf
Pests of Blackgram, greengram, cowpea_Dr.UPR.pdf
 
Call Girls in Majnu Ka Tilla Delhi 🔝9711014705🔝 Genuine
Call Girls in Majnu Ka Tilla Delhi 🔝9711014705🔝 GenuineCall Girls in Majnu Ka Tilla Delhi 🔝9711014705🔝 Genuine
Call Girls in Majnu Ka Tilla Delhi 🔝9711014705🔝 Genuine
 
Vision and reflection on Mining Software Repositories research in 2024
Vision and reflection on Mining Software Repositories research in 2024Vision and reflection on Mining Software Repositories research in 2024
Vision and reflection on Mining Software Repositories research in 2024
 
Microteaching on terms used in filtration .Pharmaceutical Engineering
Microteaching on terms used in filtration .Pharmaceutical EngineeringMicroteaching on terms used in filtration .Pharmaceutical Engineering
Microteaching on terms used in filtration .Pharmaceutical Engineering
 
THE ROLE OF PHARMACOGNOSY IN TRADITIONAL AND MODERN SYSTEM OF MEDICINE.pptx
THE ROLE OF PHARMACOGNOSY IN TRADITIONAL AND MODERN SYSTEM OF MEDICINE.pptxTHE ROLE OF PHARMACOGNOSY IN TRADITIONAL AND MODERN SYSTEM OF MEDICINE.pptx
THE ROLE OF PHARMACOGNOSY IN TRADITIONAL AND MODERN SYSTEM OF MEDICINE.pptx
 
Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...
Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...
Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...
 
FREE NURSING BUNDLE FOR NURSES.PDF by na
FREE NURSING BUNDLE FOR NURSES.PDF by naFREE NURSING BUNDLE FOR NURSES.PDF by na
FREE NURSING BUNDLE FOR NURSES.PDF by na
 
REVISTA DE BIOLOGIA E CIÊNCIAS DA TERRA ISSN 1519-5228 - Artigo_Bioterra_V24_...
REVISTA DE BIOLOGIA E CIÊNCIAS DA TERRA ISSN 1519-5228 - Artigo_Bioterra_V24_...REVISTA DE BIOLOGIA E CIÊNCIAS DA TERRA ISSN 1519-5228 - Artigo_Bioterra_V24_...
REVISTA DE BIOLOGIA E CIÊNCIAS DA TERRA ISSN 1519-5228 - Artigo_Bioterra_V24_...
 
Pests of jatropha_Bionomics_identification_Dr.UPR.pdf
Pests of jatropha_Bionomics_identification_Dr.UPR.pdfPests of jatropha_Bionomics_identification_Dr.UPR.pdf
Pests of jatropha_Bionomics_identification_Dr.UPR.pdf
 
User Guide: Capricorn FLX™ Weather Station
User Guide: Capricorn FLX™ Weather StationUser Guide: Capricorn FLX™ Weather Station
User Guide: Capricorn FLX™ Weather Station
 
Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝
 
Base editing, prime editing, Cas13 & RNA editing and organelle base editing
Base editing, prime editing, Cas13 & RNA editing and organelle base editingBase editing, prime editing, Cas13 & RNA editing and organelle base editing
Base editing, prime editing, Cas13 & RNA editing and organelle base editing
 
Pests of Bengal gram_Identification_Dr.UPR.pdf
Pests of Bengal gram_Identification_Dr.UPR.pdfPests of Bengal gram_Identification_Dr.UPR.pdf
Pests of Bengal gram_Identification_Dr.UPR.pdf
 
(9818099198) Call Girls In Noida Sector 14 (NOIDA ESCORTS)
(9818099198) Call Girls In Noida Sector 14 (NOIDA ESCORTS)(9818099198) Call Girls In Noida Sector 14 (NOIDA ESCORTS)
(9818099198) Call Girls In Noida Sector 14 (NOIDA ESCORTS)
 
《Queensland毕业文凭-昆士兰大学毕业证成绩单》
《Queensland毕业文凭-昆士兰大学毕业证成绩单》《Queensland毕业文凭-昆士兰大学毕业证成绩单》
《Queensland毕业文凭-昆士兰大学毕业证成绩单》
 

Know Your Analysis: How Instrumentation Aids Static Analysis

  • 1. PHILIPP SCHUBERT, RICHARD LEER, BEN HERMANN, AND ERIC BODDEN STATIC ANALYSIS AIDS UNDERSTANDING HOW INSTRUMENTATION KNOW YOUR ANALYSIS:
  • 2. Static analysis development Ø Frameworks Ø And many more … Ø Type hierarchy struct Other : Super { void f() override {}}; Ø Pointer Super *S = new Other; Ø Call-graph S->f(); Ø What we are interested in here: Data-flow KNOW YOUR ANALYSIS UNDERSTANDING STATIC ANALYSIS 2
  • 3. Encoding a Data-Flow Analysis 3 KNOW YOUR ANALYSIS A. Rules B. Flow functions Ø Complex and demanding task Ø Specify parameters Ø Precision vs scalability Ø Solving the data-flow problem Ø e.g. imperative framework Ø Call-string approach Ø Summary approach Ø e.g. IFDS / IDE / WPDS Ø Multiple steps involved Ø Test cases / analysis code are developed incrementally Implement Evaluate Optimize Concrete Analysis Framework UNDERSTANDING STATIC ANALYSIS
  • 4. Focus 4 KNOW YOUR ANALYSIS UNDERSTANDING STATIC ANALYSIS Static Program Analysis of Programs written in C/C++ statement s Λ 𝑑#$ 𝑑#% … 𝑑#' Λ 𝑑($ 𝑑(% … 𝑑() (𝜆𝑥. 𝑥) Analysis encoding in IFDS/IDE style
  • 5. What makes debugging these analyses hard? 5 KNOW YOUR ANALYSIS UNDERSTANDING STATIC ANALYSIS Ø Complex algorithms and concepts Ø Data-flow solvers / engines Ø Framework parametrization Ø Real-world target programs Ø Intermediate representation(s) Ø OS’s default limits Ø Interactions of all of the above Ø Standard debugging techniques not sufficient Ø Debugger à large portions of framework code Ø Logger à huge log files Ø Dynamic analysis à expensive Ø Testing à outlandish corner cases
  • 6. PerformAnce Measurement Mechanism (PAMM) 6 KNOW YOUR ANALYSIS UNDERSTANDING STATIC ANALYSIS Ø Ready-to-use mechanism Ø Timer, Counter, Histograms Ø Implemented as a singleton Ø Registration of arbitrary measures Ø Instrumentation wrapped in macros Ø Multiple measures can be grouped Ø Variable amount of details Ø Export reports in JSON Ø Visualize using Python Pandas void foo() { PAMM_FACTORY; REG_HISTOGRAM("MyHist"); std::set<int> res = compute(); ADD_TO_HIST("MyHist", res.size(), 1); } void bar() { PAMM_FACTORY; while(...) { START_TIMER("MyTimer"); // Code to be timed PAUSE_TIMER("MyTimer"); } } Fully instrumented framework Instrumentable analysis
  • 7. Narrowing the bug(s) KNOW YOUR ANALYSIS UNDERSTANDING STATIC ANALYSIS 7 Ø Run PhASAR on Coreutils Ø Runs > 20k call-sites likely to fail Ø Runs > 240k instructions fail Ø Recursive IFDS/IDE solver implementation Ø OS stack limit problematic Ø Increasing stack fixed most failures Ø Remaining runs could be debugged using standard debugger
  • 8. Finding anomalies KNOW YOUR ANALYSIS UNDERSTANDING STATIC ANALYSIS 8 Ø # of data-flow facts propagated through the program (ESG edges) Ø Outliers sets Ø Generating several tens/hundreds of facts is unreasonable Ø “Over-tainting” in one flow function Ø Generated all context-insensitive aliases at a store instruction
  • 9. Optimizing for container types Ø Most sets are small Ø Use more compact set implementation like boost::flatset Ø Not relevant Ø More copying or accessing would be required KNOW YOUR ANALYSIS UNDERSTANDING STATIC ANALYSIS 9
  • 10. Using shared pointers for memory allocation Ø std::shared_ptr Ø How bad are they? Ø Difference is noticeable Ø Introduction of a manager class (owner) Ø Manager hands out raw-pointers Ø Cleans up at end of life time KNOW YOUR ANALYSIS UNDERSTANDING STATIC ANALYSIS 10
  • 11. Revealing the runtime distribution Ø Precise runtime distribution Ø What to sacrifice / optimize? KNOW YOUR ANALYSIS UNDERSTANDING STATIC ANALYSIS 11 1000 s = 16.67 min
  • 12. Evaluating the data-flow domain Ø Summary reuse Ø Indicator for domain quality 12 KNOW YOUR ANALYSIS UNDERSTANDING STATIC ANALYSIS
  • 13. How can we help analysis / framework developers? Ø Combine debugging techniques Ø Debugger, logger, runtime analysis, instrumentation, data visualization Ø Do not burden developers with yet more work Ø We need ready-to-use mechanisms / techniques Ø Instrument and visualize what happens in an analysis run Ø Spot anomalies and implausible figures Ø Evaluate analysis performance Ø VisuFlow static analysis debugger Ø Separation of concerns Ø What is your experience in debugging static analysis? 13 KNOW YOUR ANALYSIS UNDERSTANDING STATIC ANALYSIS http://lisanqd.com/wp-content/uploads/2018/02/icse18demo.pdf http://www.thewhitespace.de/publications/lh15-design.pdf
  • 14. Using PhASAR and PAMM Ø PhASAR is open-source (MIT license) Ø Find us on Ø https://phasar.org Ø Get in touch to discuss ideas and problems Ø Use it, report bugs / issues, help us improve PhASAR philipp.schubert@upb.de ben.hermann@upb.de 14 KNOW YOUR ANALYSIS UNDERSTANDING STATIC ANALYSIS @phasarframework