Turning Eclipse Against Itself: Finding Errors in Eclipse Sources Benjamin Livshits Stanford University.

Slides:



Advertisements
Similar presentations
Locating Matching Method Calls by Mining Revision History Data Benjamin Livshits Stanford University and Thomas Zimmermann Saarland University.
Advertisements

Author: Carlos Pacheco, Shuvendu K. Lahiri, Michael D. Ernst, Thomas Ball MIT CSAIL.
High level QA strategy for SQL Server enforcer
OO Programming in Java Objectives for today: Overriding the toString() method Polymorphism & Dynamic Binding Interfaces Packages and Class Path.
Module 7: Advanced Development  GEM only slides here  Started on page 38 in SC09 version Module 77-0.
A Randomized Dynamic Program Analysis for Detecting Real Deadlocks Koushik Sen CS 265.
1 Perracotta: Mining Temporal API Rules from Imperfect Traces Jinlin Yang David Evans Deepali Bhardwaj Thirumalesh Bhat Manuvir Das.
Using Programmer-Written Compiler Extensions to Catch Security Holes Authors: Ken Ashcraft and Dawson Engler Presented by : Hong Chen CS590F 2/7/2007.
The Path to Multi-core Tools Paul Petersen. Multi-coreToolsThePathTo 2 Outline Motivation Where are we now What is easy to do next What is missing.
Finding Security Errors in Java Applications Using Lightweight Static Analysis Benjamin Livshits Computer Science Lab Stanford University.
© Andy Wellings, 2003 Roadmap  Introduction  Concurrent Programming  Communication and Synchronization  Completing the Java Model  Overview of the.
Presented by IBM developer Works ibm.com/developerworks/ 2006 January – April © 2006 IBM Corporation. Making the most of Creating Eclipse plug-ins.
Review David Rabinowitz. March 3rd, 2004 Object Oriented Design Course 2 Review What have we done during the course? Which topics we have not discussed?
Chapter 3.4 Programming Fundamentals. 2 Data Structures Arrays – Elements are adjacent in memory (great cache consistency) – They never grow or get reallocated.
Bug Session Two. Session description In this session the use of algorithms is reinforced to help pupils plan out what they will need to program on their.
Approaches to ---Testing Software Some of us “hope” that our software works as opposed to “ensuring” that our software works? Why? Just foolish Lazy Believe.
Applied Software Project Management Andrew Stellman & Jennifer Greene Applied Software Project Management Applied Software.
CS527: (Advanced) Topics in Software Engineering Overview of Software Quality Assurance Tao Xie ©D. Marinov, T. Xie.
S ECURITY T OOLS F OR S OFTWARE D EVELOPMENT F X C OP 10.0 David Angulo Rubio.
© Janice Regan, CMPT 128, Jan CMPT 128 Introduction to Computing Science for Engineering Students Creating a program.
University of Palestine software engineering department Testing of Software Systems Fundamentals of testing instructor: Tasneem Darwish.
© 2012 IBM Corporation Rational Insight | Back to Basis Series Chao Zhang Unit Testing.
CSCE 548 Code Review. CSCE Farkas2 Reading This lecture: – McGraw: Chapter 4 – Recommended: Best Practices for Peer Code Review,
Capture and Replay Often used for regression test development –Tool used to capture interactions with the system under test. –Inputs must be captured;
Chapter 3.5 Memory and I/O Systems. 2 Memory Management Memory problems are one of the leading causes of bugs in programs (60-80%) MUCH worse in languages.
The First in GPON Verification Classic Mistakes Verification Leadership Seminar Racheli Ganot FlexLight Networks.
Debugging in Java. Common Bugs Compilation or syntactical errors are the first that you will encounter and the easiest to debug They are usually the result.
Problem of the Day  Why are manhole covers round?
© 2006 IBM Corporation Agile Planning Web UI. © 2006 IBM Corporation Agenda  Overview of APT Web UI  Current Issues  Required Infrastructure  API.
Controlling Execution Programming Right from the Start with Visual Basic.NET 1/e 8.
Presented by IBM developer Works ibm.com/developerworks/ 2006 January – April © 2006 IBM Corporation. Making the most of The Eclipse debugger.
Eclipse Simple Profiler Ben Xu Mar 7,2011. About Eclipse simple profiler is a open source project to analyze your plug-ins/RCPs performance.
Chapter 7 Pointers: Java does not have pointers. Used for dynamic memory allocation.
CS 460/660 Compiler Construction. Class 01 2 Why Study Compilers? Compilers are important – –Responsible for many aspects of system performance Compilers.
CSCI Rational Purify 1 Rational Purify Overview Michel Izygon - Jim Helm.
Analysis trains – Status & experience from operation Mihaela Gheata.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University IWPSE 2003 Program.
Week 14 Introduction to Computer Science and Object-Oriented Programming COMP 111 George Basham.
JUnit Don Braffitt Updated: 10-Jun-2011.
Demo of Scalable Pluggable Types Michael Ernst MIT Dagstuhl Seminar “Scalable Program Analysis” April 17, 2008.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 4 Slide 1 Slide 1 What we'll cover here l Using the debugger: Starting the debugger Setting.
Click to edit Master text styles JavaMOP Hamid Reza Niroomand A presentation to Dr. Babamir.
Assoc. Prof. Dr. Ahmet Turan ÖZCERİT.  System and Software  System Engineering  Software Engineering  Software Engineering Standards  Software Development.
Plug-in Architectures Presented by Truc Nguyen. What’s a plug-in? “a type of program that tightly integrates with a larger application to add a special.
Detecting Inefficiently-Used Containers to Avoid Bloat Guoqing Xu and Atanas Rountev Department of Computer Science and Engineering Ohio State University.
Summer Project Marama2008 By Robert and Johnson. What is Marama? Marama is an Eclipses based toolset permits rapid specification of notational elements,
(c) University of Washington10-1 CSC 143 Java Errors and Exceptions Reading: Ch. 15.
T EST T OOLS U NIT VI This unit contains the overview of the test tools. Also prerequisites for applying these tools, tools selection and implementation.
Testing Concurrent Programs Sri Teja Basava Arpit Sud CSCI 5535: Fundamentals of Programming Languages University of Colorado at Boulder Spring 2010.
Lecture 4 Page 1 CS 111 Online Modularity and Memory Clearly, programs must have access to memory We need abstractions that give them the required access.
Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8 th Edition Chapter 4: Threads.
Some of the utilities associated with the development of programs. These program development tools allow users to write and construct programs that the.
CS 5150 Software Engineering Lecture 21 Reliability 2.
Programming and Debugging with the Dragon and JTAG Many thanks to Dr. James Hawthorne for evaluating the Dragon system and providing the core content for.
Findbugs Tin Bui-Huy September, Content What is bug? What is bug? What is Findbugs? What is Findbugs? How to use Findbugs? How to use Findbugs?
Jeremy Nimmer, page 1 Automatic Generation of Program Specifications Jeremy Nimmer MIT Lab for Computer Science Joint work with.
Dynamic Bug Detection & Tolerance Kathryn S McKinley The University of Texas at Austin.
SQL Database Management
CMSC 345 Defensive Programming Practices from Software Engineering 6th Edition by Ian Sommerville.
Introduction to Compiler Construction
YAHMD - Yet Another Heap Memory Debugger
Dept of Computer Science University of Maryland College Park
Effective Data-Race Detection for the Kernel
Experience with jemalloc
Modularity and Memory Clearly, programs must have access to memory
Introduction to Events
Designing with Java Exception Handling
Dynamic Program Analysis
Tonga Institute of Higher Education IT 141: Information Systems
Tonga Institute of Higher Education IT 141: Information Systems
Presentation transcript:

Turning Eclipse Against Itself: Finding Errors in Eclipse Sources Benjamin Livshits Stanford University

Summary We want to find errors in Eclipse –Implemented a tool called Checklipse (plugin) –Uses lightweight static analysis Looks for violations of 3 design rules –One API usage rule –Two resource management rules Preliminary results are encouraging –Ran Checklipse on Eclipse sources –Found a total of 68 likely errors –Checklipse checks multiple plugins in minutes Looking for more patterns to check

Eclipse Code Base… Eclipse: –One of the biggest Java projects ever written –Very robust Still, a multitude of bugs exist –bugs.eclipse.org – hundreds of known errors –Think about unknown ones! –Certain types of errors are repeatedly introduced over and over “Lapsed listener” errors discovered for different Eclipse releases

Error Patterns to the Rescue Lots of API-specific coding patterns –Patterns are “specified” using comments not at all –Misuse of these patterns leads to errors This is great news for us! –Discover what the error patterns are –Find and report pattern violations Can do so using dynamic or static analysis On to the error patterns… –3 patterns evaluated –Many more remain – looking to expand the scope of Checklipse

Error pattern #1: Call super A common rule of thumb in Eclipse code –For many methods m –A subclass implementing method m must call super.m(…) inside method m Must call super, but don’t Checklipse super checker

Error pattern #2: Failing to Dispose OS resource leaks are common: –Many classes define method dispose() –SWT design rule: dispose what you create Interesting special case: maps Need to clear most class-allocated maps in dispose() Failing to clear the maps, causes OS resource leaks Checklipse dispose checker Locally allocated maps Cleared Not cleared

Error pattern #3: Lapsed Listeners Properly registered and unregistered listener Not unregistered listener Memory leaks exist in Java, despite GC! Common case of memory leaks: –Listeners are used to register handlers for events, such as mouse clicks, etc. –Not un-registering listeners properly leads to memory leaks –Memory leaks lead to crashes and instability

Checking for Pattern Violations: How? Runtime or dynamic approaches –Aspects allow run time checking of rules –Memory profilers and debuggers –Custom-made tools: sleak by Steve Northover, the architect of SWT a tool to check for memory leaks in Eclipse code –But: violations need to be triggered during a particular execution! Instead, we analyze the Java source code of the plugins Advantages: –No need to consider a particular execution –So, can find all potential pattern violations

Static Analysis State of the Art Sound and complete analysis approaches –Suffer from imprecision – false positives –Don’t scale to code bases the size of Eclipse We use unsound lightweight static analysis –Runs fast – took several minutes to analyze 20 core Eclipse plugins –Produces false positives Takes time to filter the false positives –May miss errors

Why Lightweight Static Checking? Overall goal: –Address whole classes of problems –Better target debugging efforts of Eclipse developers Make it fast and easy to audit potential errors –User is presented with three custom viewers –One for each error pattern Extend super viewer Dispose rule viewer Lapsed listener viewer Can run analysis and fix the errors without ever leaving Eclipse So, what did we find?

We Find…

Status Implemented Checklipse –Working tool –Runs fast –Available for download suif.stanford.edu Find 68 likely errors –Many are hard to evaluate –Used our best judgement to determing what is an error –Need a strong knowledge of APIs

Future Work Looking for new patterns to check Happy to pass the errors over to IBM engineers Have a project to find and correct similar error patterns dynamically