CSCI 4931 - Rational Purify 1 Rational Purify Overview Michel Izygon - Jim Helm.

Slides:



Advertisements
Similar presentations
Lecture 2 - Introduction Objective C is used primarily for application development on Apple's Mac OS X and iPhone. On the Apple it is used together with.
Advertisements

Dynamic memory allocation
Various languages….  Could affect performance  Could affect reliability  Could affect language choice.
Managing Memory Static and Dynamic Memory Type Casts Allocating Arrays of Dynamic Size Resizing Block of Memory Returning Memory from a Function Avoiding.
1 Memory Allocation Professor Jennifer Rexford COS 217.
DYNAMIC MEMORY MANAGEMENT. int x; When the source code containing this statement is compiled and linked, an executable file is generated. When the executable.
Dynamic memory allocation. The process of allocating memory at run time is known as dynamic memory allocation. C have four library functions for allocating.
Hastings Purify: Fast Detection of Memory Leaks and Access Errors.
Dr. Fabrizio Gala Dipartimento di Scienze di Base e Applicate Per l’Ingegneria – Sezione di Fisica Via Scarpa Rome, Italy 1.
1 CHAPTER 8 BUFFER OVERFLOW. 2 Introduction One of the more advanced attack techniques is the buffer overflow attack Buffer Overflows occurs when software.
Informática II Prof. Dr. Gustavo Patiño MJ
CPSC 388 – Compiler Design and Construction
Chapter 8 Runtime Support. How program structures are implemented in a computer memory? The evolution of programming language design has led to the creation.
CSCI Tool Overview 1 Rational Suite of Tools Overview Michel Izygon - Jim Helm.
Memory Allocation. Three kinds of memory Fixed memory Stack memory Heap memory.
Memory Arrangement Memory is arrange in a sequence of addressable units (usually bytes) –sizeof( ) return the number of units it takes to store a type.
Run-Time Storage Organization
Pointers. Addresses in Memory When a variable is declared, enough memory to hold a value of that type is allocated for it at an unused memory location.
C and Data Structures Baojian Hua
ARRAYS AND POINTERS Although pointer types are not integer types, some integer arithmetic operators can be applied to pointers. The affect of this arithmetic.
CS 225 Lab #2 - Pointers, Copy Constructors, Destructors, and DDD.
1 Pointers, Dynamic Data, and Reference Types Review on Pointers Reference Variables Dynamic Memory Allocation –The new operator –The delete operator –Dynamic.
. Memory Management. Memory Organization u During run time, variables can be stored in one of three “pools”  Stack  Static heap  Dynamic heap.
Memory Layout C and Data Structures Baojian Hua
Pointers Applications
Addresses in Memory When a variable is declared, enough memory to hold a value of that type is allocated for it at an unused memory location. This is.
1 C - Memory Simple Types Arrays Pointers Pointer to Pointer Multi-dimensional Arrays Dynamic Memory Allocation.
Dynamic Memory Allocation The process of allocating memory at run time is known as dynamic memory allocation. C does not Inherently have this facility,
Computer Science and Software Engineering University of Wisconsin - Platteville 2. Pointer Yan Shi CS/SE2630 Lecture Notes.
Replay Compilation: Improving Debuggability of a Just-in Time Complier Presenter: Jun Tao.
C++ Data Types Structured array struct union class Address pointer reference Simple IntegralFloating char short int long enum float double long double.
Pointers and Dynamic Memory Allocation Copyright Kip Irvine 2003, all rights reserved. Revised 10/28/2003.
Dynamic Memory Allocation. Domain A subset of the total domain name space. A domain represents a level of the hierarchy in the Domain Name Space, and.
Pointers in C++. 7a-2 Pointers "pointer" is a basic type like int or double value of a pointer variable contains the location, or address in memory, of.
Prachi A. Joshi Assistant Professor in CSE DIEMS,Aurangabad Unit 1 : Basic Concepts Pointers and dynamic memory allocation, Algorithm Specification, Data.
® IBM Software Group © 2006 IBM Corporation PurifyPlus on Linux / Unix Vinay Kumar H S.
Dynamic Memory. We will follow different order from Course Book We will follow different order from Course Book First we will cover Sect The new.
Chapter 7 Pointers: Java does not have pointers. Used for dynamic memory allocation.
Agenda Attack Lab C Exercises C Conventions C Debugging
Pointers in C Computer Organization I 1 August 2009 © McQuain, Feng & Ribbens Memory and Addresses Memory is just a sequence of byte-sized.
Protecting C Programs from Attacks via Invalid Pointer Dereferences Suan Hsi Yong, Susan Horwitz University of Wisconsin – Madison.
+ Dynamic memory allocation. + Introduction We often face situations in programming where the data is dynamics in nature. Consider a list of customers.
Information Leaks Without Memory Disclosures: Remote Side Channel Attacks on Diversified Code Jeff Seibert, Hamed Okhravi, and Eric Söderström Presented.
1 Lecture07: Memory Model 5/2/2012 Slides modified from Yin Lou, Cornell CS2022: Introduction to C.
CMSC 202 Advanced Section Classes and Objects: Object Creation and Constructors.
CSc 352 Debugging Tools Saumya Debray Dept. of Computer Science The University of Arizona, Tucson
1 Debugging (Part 2). “Programming in the Large” Steps Design & Implement Program & programming style (done) Common data structures and algorithms Modularity.
1 Recall that... char str [ 8 ]; str is the base address of the array. We say str is a pointer because its value is an address. It is a pointer constant.
1 Chapter 15-1 Pointers, Dynamic Data, and Reference Types Dale/Weems.
Fall 2015CISC/CMPE320 - Prof. McLeod1 CISC/CMPE320 Assignment 3 is due Sunday, the 8 th at 7pm. Today: –Two simple binding examples. –Function Hiding.
Presented by Ted Higgins, SQL Server DBA C Programming - Pointers.
MORE POINTERS Plus: Memory Allocation Heap versus Stack.
Announcements Partial Credit Due Date for Assignment 2 now due on Sat, Feb 27 I always seem to be behind and get tons of daily. If you me and.
VM: Chapter 7 Buffer Overflows. csci5233 computer security & integrity (VM: Ch. 7) 2 Outline Impact of buffer overflows What is a buffer overflow? Types.
CSE 333 – SECTION 2 Memory Management. Questions, Comments, Concerns Do you have any? Exercises going ok? Lectures make sense? Homework 1 – START EARLY!
CSC Pointers Powerful feature of the C++ language One of the most difficult to master Essential for construction of interesting data structures.
Dynamic Allocation in C
Object Lifetime and Pointers
YAHMD - Yet Another Heap Memory Debugger
Debugging Memory Issues
ENERGY 211 / CME 211 Lecture 25 November 17, 2008.
Checking Memory Management
Chapter 15 Pointers, Dynamic Data, and Reference Types
Jihyun Park, Changsun Park, Byoungju Choi, Gihun Chang
CSc 352 Debugging Tools Saumya Debray Dept. of Computer Science
CETS: Compiler-Enforced Temporal Safety for C
Dynamic Memory.
Dynamic Memory – A Review
Run-time environments
SPL – PS2 C++ Memory Handling.
Presentation transcript:

CSCI Rational Purify 1 Rational Purify Overview Michel Izygon - Jim Helm

CSCI Rational Purify 2 Purify Tool supporting Testing/Reliability Diagnostics Locate hard to find run-time errors Start using as soon as code is written Languages: C, C++,

CSCI Rational Purify 3 Purify Key Features Detect following types of errors:  array bounds errrors  accesses through dangling pointer  uninitialized memory read  memory allocation errors  memory leaks Provide filtering and detail level customization GUI and command line interface Integrated with VC++, ClearQuest, TestFactory

CSCI Rational Purify 4 Runtime Debugger Technology Two main techniques:  Object Code Insertion : –Instrumentation of the code happens on the executable file –Involves the instrumentation of each object file and library by adding special instructions to every store and read instructions –Allow to debug even if you don’t have the source code  Source Code Insertion –Instrumentation of the code happens on the source file –Involves parsing, analyzing and conveting the original code into a new equivalent source code. Then Compile the new code. –Generally more accurate and has access to more information about the program pointers and meory blocks. Can detect errors at compile time also. Purify uses Object Code Insertion

CSCI Rational Purify 5 Array bounds errors Program writes memory past the bounds of an allocated block  example: Memory corrupted may be used much later in the program Symptom far away from the cause Program may behave in an unpredictable way, dependent upon the values accessed in the memory block corrupted. Purify reports Array Bounds Read and Array Bounds Write

CSCI Rational Purify 6 Accesses through dangling pointer Access to a freed dynamically allocated block of memory Outcome of program is unpredictable:  if memory block not reallocated, expected value might still be there, and program seems OK  if memory block reallocated program might fail, dependent on timing issues, memory allocation pattern,… Access can be a Read or a Write Purify reports Free Memory Read and Free Memory Write

CSCI Rational Purify 7 Uninitialized memory read Access to an allocated block of memory which has not yet been initialized. Outcome of program is unpredictable, depending on the context. If memory contains value remaining from previous memory use, program will behave erratically Purify reports Uninitialized Memory Read

CSCI Rational Purify 8 Memory allocation errors Memory allocated with new but freed with free may cause corruption of heap structures. If these structures are accessed, program can fail. Attempt to free a local variable on the stack might succeed and corrupt local variables or function return. Purify reports Freeing Mismatched Memory and Freeing Invalid Memory

CSCI Rational Purify 9 Memory leaks Memory allocated but never freed, and for which no pointers exist. Memory blocks cannot be used nor freed, and occupy address space. Performance of the program degrades and eventually it fails from lack of memory Purify reports Memory Leaks

CSCI Rational Purify 10 Other Features Filtering Messages Comparing program runs Just in time debugging API functions Submit Change Request to ClearQuest directly from Purify

CSCI Rational Purify 11 Caution Purify can detect memory corruption errors, but only in dynamic memory. Purify does not detect corruption on the stack or in static memory at all, because the fence technique only works for dynamic memory.