Understanding and Detecting Real-World Performance Bugs

Slides:



Advertisements
Similar presentations
Spatial Computation Thesis committee: Seth Goldstein Peter Lee Todd Mowry Babak Falsafi Nevin Heintze Ph.D. Thesis defense, December 8, 2003 SCS Mihai.
Advertisements

Lazy Asynchronous I/O For Event-Driven Servers Khaled Elmeleegy, Anupam Chanda and Alan L. Cox Department of Computer Science Rice University, Houston,
Chapter 6 Writing a Program
Chapter 26 Legacy Systems.
Chapter 7 Constructors and Other Tools. Copyright © 2006 Pearson Addison-Wesley. All rights reserved. 7-2 Learning Objectives Constructors Definitions.
TRAMP Workshop Some Challenges Facing Transactional Memory Craig Zilles and Lee Baugh University of Illinois at Urbana-Champaign.
Software Transactional Objects Guy Eddon Maurice Herlihy TRAMP 2007.
Myra Shields Training Manager Introduction to OvidSP.
Exploring Traversal Strategy for Web Forum Crawling Yida Wang, Jiang-Ming Yang, Wei Lai, Rui Cai, Lei Zhang and Wei-Ying Ma Chinese Academy of Sciences.
The Impact of Soft Resource Allocation on n-tier Application Scalability Qingyang Wang, Simon Malkowski, Yasuhiko Kanemasa, Deepal Jayasinghe, Pengcheng.
MicroDot Softwares Welcome to the Presentation of MicroDot Deckle Planner.
Knowledge Extraction from Technical Documents Knowledge Extraction from Technical Documents *With first class-support for Feature Modeling Rehan Rauf,
The view from space Last weekend in Los Angeles, a few miles from my apartment…
1 Automating Auto Tuning Jeffrey K. Hollingsworth University of Maryland
© Telcordia Technologies 2004 – All Rights Reserved AETG Web Service Advanced Features AETG is a service mark of Telcordia Technologies. Telcordia Technologies.
Chapter 1 Object Oriented Programming 1. OOP revolves around the concept of an objects. Objects are created using the class definition. Programming techniques.
Legacy Systems Older software systems that remain vital to an organisation.
Introduction to Compilation of Functional Languages Wanhe Zhang Computing and Software Department McMaster University 16 th, March, 2004.
IBM JIT Compilation Technology AOT Compilation in a Dynamic Environment for Startup Time Improvement Kenneth Ma Marius Pirvu Oct. 30, 2008.
Copyright © 2003 by Prentice Hall Computers: Tools for an Information Age Chapter 15 Programming and Languages: Telling the Computer What to Do.
Xiao Zhang and Wenliang Du Dept. of Electrical Engineering & Computer Science Syracuse University.
RollCaller: User-Friendly Indoor Navigation System Using Human-Item Spatial Relation Yi Guo, Lei Yang, Bowen Li, Tianci Liu, Yunhao Liu Hong Kong University.
CS527: Advanced Topics in Software Engineering (Software Testing and Analysis) Darko Marinov September 18, 2008.
SATE 2010 Background Vadim Okun, NIST October 1, 2010 The SAMATE Project
Guoliang Jin, Linhai Song, Wei Zhang, Shan Lu, and Ben Liblit University of Wisconsin–Madison Automated Atomicity- Violation Fixing.
David Brumley, Pongsin Poosankam, Dawn Song and Jiang Zheng Presented by Nimrod Partush.
Reasons to study concepts of PL
Microsoft Research Faculty Summit Yuanyuan(YY) Zhou Associate Professor University of Illinois, Urbana-Champaign.
Improving Network Applications Security: a New Heuristic to Generate Stress Testing Data Presented by Conrad Pack Del Grosso et al.
Leveraging User Interactions for In-Depth Testing of Web Applications Sean McAllister, Engin Kirda, and Christopher Kruegel RAID ’08 1 Seoyeon Kang November.
Statistical Critical Path Selection for Timing Validation Kai Yang, Kwang-Ting Cheng, and Li-C Wang Department of Electrical and Computer Engineering University.
Generative Programming. Generic vs Generative Generic Programming focuses on representing families of domain concepts Generic Programming focuses on representing.
/* iComment: Bugs or Bad Comments? */
Learning From Mistakes—A Comprehensive Study on Real World Concurrency Bug Characteristics Shan Lu, Soyeon Park, Eunsoo Seo and Yuanyuan Zhou Appeared.
SQLite BY Jordan Smith Brian Wetzel Chris Hull William Anderson.
An Empirical Study of Client-Side JavaScript Bugs Frolin S. Ocariza, Jr. Kartik Bajaj, Karthik Pattabiraman, Ali Mesbah University of British Columbia.
XFindBugs: eXtended FindBugs for AspectJ Haihao Shen, Sai Zhang, Jianjun Zhao, Jianhong Fang, Shiyuan Yao Software Theory and Practice Group (STAP) Shanghai.
Mining Function Usage Patterns to Find Bugs Chadd Williams.
CSCE 548 Code Review. CSCE Farkas2 Reading This lecture: – McGraw: Chapter 4 – Recommended: Best Practices for Peer Code Review,
University of Maryland Bug Driven Bug Finding Chadd Williams.
1 Computing Software. Programming Style Programs that are not documented internally, while they may do what is requested, can be difficult to understand.
Important ESDIS 2009 tasks review Kent Yang, Mike Folk The HDF Group April 1st, /1/20151Annual briefing to ESDIS.
Computer Measurement Group, India Optimal Design Principles for better Performance of Next generation Systems Balachandar Gurusamy,
Plug-in System for the Xylia Extensible XML Editor Student: Jonathan Milley Supervisor: Dr. T. S. Norvell.
Uncovering the Multicore Processor Bottlenecks Server Design Summit Shay Gal-On Director of Technology, EEMBC.
LOOM: Bypassing Races in Live Applications with Execution Filters Jingyue Wu, Heming Cui, Junfeng Yang Columbia University 1.
Pallavi Joshi* Mayur Naik † Koushik Sen* David Gay ‡ *UC Berkeley † Intel Labs Berkeley ‡ Google Inc.
What Change History Tells Us about Thread Synchronization RUI GU, GUOLIANG JIN, LINHAI SONG, LINJIE ZHU, SHAN LU UNIVERSITY OF WISCONSIN – MADISON, USA.
CS527 Topics in Software Engineering (Software Testing and Analysis) Darko Marinov September 9, 2010.
Axel Naumann. Outline  Static Code Analysis  Coverity  Reporting Tools, Report Quality  "Demo": Examples Axel Naumann Application Area Meeting2.
Evolutionary Art with Multiple Expression Programming By Quentin Freeman.
Functional Verification of Dynamically Reconfigurable Systems Mr. Lingkan (George) Gong, Dr. Oliver Diessel The University of New South Wales, Australia.
1 Test Selection for Result Inspection via Mining Predicate Rules Wujie Zheng
Detecting and Eliminating Potential Violation of Sequential Consistency for concurrent C/C++ program Duan Yuelu, Feng Xiaobing, Pen-chung Yew.
StealthTest: Low Overhead Online Software Testing Using Transactional Memory Jayaram Bobba, Weiwei Xiong*, Luke Yen †, Mark D. Hill, and David A. Wood.
+ Moving Targets: Security and Rapid-Release in Firefox Presented by Carlos Bernal-Cárdenas.
CAPP: Change-Aware Preemption Prioritization Vilas Jagannath, Qingzhou Luo, Darko Marinov Sep 6 th 2011.
Software Development Introduction
1 Validating Library Usage Interactively William Harris, Guoliang Jin, Shan Lu, and Somesh Jha.
Soyeon Park, Shan Lu, Yuanyuan Zhou UIUC Reading Group by Theo.
VM: Chapter 7 Buffer Overflows. csci5233 computer security & integrity (VM: Ch. 7) 2 Outline Impact of buffer overflows What is a buffer overflow? Types.
Learning A Better Compiler Predicting Unroll Factors using Supervised Classification And Integrating CPU and L2 Cache Voltage Scaling using Machine Learning.
BEACH 04J. Piedra1 SiSA Tracking Silicon stand alone (SiSA) tracking optimization SiSA validation Matthew Herndon University of Wisconsin Joint Physics.
1 Titanium Review: Language and Compiler Amir Kamil Titanium Language and Compiler Changes Amir Kamil U.C. Berkeley September.
Iceberg: A Tool for Static Analysis of Java Critical Sections Michael D. Shah, Samuel Z. Guyer Tufts University Soap Workshop Session II, 10:50-11:10am,
Learning from Mistakes: A Comprehensive Study on Real-World Concurrency Bug Characteristics Ben Shelton.
CSC 591/791 Reliable Software Systems
Methodology & Current Results
The Challenge of Cross - Language Interoperability
Understanding Real-World Concurrency Bugs in Go
Presentation transcript:

Understanding and Detecting Real-World Performance Bugs Guoliang Jin, Linhai Song, Xiaoming Shi, Joel Scherpelz and Shan Lu University of Wisconsin–Madison

Software Efficiency is Critical No one wants slow and inefficient software Frustrate end users Cause economic loss Software efficiency is increasing important Hardware is not getting faster (per-core) Software is getting more complex Energy saving is getting more urgent Still Not Finished?

Performance Bugs Implementation mistakes causing inefficiency An example many open tabs Bookmark All Tabs…

Performance Bugs Implementation mistakes causing inefficiency An example number of tabs Buggy Code Snippet: for (i = 0; i < tabs.length; i++) { … tabs[i].doTransact(); } Bookmark one URL

Performance Bugs Implementation mistakes causing inefficiency An example    Buggy Code Snippet: Patch for (i = 0; i < tabs.length; i++) { … tabs[i].doTransact(); } + doAggregateTransact(tabs);

Need to Fight Performance Bugs Performance bugs are severe Escaping compiler optimization Large speed up after fixing small code regions E.g. “hang disappear” after fixing in the last bug Performance bugs are common 5 to 50 Mozilla perf bugs are fixed each month

How to fight Performance Bugs Detection Bug Avoidance Bug Fixing Performance Testing

How to fight Performance Bugs What are the root causes and locations of performance bugs? How are performance bugs introduced? Bug Detection Bug Avoidance Bug Fixing How do performance bugs manifest? How are performance bugs fixed? Performance Testing

Contribution 1st comprehensive study of real-world perf. Bugs Study 109 bugs from 5 applications Guide future performance bug research Rule-based bug detection Build 25 checkers Find 332 previously unknown PPPs Guide future performance bug detection

Outline Motivation Methodology Characteristics Study Rule-based Bug Detection Conclusion

Outline Motivation Methodology Characteristics Study Rule-based Bug Detection Conclusion Motivation Methodology Characteristics Study Rule-based Bug Detection Conclusion

Methodology Application and Bug Source Threats to Validity Total: 109 Bug DB History Application Software Type Language MLOC Tags # Bugs Command-line Utility + Server + Library Apache C/Java 0.45 13 y N/A 25 Chrome GUI Application C/C++ 14.0 4 y N/A 10 Compile-time-hog GCC Compiler C/C++ 5.7 13 y 10 Mozilla GUI Application C++/JS 4.7 14 y perf 36 MySQL Server Software C/C++/C# 1.3 10 y S5 28 Total: 109

Outline of Characteristics Study Root causes and locations? How performance bugs are introduced? How to patch performance bugs? How to expose performance bug?

Root Causes of Performance Bugs Performance Bug Detection

Root Causes of Performance Bugs Performance Bug Detection Dominating

Root Causes of Performance Bugs Mozilla Bug 490742 & Patch Performance Bug Detection for (i = 0; i < tabs.length; i++) { … tabs[i].doTransact(); } + doAggregateTransact(tabs);

Root Causes of Performance Bugs Performance Bug Detection nsImage::Draw(…) { … } + if(mIsTransparent) return; Mozilla Bug 66461

Root Causes of Performance Bugs Performance Bug Detection int fastmutex_lock (fmutex_t *mp){ - maxdelay += (double) random(); + maxdelay += (double) park_rng(); … } MySQL Bug 38941 & Patch

Root Causes of Performance Bugs Performance Bug Detection Implication: Future bug detection research should focus on these common root causes.

Locations of Performance Bugs Performance Bug Detection Implication: Detecting inefficiency in nested loops is critical.

How Performance Bugs are Introduced Performance Bug Avoidance Performance Bug Detection

How Performance Bugs are Introduced Performance Bug Avoidance Dominating

How Performance Bugs are Introduced int fastmutex_lock (fmutex_t *mp){ - maxdelay += (double) random(); + maxdelay += (double) park_rng(); … } Performance Bug Avoidance MySQL Bug 38941 & Patch

How Performance Bugs are Introduced Performance Bug Avoidance nsImage::Draw(…) { … } + if(mIsTransparent) return; Not Born Buggy! Mozilla Bug 66461

How Performance Bugs are Introduced Performance Bug Avoidance Implication: Performance aware annotation systems and change-impact analysis tools are needed.

How Performance Bugs Manifest Performance Testing Performance Bug Avoidance

How Performance Bugs Manifest Performance Testing Unique, severe

How Performance Bugs Manifest Performance Testing Special Feature Large Scale

How Performance Bugs Manifest Performance Testing Implication: New input generation tools are needed.

How Performance Bugs are Fixed Performance Testing Performance Bug Fixing

How Performance Bugs are Fixed Performance Bug Fixing Patch sizes are small 42 patches are no larger than 5 LOC Median patch size = 8 lines of codes Fixing perf. bugs does not hurt readability

Other Characteristics Performance bugs hide for a long time Server vs. Client; Java vs. C/C++ More server bugs caused by synch. issues Others are consistent Correlations among characteristic categories skippable function root cause change condition fix

Outline Motivation Methodology Characteristics Study Rule-based Bug Detection Conclusion Motivation Methodology Characteristics Study Rule-based Bug Detection Conclusion

Efficiency Rules An efficiency rule includes two parts A transformation that improves code efficiency An applying condition of the transformation Rules applicable to only one application Rules applicable cross application Mozilla Bug 490742 & Patch int fastmutex_lock (fmutex_t *mp){ - maxdelay += (double) random(); + maxdelay += (double) park_rng(); … } for (i = 0; i < tabs.length; i++) { … tabs[i].doTransact(); } + doAggregateTransact(tabs); MySQL Bug 38941 & Patch

Heuristics to Evaluate Efficiency rules widely exist Rule violations can be statically checked Violations to efficiency rules widely exist

Rule Extraction and Checker Implementation Identifying Efficiency Rules Python Checkers LLVM Checkers Not Contain Rules Dynamic Rules

Rule-Violation Detection Results 17 checkers find PPPs in original buggy versions 13 checkers find 332 PPPs in latest versions Found by cross-application checking Introduced later Inherits from buggy versions Efficiency rules and rule-based performance-bug detection is promising! * PPP: Potential Performance Problem

Conclusions and Future Work First characteristics study on performance bugs Paper contains more details (contact us for more) Efficiency rules are useful Future work Alabama: dynamically detect inefficiency in nested loops Alabama has found severe previously unknown inefficiency

Thanks a lot!

Questions? Findings Implications Skippable Functions and Uncoordinated Functions are most common root causes. Inefficiency detection should focus on these common patterns. Most bugs involve nested loops. Most bugs are introduced by Workload Mismatch and API Misunderstanding. Inefficiency avoidance needs performance annotations and change-impact analysis. 29 out of 109 bugs were not born buggy. Many bug-exposing inputs need special features and large scales. Test-input generation should consider coverage + intensity. Most patches are a few lines of code. Efficiency != bad readability Similar mistakes are made in many places by many developers in many software. Efficiency rules are important! Bugs involve nested loops are common and severe. Alabama detects inefficiency in nested loops.