FACTOID # 15: A mere 0.8% of West Virginians were born in a foreign country.
 
 Home   Encyclopedia   Statistics   States A-Z   Flags   Maps   FAQ   About 
   
 
WHAT'S NEW
RELATED ARTICLES
People who viewed "Valgrind" also viewed:
 

SEARCH ALL

FACTS & STATISTICS    Advanced view

Search encyclopedia, statistics and forums:

 

 

(* = Graphable)

 

 


Encyclopedia > Valgrind
Valgrind
Developer: The valgrind Developers
Latest release: 3.2.3 / January 29, 2007
OS: x86/Linux, AMD64/Linux, PPC32/Linux and PPC64/Linux
Use: Profiler
License: GPL
Website: valgrind.org

Valgrind is a free programming tool for memory debugging, memory leak detection, and profiling. Image File history File links Valgrind_logo. ... Software development is the translation of a user need or marketing goal into a software product. ... A software release refers to the creation and availability of a new version of a computer software product. ... January 29 is the 29th day of the year in the Gregorian calendar. ... 2007 (MMVII) is the current year, a common year starting on Monday of the Gregorian calendar and the AD (or CE) era. ... An operating system (OS) is a computer program that manages the hardware and software resources of a computer. ... x86 or 80x86 is the generic name of a microprocessor architecture first developed and manufactured by Intel. ... Linux (IPA pronunciation: ) is a Unix-like computer operating system family that uses the Linux kernel. ... AMD64 Logo AMD64 (also x86-64 or x64) is a 64-bit microprocessor architecture and corresponding instruction set designed by Advanced Micro Devices. ... Linux (IPA pronunciation: ) is a Unix-like computer operating system family that uses the Linux kernel. ... Linux (IPA pronunciation: ) is a Unix-like computer operating system family that uses the Linux kernel. ... PowerPC is a RISC microprocessor architecture created by the 1991 Apple-IBM-Motorola alliance, known as AIM. Originally intended for workstations, PowerPC CPUs have since become popular embedded and high-performance processors as well. ... Linux (IPA pronunciation: ) is a Unix-like computer operating system family that uses the Linux kernel. ... In computer programming, a profiler is a computer program that can track the performance of another program by checking information collected while the code is executed . ... A software license is a legal agreement which may take the form of a proprietary or gratuitous license as well as a memorandum of contract between a producer and a user of computer software. ... The GNU logo The GNU General Public License (GNU GPL or simply GPL) is a widely-used free software license, originally written by Richard Stallman for the GNU project. ... A website (or Web site) is a collection of web pages, typically common to a particular domain name or subdomain on the World Wide Web on the Internet. ... This article is about free software as defined by the sociopolitical free software movement; for information on software distributed without charge, see freeware. ... A programming tool is a program or application that software developers use to create, debug, or maintain other programs and applications. ... A memory debugger is a programming tool for finding memory leaks and buffer overflows. ... In computer science, a memory leak is a particular kind of unintentional memory consumption by a computer program where the program fails to release memory when no longer needed. ... In software engineering, performance analysis (also known as dynamic program analysis) is the investigation of a programs behavior using information gathered as the program runs, as opposed to static code analysis. ...


Valgrind was originally designed to be a free memory debugging tool for Linux on x86, but has since evolved to become a generic framework for creating dynamic analysis tools such as checkers and profilers. It has an excellent reputation and is widely used by Linux programmers. [1] Linux (IPA pronunciation: ) is a Unix-like computer operating system family that uses the Linux kernel. ... x86 or 80x86 is the generic name of a microprocessor architecture first developed and manufactured by Intel. ...


The original author was Julian Seward. Several others have also made significant contributions; they include Cerion Armour-Brown, Jeremy Fitzhardinge, Tom Hughes, Nicholas Nethercote, Paul Mackerras, Dirk Mueller, Josef Weidendorfer and Robert Walsh. Julian Seward is a compiler hacker and open source contributor. ...

Contents

Overview

Valgrind is in essence a virtual machine using just-in-time (JIT) (aka Binary Translation) compilation techniques. Nothing from the original program ever gets run directly on the host processor. Instead, Valgrind first translates the program into a temporary, simpler form called IR, which is a processor-neutral, SSA-based intermediate representation. After the conversion, a tool (see below) is free to do whatever transformations it would like on the IR, before Valgrind translates the IR back into machine code and lets the host processor run it. A considerable amount of performance is lost in these transformations (and usually, the code the tool inserts); usually, code run with Valgrind and the "none" tool (which does nothing to the IR) runs 4-5 times slower than normal. However, the IR form is a lot more suitable for instrumentation, which makes it easier to write tools, and for most projects, a slowdown of this order is not a big problem during debugging. In computer science, a virtual machine is software that creates a virtualized environment between the computer platform and its operating system, so that the end user can operate software on an abstract machine. ... In computing, just-in-time compilation (JIT), also known as dynamic translation, is a technique for improving the performance of bytecode-compiled programming systems, by translating bytecode into native machine code at runtime. ... In compiler theory, static single assignment form, more often abbreviated SSA form or just SSA, is an intermediate representation (IR) in which every variable is assigned exactly once. ...


Tools

There are multiple tools included with Valgrind (and several external ones). The default (and most used) tool is Memcheck. Memcheck inserts extra instrumentation code around almost all instructions, which keeps track of the validity (all unallocated memory starts as invalid or "undefined", until it is initialized into a deterministic state, possibly from other memory) and addressability (whether the memory address in question points to an allocated, non-freed memory block), stored in the so-called V bits and A bits, respectively. As data is moved around or manipulated, the instrumentation code keeps track of the A and V bits so they are always correct on a single-bit level. (This is in contrast to Purify, which can only detect "uninitialized memory copy", which is in itself a valid operation. For instance, the X Window System client libraries frequently copy partly uninitialized structures around, which triggers large amounts of spurious alerts with Purify, forcing programmers to turn off the warnings for uninitialized memory copying.) Instrumentation is defined as the art and science of measurement and control. Instrumentation can be used to refer to the field in which Instrument technicians and engineers work, or it can refer to the available methods of measurement and control and the instruments which facilitate this. ... Purify is a memory debugger program used by software developers to detect memory access errors in programs, especially those written in C or C++. It was originally written by Reed Hastings of Pure Software. ... KDE 3. ...


In addition, Memcheck replaces the standard C memory allocator with its own implementation, which also includes memory guards around all allocated blocks (with the A bits set to "invalid"). This enables Memcheck to detect off-by-one bugs where a program reads or writes outside an allocated block by a small amount. (Other approaches to this problem include implemented bounded pointers in the compiler, which give lower chances of undetected errors, especially on memory that is allocated on the stack and not the heap, but requires recompiling all instrumented binary code.) All in all, this enables Memcheck to detect and warn about the following problems: An off-by-one error in computer programming is an avoidable error in which a loop iterates one too many or one too few times than desired. ... In computer science a bounded pointer is a pointer that is augmented with additional information that enable the storage bounds within which it may point to be deduced. ... In computer science, a call stack is a special stack which stores information about the active subroutines of a computer program. ... It has been suggested that this article or section be merged with Memory allocation. ...

  • Use of uninitialized memory
  • Reading/writing memory after it has been free'd
  • Reading/writing off the end of malloc'd blocks
  • Memory leaks
  • and more.

The price of this is lost performance; programs running under Memcheck usually run from five to twenty times as slow as running outside Valgrind, and use a lot more memory (there is a considerable memory penalty per-allocation). Thus, few developers would run their code under Memcheck (or any other Valgrind tool) all the time; the most common situations would be either to trace down some specific bug, or to verify there are no latent bugs (of the kind Memcheck can detect) in the code. In computer science, a memory leak is a particular kind of unintentional memory consumption by a computer program where the program fails to release memory when no longer needed. ...


In addition to Memcheck, Valgrind has several other tools, such as

  • Addrcheck, a lightweight cousin of Memcheck, running much faster and requiring less memory, but catching fewer types of bugs. This tool has been removed as of version 3.2.0.
  • Massif, a heap profiler.
  • Helgrind, a tool capable of detecting race conditions in multithreaded code.
  • Cachegrind, a cache profiler and its GUI KCacheGrind

There are also several externally developed tools available. A race hazard (or race condition) is a flaw in a system or process where the output exhibits unexpected critical dependence on the relative timing of events. ... Look up cache in Wiktionary, the free dictionary. ... GUI can refer to the following: GUI is short for graphical user interface, a term used to describe a type of interface in computing. ...


Platforms Supported

As of version 3.0.0, Valgrind supports Linux on x86, x86-64 and PowerPC. There are, however, unofficial ports to other UNIX-like platforms (like FreeBSD [1] and NetBSD [2]). There is no port for Microsoft Windows at the moment (nor are there any official short-term plans for one), but there is an experimental version capable of interfacing with WINE for debugging Windows software running on Linux. Increasing platform support is a long-term goal, but requires much work due to the nature of the project. Linux (IPA pronunciation: ) is a Unix-like computer operating system family that uses the Linux kernel. ... x86 or 80x86 is the generic name of a microprocessor architecture first developed and manufactured by Intel. ... The AMD64 or x86-64 is a 64-bit processor architecture invented by AMD. It is a superset of the x86 architecture, which it natively supports. ... IBM PowerPC 601 Microprocessor PowerPC is a RISC microprocessor architecture created by the 1991 Apple–IBM–Motorola alliance, known as AIM. Originally intended for personal computers, PowerPC CPUs have since become popular embedded and high-performance processors as well. ... FreeBSD is a Unix-like free operating system descended from AT&T UNIX via the Berkeley Software Distribution (BSD) branch through the 386BSD and 4. ... NetBSD is a freely redistributable, open source version of the Unix-like BSD computer operating system. ... Microsoft Windows is the name of several families of proprietary software operating systems by Microsoft. ... A glass of red wine This article is about the alcoholic beverage. ...


Notes

  1. ^ valgrind is used by several projects and has received several awards

External links

Free software Portal

  Results from FactBites:
 
Using Valgrind to Find Memory Leaks - Cprogramming.com (1698 words)
Valgrind is a multipurpose code profiling and memory debugging tool for Linux when on the x86 and, as of version 3, AMD64, architectures.
Valgrind is even smart enough to know that if a variable is assigned the value of an uninitialized variable, that that variable is still in an "uninitialized" state.
Valgrind allows the programmer to run the executable inside its own environment in which it checks for unpaired calls to malloc and other uses of invalid memory (such as ininitialized memory) or invalid memory operations (such as freeing a block of memory twice or calling the wrong deallocator function).
Valgrind HOWTO (4671 words)
Valgrind works directly with the executables, with no need to recompile, relink or modify the program to be checked.
Valgrind is closely tied to details of the CPU, operating system and to a less extent, compiler and basic C libraries.
Valgrind can simulate the cache, meaning it can display the things that occur in the cache when a program is running.
  More results at FactBites »

 
 

COMMENTARY     


Share your thoughts, questions and commentary here
Your name
Your comments

Want to know more?
Search encyclopedia, statistics and forums:

 


Press Releases |  Feeds | Contact
The Wikipedia article included on this page is licensed under the GFDL.
Images may be subject to relevant owners' copyright.
All other elements are (c) copyright NationMaster.com 2003-5. All Rights Reserved.
Usage implies agreement with terms, 1022, m