155 results on '"Smart pointer"'
Search Results
2. C++ Programming Techniques in Finance
- Author
-
Carlos Augusto Fernandes de Oliveira
- Subjects
Set (abstract data type) ,Finance ,Computer science ,business.industry ,Control (management) ,Software development ,Smart pointer ,Extension (predicate logic) ,business - Abstract
The C++ language was created as an extension of C, which means that any program written in C is also a valid C++ program. However, experienced programmers typically make use of a set of high-level features made available exclusively in C++ as a way to control program complexity. This is an especially important consideration for financial software development, where we want to create fast and expressive applications.
- Published
- 2021
3. Detection of Memory Leaks in C/C++
- Author
-
Ankit Saxena, Raksha Agrawal, Riyanshi Gupta, Neha Kapil, Rahul Jain, and Rajat Kumar Jain
- Subjects
Structure (mathematical logic) ,Memory leak ,Computer science ,Code (cryptography) ,Smart pointer ,Software aging ,Parallel computing ,Disjoint sets ,Object (computer science) - Abstract
Memory leaks are one of the main reasons for Software Aging. Irrespective of recent countermeasures in C/C++ such as smart pointers, leak-related issues remain a troublesome issue in C/C++ code. We propose an algorithm for automatic detection of memory leaks in C/C++ programs based on solving disjoint sets of graphs which comprises of memory objects as nodes and their references as edges in order to find the memory leaks within the application. For this an object database and structure database is created and MLD algorithm is applied. Thus, it helps in keeping a record of memory leaks in the application.
- Published
- 2020
4. Working with Smart Pointers: unique_ptr
- Author
-
Roger Villela
- Subjects
Memory management ,Computer science ,Programming language ,Smart pointer ,computer.software_genre ,computer - Abstract
In this chapter, you’ll learn about memory management using smart pointers in the C++ programming language.
- Published
- 2019
5. SPrinter: A Static Checker for Finding Smart Pointer Errors in C++ Programs
- Author
-
Jiwei Yan, Jun Yan, Yaqi Li, Xutong Ma, and Jian Zhang
- Subjects
Computer science ,Programming language ,0202 electrical engineering, electronic engineering, information engineering ,020207 software engineering ,Smart pointer ,02 engineering and technology ,computer.software_genre ,computer ,Compile time - Abstract
Smart pointers are widely used to prevent memory errors in modern C++ code. However, improper usage of smart pointers may also lead to common memory errors, which makes the code not as safe as expected. To avoid smart pointer errors as early as possible, we present a coding style checker to detect possible bad smart pointer usages during compile time, and notify programmers about bug-prone behaviors. The evaluation indicates that the currently available state-of-the-art static code checkers can only detect 25 out of 116 manually inserted errors, while our tool can detect all these errors. And we also found 521 bugs among 8 open source projects with only 4 false positives.
- Published
- 2019
6. Categorization of C++ Classes for Static Lifetime Analysis
- Author
-
Gábor Horváth and Norbert Pataki
- Subjects
Source code ,Computer science ,Semantics (computer science) ,Programming language ,media_common.quotation_subject ,020207 software engineering ,Smart pointer ,0102 computer and information sciences ,02 engineering and technology ,Static analysis ,Object (computer science) ,computer.software_genre ,01 natural sciences ,Open source ,Categorization ,010201 computation theory & mathematics ,Taxonomy (general) ,0202 electrical engineering, electronic engineering, information engineering ,computer ,media_common - Abstract
While C++ is a powerful language, it has many subtle ways to introduce object lifetime-related errors. According to Microsoft, 70% of their security patches are fixing memory issues. Thus, it is crucial to develop safety measures to counteract these problems. Static analysis is an essential approach to detect runtime errors by analyzing the source code without executing it. One of the reasons why is it so easy to make mistakes using C++ is that the language provides a rich taxonomy of object lifetime-related concepts such as containers, values, iterators, raw pointers, lvalue and rvalue references, smart pointers, etc. The behavior of user-defined types depends on their category. Classical static analysis approaches treat user-defined types as black boxes and do not reason about their correctness.In this paper, we argue for an approach that infers the category of user-defined types and leverages this information during analysis. To achieve this goal we first analyze user-defined classes to predict their ownership semantics. Then we use this information to generalize existing static analysis methods. We evaluated the proposed method on large open source projects.
- Published
- 2019
7. How to teach 'modern C++' to someone who already knows programming?
- Author
-
Jignesh M. Patel, Adalbert Gerald Soosai Raj, Varun Naik, and Richard Halverson
- Subjects
Programming language ,Computer science ,05 social sciences ,050301 education ,Smart pointer ,02 engineering and technology ,Top-down and bottom-up design ,Type (model theory) ,computer.software_genre ,Set (abstract data type) ,Constructed language ,Dynamic memory management ,020204 information systems ,0202 electrical engineering, electronic engineering, information engineering ,0503 education ,computer - Abstract
The C++ programming language has undergone major changes since the introduction of C++11. 'Modern C++,' defined here as C++11 and beyond, can be viewed as a new language compared to C++98 (the version of C++ introduced in 1998). Many new features have been added to modern C++, including lambda expressions and automatic type deduction. The standard library has also been dramatically updated with constructs such as std::unordered_set and smart pointers. The traditional way of teaching C++ by first teaching C's low-level features, such as raw pointers and char * strings, is potentially ineffective when teaching modern C++. Based on this hypothesis, we updated the way in which we teach C++ at UW-Madison by teaching the most important high-level features (containers, iterators, and algorithms) first, and introducing the low-level features (raw pointers, dynamic memory management, etc.) only when they are necessary. In this paper, we present our experiences teaching modern C++ with this top-down approach. We find that with our new approach, students' perceptions about learning C++ are largely positive.
- Published
- 2018
8. C++11 Smart Pointer: shared_ptr, unique_ptr und weak_ptr
- Author
-
Richard Kaiser
- Subjects
Physics ,Operating system ,Smart pointer ,computer.software_genre ,computer - Abstract
Die Arbeit mit Zeigern auf dynamisch erzeugte Speicherbereiche ist oft fehleranfallig: Obwohl z.B. die beiden Funktionen.
- Published
- 2018
9. High-level C++ implementation of the read-copy-update pattern
- Author
-
Gábor Marton, Imre Szekeres, and Zoltán Porkoláb
- Subjects
Class (computer programming) ,Record locking ,Computer science ,Operating system ,Concurrent computing ,Smart pointer ,Linux kernel ,computer.software_genre ,Semaphore ,computer ,Electronic mail ,Read-copy-update - Abstract
Concurrent programming with classical mutex/lock techniques does not scale well when reads are way more frequent than writes. Such situation happens in operating system kernels among other performance critical multithreaded applications. Read copy update (RCU) is a well know technique for solving the problem. RCU guarantees minimal overhead for read operations and allows them to occur concurrently with write operations. RCU is a favourite concurrent pattern in low level, performance critical applications, like the Linux kernel. Currently there is no high-level abstraction for RCU for the C++ programming language. In this paper, we present our C++ RCU class library to support efficient concurrent programming for the read-copy-update pattern. The library has been carefully designed to optimise performance in a heavily multithreaded environment, in the same time providing high-level abstractions, like smart pointers and other C++11/14/17 features.
- Published
- 2017
10. A garbage collection policy based on empirical behavior.
- Author
-
Woo Hyong Lee and Chang, Morris
- Subjects
- *
COMPUTER memory management , *GARBAGE collection (Computer science) , *COMPUTER software , *C++ , *OBJECT-oriented programming , *COMPUTER programming - Abstract
Many C++ studies show that dynamic memory management is one of the most expensive components in many software systems. C++ programs tend to carry out object creation and deletion prolifically. As a result, dynamic memory management can consume up to 30% of the program execution time in C++. In many cases, programmers need automatic dynamic memory management to free them from the problem of having to manage the C++'s large number of memory invocations. Unlike other object-oriented languages, C++ does not contain an automatic memory management policy among its language features. This paper presents a garbage collection strategy, called GC++, which collects garbage automatically with high speed of object allocation/de-allocation. This high speed allocation/deallocation come from the utilization of memory allocation/deallocation behavior. The C++ allocation/deallocation patterns are determined experimentally in this paper. The proposed scheme is made feasible by minimizing memory allocation/deallocation calls and reusing objects based on other empirical investigations. To implement we applied the technique of Smart Pointer, which is one of the standard template containers. Our allocation scheme is simple and fast, since it requires no splitting and coalescing, and reduces the number of malloc() calls. It maintains its own free-list, which is used for object-reuse. Our scheme is purely source-code oriented and built on the top of the normal C++ memory manager, Therefore, this approach is portable, can be applied with existing code and is safe to use with different memory managers. [ABSTRACT FROM AUTHOR]
- Published
- 2004
- Full Text
- View/download PDF
11. PtrSplit
- Author
-
Trent Jaeger, Shen Liu, and Gang Tan
- Subjects
Theoretical computer science ,Pointer aliasing ,Computer science ,Programming language ,020206 networking & telecommunications ,020207 software engineering ,Smart pointer ,02 engineering and technology ,computer.software_genre ,Marshalling ,Pointer swizzling ,TheoryofComputation_LOGICSANDMEANINGSOFPROGRAMS ,Escape analysis ,Pointer (computer programming) ,Program Dependence Graph ,0202 electrical engineering, electronic engineering, information engineering ,Pointer analysis ,computer - Abstract
Partitioning a security-sensitive application into least-privileged components and putting each into a separate protection domain have long been a goal of security practitioners and researchers. However, a stumbling block to automatically partitioning C/C++ applications is the presence of pointers in these applications. Pointers make calculating data dependence, a key step in program partitioning, difficult and hard to scale; furthermore, C/C++ pointers do not carry bounds information, making it impossible to automatically marshall and unmarshall pointer data when they are sent across the boundary of partitions. In this paper, we propose a set of techniques for supporting general pointers in automatic program partitioning. Our system, called PtrSplit, constructs a Program Dependence Graph (PDG) for tracking data and control dependencies in the input program and employs a parameter-tree approach for representing data of pointer types; this approach is modular and avoids global pointer analysis. Furthermore, it performs selective pointer bounds tracking to enable automatic marshalling/unmarshalling of pointer data, even when there is circularity and arbitrary aliasing. As a result, PtrSplit can automatically generate executable partitions for C applications that contain arbitrary pointers.
- Published
- 2017
12. Detection of Memory Leaks in C/C++ Code via Machine Learning
- Author
-
Felix Eichler, Mohammad Ghanavati, and Artur Andrzejak
- Subjects
Learning classifier system ,Java ,C dynamic memory allocation ,Computer science ,business.industry ,Spec# ,020207 software engineering ,Smart pointer ,02 engineering and technology ,Machine learning ,computer.software_genre ,Memory leak ,0202 electrical engineering, electronic engineering, information engineering ,020201 artificial intelligence & image processing ,Artificial intelligence ,Allocation site ,Resource management (computing) ,business ,computer ,computer.programming_language - Abstract
Memory leaks are one of the primary causes of software aging. Despite of recent countermeasures in C/C++ such as smart pointers, leak-related defects remain a troublesome issue in C/C++ code, especially in legacy applications.We propose an approach for automatic detection of memory leaks in C/C++ programs based on characterizing memory allocation sites via the age distribution of the non-disposed memory chunks allocated by such a site (the so-called GenCount-technique introduced for Java by Vladimir Šor). We instrument malloc and free calls in C/C++ and collect for each allocation site data on the number of allocated memory fragments, their lifetimes, and sizes. Based on this data we compute feature vectors and train a machine learning classifier to differentiate between leaky and defect-free allocation sites.Our evaluation uses applications from SPEC CPU2006 suite with injected memory leaks resembling real leaks. The results show that even out-of-the-box classification algorithms can achieve high accuracy, with precision and recall values of 0.93 and 0.88, respectively.
- Published
- 2017
13. Offline Data Processing Software for the JUNO Experiment
- Author
-
Ziyan Deng, Teng Li, Tao Lin, J. H. Zou, Wei Li, Xingtao Huang, and Guofu Cao
- Subjects
Data processing ,Measure (data warehouse) ,Event (computing) ,Reading (computer) ,Real-time computing ,Detector ,Smart pointer ,Universally unique identifier ,Neutrino - Abstract
JUNO is a multi-purpose neutrino experiment designed to determine the neutrino mass hierarchy and precisely measure oscillation parameters. The offline data processing of JUNO is based on the newly designed and developed SNiPER framework which provides flexible event management buffer, efficient event execution controlling, user-friendly interfaces and so on. The event data model of JUNO is based on the ROOT TObject. A new type of smart pointer, SmartRef, is designed to meet the special multi-event correlation requirements of neutrino experiments. SmartRef uses the Universally Unique Identifier to handle the references of event data objects, both in memory and in ROOT files. The Input/Output system supports the lazy-loading of event objects when reading data from ROOT files. So far, JUNO offline data processing software has been successfully used for the optimization of detector performance as well as study of reconstruction and physics performance.
- Published
- 2017
14. Automatic Copying of Pointer-Based Data Structures
- Author
-
Hyojin Sung, Tong Chen, and Zehra Sura
- Subjects
010302 applied physics ,Copying ,Programming language ,business.industry ,Fortran ,Computer science ,Smart pointer ,02 engineering and technology ,Parallel computing ,computer.software_genre ,Data structure ,01 natural sciences ,020202 computer hardware & architecture ,Runtime system ,Software ,Pointer (computer programming) ,0103 physical sciences ,0202 electrical engineering, electronic engineering, information engineering ,Compiler ,business ,computer ,computer.programming_language - Abstract
In systems with multiple memories, software may need to explicitly copy data from one memory location to another. This copying is required to enable access or to unlock performance, and it is especially important in heterogeneous systems. When the data includes pointers to other data, the copying process has to recursively follow the pointers to perform a deep copy of the entire data structure. It is tedious and error-prone to require users to manually program the deep copy code for each pointer-based data structure used. Instead, a compiler and runtime system can automatically handle deep copies if it can identify pointers in the data, and can determine the size and type of data pointed to by each pointer. This is possible if the language provides reflection capabilities, or uses smart pointers that encapsulate this information, e.g. Fortran pointers that intrinsically include dope vectors to describe the data pointed to. In this paper, we describe our implementation of automatic deep copy in a Fortran compiler targeting a heterogeneous system with GPUs. We measure the runtime overheads of the deep copies, propose techniques to reduce this overhead, and evaluate the efficacy of these techniques.
- Published
- 2017
15. Comprehensive Performance Analysis of C++ Smart Pointers
- Author
-
Bence Babati and Norbert Pataki
- Subjects
Computer science ,020207 software engineering ,Smart pointer ,0102 computer and information sciences ,02 engineering and technology ,Construct (python library) ,computer.software_genre ,01 natural sciences ,Computer Science Applications ,Memory leak ,010201 computation theory & mathematics ,TheoryofComputation_LOGICSANDMEANINGSOFPROGRAMS ,Modeling and Simulation ,0202 electrical engineering, electronic engineering, information engineering ,Operating system ,Overhead (computing) ,General Materials Science ,computer ,Software ,Civil and Structural Engineering ,Abstraction (linguistics) - Abstract
Smart pointers play an important role in bypassing memory leaks in C++. Since C++11 standard the smart pointers have become widely-used tools because they let the programmers not to deal with memory deallocation. However, abstraction penalty occurs because of this convenience. Overhead is related to runtime, memory usage and compilation time. There are many different smart pointers in the standard library. However, the performance difference between the smart pointers and raw pointers is not measured before. This paper presents an analysis of their effectiveness. An alternative approach to the C++17’s optional construct is searched for.
- Published
- 2017
16. DangSan - Scalable Use-after-free Detection
- Author
-
Cristiano Giuffrida, Erik van der Kouwe, Vinod Nigade, Computer Systems, Network Institute, and Systems and Network Security
- Subjects
010302 applied physics ,Dangling pointers ,business.industry ,Computer science ,Hazard pointer ,Distributed computing ,Use-after-free ,020207 software engineering ,Smart pointer ,02 engineering and technology ,Parallel computing ,01 natural sciences ,Software ,Dangling pointer ,LLVM ,Pointer (computer programming) ,Escape analysis ,0103 physical sciences ,Scalability ,0202 electrical engineering, electronic engineering, information engineering ,Information system ,business - Abstract
Use-after-free vulnerabilities due to dangling pointers are an important and growing threat to systems security. While various solutions exist to address this problem, none of them is sufficiently practical for real-world adoption. Some can be bypassed by attackers, others cannot support complex multithreaded applications prone to dangling pointers, and the remainder have prohibitively high overhead. One major source of overhead is the need to synchronize threads on every pointer write due to pointer tracking. In this paper, we present DangSan, a use-after-free detection system that scales efficiently to large numbers of pointer writes as well as to many concurrent threads. To significantly reduce the overhead of existing solutions, we observe that pointer tracking is write-intensive but requires very few reads. Moreover, there is no need for strong consistency guarantees as inconsistencies can be reconciled at read (i.e., object deallocation) time. Building on these intuitions, DangSan's design mimics that of log-structured file systems, which are ideally suited for similar workloads. Our results show that DangSan can run heavily multithreaded applications, while introducing only half the overhead of previous multithreaded use-after-free detectors.
- Published
- 2017
- Full Text
- View/download PDF
17. In C Language How to Use Pointer to Access Two-Dimensional Array Element
- Author
-
Wei Qing Bai
- Subjects
Dynamic array ,Tagged pointer ,Array access analysis ,Pointer aliasing ,Programming language ,business.industry ,Computer science ,Opaque pointer ,Array element ,Smart pointer ,Hashed array tree ,General Medicine ,computer.software_genre ,Pointer swizzling ,Pointer (computer programming) ,Escape analysis ,Array data structure ,business ,computer ,Pointer analysis ,Computer hardware - Abstract
In C language, it is difficult to use the pointer to access the two-dimensional array element. The reason is the addresses of two-dimensional array are many, pointers that can access the two-dimensional array element are many and complex. This paper analyzes the two-dimensional array address and pointer, introduces various forms of using pointer to express two-dimensional array element, explains the relationship between pointer and two-dimensional array address. The program examples show how to use pointers to access the two-dimensional array element.
- Published
- 2013
18. Verifying pointer and string analyses with region type systems
- Author
-
Lennart Beringer, Martin Hofmann, and Robert Grabowski
- Subjects
Tagged pointer ,Theoretical computer science ,Computer Networks and Communications ,Programming language ,Computer science ,Opaque pointer ,Smart pointer ,computer.software_genre ,Function pointer ,Pointer swizzling ,TheoryofComputation_LOGICSANDMEANINGSOFPROGRAMS ,Pointer (computer programming) ,Escape analysis ,computer ,Pointer analysis ,Software - Abstract
Pointer analysis statically approximates the heap pointer structure during a program execution in order to track heap objects or to establish alias relations between references, and usually contributes to other analyses or code optimizations. In recent years, a number of algorithms have been presented that provide an efficient, scalable, and yet precise pointer analysis. However, it is unclear how the results of these algorithms compare to each other semantically. In this paper, we present a general region type system for a Java-like language and give a formal soundness proof. The system is subsequently specialized to obtain a platform for embedding the results of various existing context-sensitive pointer analysis algorithms, thereby equipping the computed relations with a common interpretation and verification. We illustrate our system by outlining an extension to a string value analysis that builds on pointer information.
- Published
- 2013
19. Hardware-Enforced Comprehensive Memory Safety
- Author
-
Milo M. K. Martin, Steve Zdancewic, and Santosh Nagarakatte
- Subjects
Computer science ,business.industry ,Register renaming ,Smart pointer ,computer.software_genre ,Microarchitecture ,Metadata ,Memory management ,Hardware and Architecture ,TheoryofComputation_LOGICSANDMEANINGSOFPROGRAMS ,Pointer (computer programming) ,Operating system ,Cache ,Electrical and Electronic Engineering ,business ,computer ,Memory safety ,Software ,Computer hardware - Abstract
The lack of memory safety in languages such as C and C++ is a root source of exploitable security vulnerabilities. This article presents Watchdog, a hardware approach that eliminates such vulnerabilities by enforcing comprehensive memory safety. Inspired by prior software-only mechanisms, Watchdog maintains bounds and identifier metadata with pointers, propagates them on pointer operations, and checks them on pointer dereferences. Checking this bounds and identifier metadata provides both precise, byte-granularity buffer-overflow protection and protection from use-after-free errors, even in the presence of reallocations. Watchdog stores pointer metadata in a disjoint shadow space to provide comprehensive protection and ensure compatibility with existing code. To streamline implementation and reduce runtime overhead, Watchdog uses micro-operations to implement metadata access and checking, eliminates metadata copies via a register renaming scheme, and uses a dedicated identifier cache to reduce checking overhead.
- Published
- 2013
20. A Study on Method to Complement Speed of the Reference Counting Smart Pointer
- Author
-
Kyung-Joon Park, Hyun-Ju Park, and Min-Seok Seo
- Subjects
Tagged pointer ,General Computer Science ,Pointer aliasing ,Hazard pointer ,C dynamic memory allocation ,Computer science ,business.industry ,Reference counting ,Smart pointer ,Thread (computing) ,Data type ,Placement syntax ,Memory management ,Dangling pointer ,Pointer swizzling ,Escape analysis ,Pointer (computer programming) ,business ,Pointer analysis ,Computer hardware - Abstract
Recent C ++ developers take advantage of the many advantages in memory management in the development of reference counting smart pointer. However, these have a problem more than the normal pointer. In this paper, we not only complement these by reference counting smart pointer which pointing a large dynamic object to perform a delete operation to improve performance by creating a thread for the delete operation but also Generalize all data types, we propose a convenient way to operate.
- Published
- 2013
21. Dereferee: instrumenting C++ pointers with meaningful runtime diagnostics
- Author
-
Anthony Allevato and Stephen H. Edwards
- Subjects
Memory management ,Debugging ,Programming language ,Computer science ,Pointer (computer programming) ,media_common.quotation_subject ,Smart pointer ,Compiler ,computer.software_genre ,computer ,Software ,media_common - Abstract
Proper memory management and pointer usage often prove to be the most difficult concepts for students learning C++ to grasp. Compounding this problem is the fact that the compilers and runtime environments traditionally used to introduce these concepts leave much to be desired with regard to generating meaningful diagnostics to assist students in tracking down and fixing memory-related logical errors. To alleviate this, we have developed Dereferee, an advanced yet thin wrapper around C++ pointers that greatly increases the quality of these runtime diagnostics, but with only a small amount of intrusion into the development process. With regard to performance, memory-intensive programs will experience execution times approximately 20-30 times slower when using Dereferee, which is comparable with other similar tools. Furthermore, the library has been designed to be customizable and easily disabled to transition codes from development to production.Copyright © 2013 John Wiley & Sons, Ltd.
- Published
- 2013
22. Extending programming language to support object orientation in legacy systems
- Author
-
S.J. Balaji, Dharanipragada Janakiram, and Hemang Mehta
- Subjects
General Computer Science ,Programming language ,Computer science ,business.industry ,Legacy system ,Smart pointer ,Entry point ,computer.software_genre ,Copy elision ,Single Compilation Unit ,Run-time type information ,Inline function ,Compiler ,Software engineering ,business ,computer - Abstract
The contemporary software systems written in C face maintainability issues because of tight coupling. Introducing object orientation can address these problems by raising the abstraction to objects, thereby providing better programmability and understandability. However, compiling a C software with a C++ compiler is difficult because of the incompatibilities between C and C++. Some of the incompatibilities such as designated initializers are nontrivial in nature and hence are very difficult to handle by automation such as scripting or by manual efforts. Moreover, runtime support for features such as global constructors, exception handling, runtime type inference, etc. is also required in the target system. Clearly, the traditional procedural language compiler cannot provide these features. In this paper, we propose extending programming language such as C++ to support object orientation in legacy systems instead of completely redesigning them. With a case study of Linux kernel, we report major issues in providing the compile and runtime support for C++ in legacy systems, and provide a solution to these issues. Our approach paves the way for converting a large C based software into C++. The experiments demonstrate that the proposed extension saves significant manual efforts with very little change in the g++ compiler. In addition, the performance study considers other legacy systems written in C and shows that the overhead resulting from the modifications in the compiler is negligible in comparison to the functionality achieved.
- Published
- 2013
23. Accelerating pointer chasing in 3D-stacked memory: Challenges, mechanisms, evaluation
- Author
-
Samira Khan, Saugata Ghose, Nandita Vijaykumar, Amirali Boroumand, Kevin Hsieh, Onur Mutlu, and Kevin K. Chang
- Subjects
Flat memory model ,Tagged pointer ,Computer science ,Registered memory ,02 engineering and technology ,Parallel computing ,computer.software_genre ,01 natural sciences ,Non-uniform memory access ,Placement syntax ,Unreachable memory ,Pointer swizzling ,0103 physical sciences ,0202 electrical engineering, electronic engineering, information engineering ,Interleaved memory ,010302 applied physics ,Hardware_MEMORYSTRUCTURES ,C dynamic memory allocation ,Translation lookaside buffer ,Uniform memory access ,Semiconductor memory ,Smart pointer ,Data structure ,Memory map ,020202 computer hardware & architecture ,Memory management ,Pointer (computer programming) ,Operating system ,Cache ,computer - Abstract
Pointer chasing is a fundamental operation, used by many important data-intensive applications (e.g., databases, key-value stores, graph processing workloads) to traverse linked data structures. This operation is both memory bound and latency sensitive, as it (1) exhibits irregular access patterns that cause frequent cache and TLB misses, and (2) requires the data from every memory access to be sent back to the CPU to determine the next pointer to access. Our goal is to accelerate pointer chasing by performing it inside main memory, thereby avoiding inefficient and high-latency data transfers between main memory and the CPU. To this end, we propose the In-Memory PoInter Chasing Accelerator (IMPICA), which leverages the logic layer within 3D-stacked memory for linked data structure traversal.
- Published
- 2016
24. Heap bounds protection with low fat pointers
- Author
-
Gregory J. Duck and Roland H. C. Yap
- Subjects
Arithmetic underflow ,Theoretical computer science ,Computer science ,020207 software engineering ,Smart pointer ,02 engineering and technology ,Dangling pointer ,Pointer (computer programming) ,0202 electrical engineering, electronic engineering, information engineering ,020201 artificial intelligence & image processing ,Pointer analysis ,Memory safety ,Heap (data structure) ,Buffer overflow - Abstract
Heap buffer overflow (underflow) errors are a common source of security vulnerabilities. One prevention mechanism is to add object bounds meta information and to instrument the program with explicit bounds checks for all memory access. The so-called "fat pointers" approach is one method for maintaining and propagating the meta information where native machine pointers are replaced with "fat" objects that explicitly store object bounds. Another approach is "low fat pointers", which encodes meta information within a native pointer itself, eliminating space overheads and also code compatibility issues. This paper presents a new low-fat pointer encoding that is fully compatible with existing libraries (e.g. pre-compiled libraries unaware of the encoding) and standard hardware (e.g. x86_64). We show that our approach has very low memory overhead, and competitive with existing state-of-the-art bounds instrumentation solutions.
- Published
- 2016
25. Transactional Pointers: Experiences with HTM-Based Reference Counting in C++
- Author
-
Gaël Thomas, Pascal Felber, Dave Dice, Maria Carpen-Amarie, Université de Neuchâtel (UNINE), Oracle Labs, Algorithmes, Composants, Modèles Et Services pour l'informatique répartie (ACMES-SAMOVAR), Services répartis, Architectures, MOdélisation, Validation, Administration des Réseaux (SAMOVAR), Institut Mines-Télécom [Paris] (IMT)-Télécom SudParis (TSP)-Institut Mines-Télécom [Paris] (IMT)-Télécom SudParis (TSP), Département Informatique (INF), Institut Mines-Télécom [Paris] (IMT)-Télécom SudParis (TSP), and Centre National de la Recherche Scientifique (CNRS)
- Subjects
Java ,Computer science ,Programming language ,Reference counting ,Concurrency ,Transactional memory ,020207 software engineering ,Smart pointer ,02 engineering and technology ,Data structure ,computer.software_genre ,Memory management ,020204 information systems ,0202 electrical engineering, electronic engineering, information engineering ,Overhead (computing) ,[INFO.INFO-DC]Computer Science [cs]/Distributed, Parallel, and Cluster Computing [cs.DC] ,computer ,computer.programming_language - Abstract
International audience; The most popular programming languages, such as C++ or Java, have libraries and data structures designed to automatically address concurrency hazards in order to run on multiple threads. In particular, this trend has also been adopted in the memory management domain. However, automatic concurrent memory management also comes at a price, leading sometimes to noticeable overhead. In this paper, we experiment with C++ smart pointers and their automatic memory-management technique based on reference counting. More precisely, we study how we can use hardware transactional memory (HTM) to avoid costly and sometimes unnecessary atomic operations. Our results suggest that replacing the systematic counting strategy with HTM could improve application performance in certain scenarios, such as concurrent linked-list traversal
- Published
- 2016
- Full Text
- View/download PDF
26. A C++ Programming Model for Heterogeneous System Architecture
- Author
-
Uwe Dolinsky, Russell Bradford, Alastair Murray, and Ralph Potter
- Subjects
Heterogeneous System Architecture ,Programming language ,Computer science ,Smart pointer ,02 engineering and technology ,Kernel virtual address space ,computer.software_genre ,020202 computer hardware & architecture ,Computer architecture ,0202 electrical engineering, electronic engineering, information engineering ,Programming paradigm ,020201 artificial intelligence & image processing ,Compiler ,computer - Abstract
This paper describes a shared-source programming model and compiler for Heterogeneous System Architecture, based on C++14.
- Published
- 2016
27. TypeSan - Practical Type Confusion Detection
- Author
-
Yuseok Jeon, Istvan Haller, Mathias Payer, Hui Peng, Herbert Bos, Cristiano Giuffrida, Erik van der Kouwe, Computer Systems, Network Institute, and Systems and Network Security
- Subjects
Downcasting ,Computer science ,business.industry ,Distributed computing ,Type safety ,Spec# ,020207 software engineering ,Smart pointer ,02 engineering and technology ,Type confusion ,Placement syntax ,Software ,020204 information systems ,Pointer (computer programming) ,0202 electrical engineering, electronic engineering, information engineering ,Object type ,Typecasting ,business ,computer ,Heap (data structure) ,computer.programming_language - Abstract
The low-level C++ programming language is ubiquitously used for its modularity and performance. Typecasting is a fundamental concept in C++ (and object-oriented programming in general) to convert a pointer from one object type into another. However, downcasting (converting a base class pointer to a derived class pointer) has critical security implications due to potentially different object memory layouts. Due to missing type safety in C++, a downcasted pointer can violate a programmer's intended pointer semantics, allowing an attacker to corrupt the underlying memory in a type-unsafe fashion. This vulnerability class is receiving increasing attention and is known as type confusion (or badcasting). Several existing approaches detect different forms of type confusion, but these solutions are severely limited due to both high run-time performance overhead and low detection coverage. This paper presents TypeSan, a practical type-confusion detector which provides both low run-time overhead and high detection coverage. Despite improving the coverage of state-of-the-art techniques, TypeSan significantly reduces the type-confusion detection overhead compared to other solutions. TypeSan relies on an efficient per-object metadata storage service based on a compact memory shadowing scheme. Our scheme treats all the memory objects (i.e., globals, stack, heap) uniformly to eliminate extra checks on the fast path and relies on a variable compression ratio to minimize run-time performance and memory overhead. Our experimental results confirm that TypeSan is practical, even when explicitly checking almost all the relevant typecasts in a given C++ program. Compared to the state of the art, TypeSan yields orders of magnitude higher coverage at 4-10 times lower performance overhead on SPEC and 2 times on Firefox. As a result, our solution offers superior protection and is suitable for deployment in production software. Moreover, our highly efficient metadata storage back-end is potentially useful for other defenses that require memory object tracking.
- Published
- 2016
- Full Text
- View/download PDF
28. Securing heap memory by data pointer encoding
- Author
-
Kyung-Tae Kim and Changwoo Pyo
- Subjects
Tagged pointer ,Computer Networks and Communications ,Programming language ,C dynamic memory allocation ,Computer science ,Hazard pointer ,Smart pointer ,Linked list ,computer.software_genre ,Memory management ,Heap overflow ,Hardware and Architecture ,Dangling pointer ,Pointer swizzling ,TheoryofComputation_LOGICSANDMEANINGSOFPROGRAMS ,Pointer (computer programming) ,Escape analysis ,Binary heap ,computer ,Pointer analysis ,Software - Abstract
Since pointer variables frequently cause programs to crash in unexpected ways, they often pose vulnerability abused as immediate or intermediate targets. Although code pointer attacks have been historically dominant, data pointer attacks are also recognized as realistic threats. This paper presents how to secure heap memory from data pointer attacks, in particular, heap overflow attacks. Our protection scheme encrypts the data pointers used for linking free chunks, and decrypts the pointers only before dereferencing. We also present a list structure with duplicate links that is harder to break than the conventional linked list structure. Our experiment shows that the proposed data pointer encoding is effective and has slightly better performance than the integrity check of link pointers in GNU's standard C library.
- Published
- 2012
29. Pointer Race Freedom
- Author
-
Sebastian Wolff, Roland Meyer, Lukáš Holík, and Frédéric Haziza
- Subjects
060201 languages & linguistics ,Tagged pointer ,Theoretical computer science ,Computer science ,Programming language ,Smart pointer ,06 humanities and the arts ,02 engineering and technology ,computer.software_genre ,Function pointer ,Dangling pointer ,Pointer swizzling ,TheoryofComputation_LOGICSANDMEANINGSOFPROGRAMS ,Pointer (computer programming) ,Escape analysis ,0602 languages and literature ,0202 electrical engineering, electronic engineering, information engineering ,020201 artificial intelligence & image processing ,Pointer analysis ,computer - Abstract
We propose a novel notion of pointer race for concurrent programs manipulating a shared heap. A pointer race is an access to a memory address which was freed, and it is out of the accessor's control whether or not the cell has been re-allocated. We establish two results. 1 Under the assumption of pointer race freedom, it is sound to verify a program running under explicit memory management as if it was running with garbage collection. 2 Even the requirement of pointer race freedom itself can be verified under the garbage-collected semantics. We then prove analogues of the theorems for a stronger notion of pointer race needed to cope with performance-critical code purposely using racy comparisons and even racy dereferences of pointers. As a practical contribution, we apply our results to optimize a thread-modular analysis under explicit memory management. Our experiments confirm a speed-up of upi¾?to two orders of magnitude.
- Published
- 2015
30. Pointer Logic for Verification of Pointer Programs
- Author
-
Zhifang Wang, Yiyun Chen, Zhao-Peng Li, and Bao-Jian Hua
- Subjects
Function pointer ,Programming language ,Computer science ,Pointer swizzling ,Escape analysis ,Pointer (computer programming) ,Opaque pointer ,Smart pointer ,computer.software_genre ,computer ,Pointer analysis ,Software - Published
- 2010
31. Taking a Second Look at C++ Pointers
- Author
-
Stephen R. Davis
- Subjects
Reference counting ,Programming language ,Computer science ,Smart pointer ,Parallel computing ,computer.software_genre ,computer - Published
- 2009
32. A bottom-up pointer analysis using the update history
- Author
-
Taisook Han and Hyun-Goo Kang
- Subjects
Tagged pointer ,Shape analysis (program analysis) ,Computer science ,Programming language ,Smart pointer ,computer.software_genre ,Computer Science Applications ,Function pointer ,Pointer swizzling ,Escape analysis ,Pointer (computer programming) ,Pointer analysis ,computer ,Software ,Information Systems - Abstract
Pointer analysis is an important part for the source code analysis of C programs. In this paper, we propose a bottom-up and flow- and context-sensitive pointer analysis algorithm, where bottom-up refers to the ability to perform the analysis from callee modules to caller modules. Our approach is based on a new modular pointer analysis domain named the update history that can abstract memory states of a procedure independently of the information on aliases between memory locations and keep the information on the order of side effects performed. Such a memory representation not only enables the analysis to be formalized as a bottom-up analysis, but also helps the analysis to effectively identify killed side effects and relevant alias contexts. The experiments performed on a pilot implementation of the method shows that our approach is effective for improving the precision of a client analysis.
- Published
- 2009
33. Formal Verification of C Systems Code
- Author
-
Harvey Tuch
- Subjects
Theoretical computer science ,C dynamic memory allocation ,Programming language ,Computer science ,Proof assistant ,HOL ,Smart pointer ,Separation logic ,computer.software_genre ,Computational Theory and Mathematics ,Artificial Intelligence ,TheoryofComputation_LOGICSANDMEANINGSOFPROGRAMS ,Pointer (computer programming) ,Memory model ,Formal verification ,computer ,Software - Abstract
Systems code is almost universally written in the C programming language or a variant. C has a very low level of type and memory abstraction and formal reasoning about C systems code requires a memory model that is able to capture the semantics of C pointers and types. At the same time, proof-based verification demands abstraction, in particular from the aliasing and frame problems. In this paper we present a study in the mechanisation of two proof abstractions for pointer program verification in the Isabelle/HOL theorem prover, based on a low-level memory model for C. The language's type system presents challenges for the multiple independent typed heaps (Burstall-Bornat) and separation logic proof techniques. In addition to issues arising from explicit value size/alignment, padding, type-unsafe casts and pointer address arithmetic, structured types such as C's arrays and structs are problematic due to the non-monotonic nature of pointer and lvalue validity in the presence of the unary &-operator. For example, type-safe updates through pointers to fields of a struct break the independence of updates across typed heaps or ?*-conjuncts. We provide models and rules that are able to cope with these language features and types, eschewing common over-simplifications and utilising expressive shallow embeddings in higher-order logic. Two case studies are provided that demonstrate the applicability of the mechanised models to real-world systems code; a working of the standard in-place list reversal example and an overview of the verification of the L4 microkernel's memory allocator.
- Published
- 2009
34. Dereferee
- Author
-
Anthony Allevato, Stephen H. Edwards, and Manuel A. Pérez-Quiñones
- Subjects
business.industry ,Computer science ,media_common.quotation_subject ,Smart pointer ,Test-driven development ,Memory leak ,Placement syntax ,Memory management ,Dynamic memory management ,Debugging ,Dangling pointer ,Pointer (computer programming) ,ComputingMilieux_COMPUTERSANDEDUCATION ,General Materials Science ,Software engineering ,business ,Memory safety ,media_common - Abstract
Dynamic memory management and the use of pointers are critical topics in teaching the C++ language. They are also some of the most difficult for students to grasp properly. The responsibility of ensuring that students understand these concepts does not end with the instructor's lectures---a library enhanced with diagnostics beyond those provided by the language's run-time system itself is a useful tool for giving students more detailed information when their code fails. We have designed such a toolkit, Dereferee, which students can incorporate into their code with minimal intrusion into the learning process. To demonstrate its effectiveness, we examine C++ code from students in a course that relied solely on the built-in memory management behavior of the language, without any significant additional diagnostic or debugging facilities. We instrument this code with Dereferee in order to explore the causes of errors that result in program crashes and to expose hidden faults that previously lay undetected. Dereferee provided enhanced diagnostics for bugs in 63% of student submissions, and pinpointed the source of 83% of abnormal program terminations. 95% of the students would have received extra diagnostic help from using Dereferee.
- Published
- 2009
35. Automated verification of pointer programs in pointer logic
- Author
-
Baojian Hua, Yiyun Chen, Zhenming Wang, and Zhifang Wang
- Subjects
Tagged pointer ,General Computer Science ,Computer science ,Programming language ,Opaque pointer ,Smart pointer ,computer.software_genre ,Theoretical Computer Science ,Function pointer ,Pointer swizzling ,Dangling pointer ,TheoryofComputation_LOGICSANDMEANINGSOFPROGRAMS ,Escape analysis ,Pointer analysis ,computer - Abstract
Reasoning about pointer programs is difficult and challenging, while their safety is critical in software engineering. Storeless semantics pioneered by Jonkers provides a method to reason about pointer programs. However, the representation of memory states in Jonkers’ model is costly and redundant. This paper presents a new framework under a more efficient storeless model for automatically verifying properties of pointer programs related to the correct use of dynamically allocated memory such as absence of null dereferences, absence of dangling dereferences, absence of memory leaks, and preservation of structural invariants. The introduced logic-Pointer Logic, is developed to achieve such goals. To demonstrate that Pointer Logic is a useful storeless approach to verification, the Schorr-Waite tree-traversal algorithm which is always considered as a key test for pointer formalizations was verified via our analysis. Moreover, an experimental tool-plcc was implemented to automatically verify a number of non-trivial pointer programs.
- Published
- 2008
36. Hardbound
- Author
-
Colin Blundell, Steve Zdancewic, Milo M. K. Martin, and Joseph Devietti
- Subjects
Pointer aliasing ,Programming language ,C dynamic memory allocation ,Computer science ,Opaque pointer ,Smart pointer ,General Medicine ,computer.software_genre ,Data type ,Computer Graphics and Computer-Aided Design ,Pointer swizzling ,Pointer (computer programming) ,Escape analysis ,TheoryofComputation_LOGICSANDMEANINGSOFPROGRAMS ,Operating system ,General Earth and Planetary Sciences ,Compiler ,computer ,Memory safety ,Bounded pointer ,Software ,General Environmental Science - Abstract
The C programming language is at least as well known for its absence of spatial memory safety guarantees (i.e., lack of bounds checking) as it is for its high performance. C's unchecked pointer arithmetic and array indexing allow simple programming mistakes to lead to erroneous executions, silent data corruption, and security vulnerabilities. Many prior proposals have tackled enforcing spatial safety in C programs by checking pointer and array accesses. However, existing software-only proposals have significant drawbacks that may prevent wide adoption, including: unacceptably high run-time overheads, lack of completeness, incompatible pointer representations, or need for non-trivial changes to existing C source code and compiler infrastructure. Inspired by the promise of these software-only approaches, this paper proposes a hardware bounded pointer architectural primitive that supports cooperative hardware/software enforcement of spatial memory safety for C programs. This bounded pointer is a new hardware primitive datatype for pointers that leaves the standard C pointer representation intact, but augments it with bounds information maintained separately and invisibly by the hardware. The bounds are initialized by the software, and they are then propagated and enforced transparently by the hardware, which automatically checks a pointer's bounds before it is dereferenced. One mode of use requires instrumenting only malloc, which enables enforcement of perallocation spatial safety for heap-allocated objects for existing binaries. When combined with simple intraprocedural compiler instrumentation, hardware bounded pointers enable a low-overhead approach for enforcing complete spatial memory safety in unmodified C programs.
- Published
- 2008
37. Raw pointers in application classes of C++ considered harmful
- Author
-
Igor B. Smirnov
- Subjects
Considered harmful ,Object-oriented programming ,Copying ,Computer science ,Dangling pointer ,Programming language ,Reference counting ,Pointer (computer programming) ,Smart pointer ,computer.software_genre ,Computer Graphics and Computer-Aided Design ,computer ,Software - Abstract
In order to achieve good reliability, clarity, scalability and re-usability of the application high-level programs written in C++ the raw pointers should not be used as class members (fields), because the raw pointers are too dangerous in this role and they do not represent meaningful relations between objects. Instead of raw pointers two smart pointers should be used. The first one describes exclusive unique ownership with synchronization of objects copying and deletion. The second one describes inclusive references to independent alien objects with invalidating the reference at the deletion of the addressed object. All power of object-oriented programming is preserved, but difficulties and errors are eliminated.
- Published
- 2007
38. Programming the Grid with POP-C ++
- Author
-
Tuan-Anh Nguyen and Pierre Kuonen
- Subjects
Signal programming ,Computer Networks and Communications ,Computer science ,Programming language ,Distributed computing ,Distributed object ,Smart pointer ,Grid ,computer.software_genre ,Object (computer science) ,Runtime system ,Grid computing ,Hardware and Architecture ,Software deployment ,Programming paradigm ,Run-time type information ,Reactive programming ,Object model ,Protocol (object-oriented programming) ,computer ,Software - Abstract
Despite the fact that Grid computing is the main theme of distributed computing research during the last few years, programming on the Grid is still a huge difficulty to normal users. The POP-C++ programming system has been built to provide Grid programming facilities which greatly ease the development and the deployment of parallel applications on the Grid. The original parallel object model used in POP-C++ is a combination of powerful features of object-oriented programming and of high-level distributed programming capabilities. The model is based on the simple idea that objects are suitable structures to encapsulate and to distribute heterogeneous data and computing elements over the Grid. Programmers can guide the resource allocation for each object through the high-level resource descriptions. The object creation process, supported by the POP-C++ runtime system, is transparent to programmers. Both inter-object and intra-object parallelism are supported through various method invocation semantics. The POP-C++ programming language extends C++ to support the parallel object model with just a few new keywords. In this paper, we present the Grid programming aspects of POP-C++. With POP-C++, writing a Grid-enabled application becomes as simple as writing a sequential C++ application.
- Published
- 2007
39. Automatically deriving pointer reference expressions from binary code for memory dump analysis
- Author
-
Yangchun Fu, Zhiqiang Lin, and David Brumley
- Subjects
Tagged pointer ,Pointer aliasing ,Computer science ,Programming language ,Smart pointer ,computer.software_genre ,Pointer swizzling ,Dangling pointer ,TheoryofComputation_LOGICSANDMEANINGSOFPROGRAMS ,Pointer (computer programming) ,Escape analysis ,Pointer analysis ,Algorithm ,computer - Abstract
Given a crash dump or a kernel memory snapshot, it is often desirable to have a capability that can traverse its pointers to locate the root cause of the crash, or check their integrity to detect the control flow hijacks. To achieve this, one key challenge lies in how to locate where the pointers are. While locating a pointer usually requires the data structure knowledge of the corresponding program, an important advance made by this work is that we show a technique of extracting address-independent data reference expressions for pointers through dynamic binary analysis. This novel pointer reference expression encodes how a pointer is accessed through the combination of a base address (usually a global variable) with certain offset and further pointer dereferences. We have applied our techniques to OS kernels, and our experimental results with a number of real world kernel malware show that we can correctly identify the hijacked kernel function pointers by locating them using the extracted pointer reference expressions when only given a memory snapshot.
- Published
- 2015
40. Implementation of Binary Search Trees Via Smart Pointers
- Author
-
Ivaylo Donchev and Emilia Todorova
- Subjects
Binary tree ,Theoretical computer science ,General Computer Science ,Computer science ,Programming language ,Smart pointer ,computer.software_genre ,Data structure ,Memory management ,Binary search tree ,Pointer (computer programming) ,Programmer ,Resource management (computing) ,computer - Abstract
Study of binary trees has prominent place in the training course of DSA (Data Structures and Algorithms). Their implementation in C++ however is traditionally difficult for students. To a large extent these difficulties are due not so much to the complexity of algorithms as to language complexity in terms of memory management by raw pointers - the programmer must consider too many details to ensure a reliable, efficient and secure implementation. Evolution of C++ regarded to automated resource management, as well as experience in implementation of linear lists by means of C++ 11/14 lead to an attempt to implement binary search trees (BST) via smart pointers as well. In the present paper, the authors share experience in this direction. Some conclusions about pedagogical aspects and effectiveness of the new classes, compared to traditional library containers and implementation with built-in pointers, are made.
- Published
- 2015
41. Advanced Induction Variable Elimination for the Matrix Multiplication Task
- Author
-
Jerzy Stefan Respondek
- Subjects
Matrix (mathematics) ,Induction variable ,Source code ,Computer science ,media_common.quotation_subject ,Linear algebra ,Smart pointer ,Arithmetic ,Column (database) ,Algorithm ,Matrix multiplication ,Task (project management) ,media_common - Abstract
The main objective of this article is to make use of the induction variable elimination in the matrix multiplication task. The main obstacle to this aim is iterating through a matrix column, because it requires jumping over tables. As a solution to this trouble we propose a shifting window in a form of a table of auxiliary double pointers. The ready-to-use C++ source code is presented. Finally, we performed thorough time execution tests of the new C++ matrix multiplication algorithm. Those tests proved the high efficiency of the proposed optimization.
- Published
- 2015
42. Implementation of ADS Linked List Via Smart Pointers
- Author
-
Ivaylo Donchev and Emilia Todorova
- Subjects
General Computer Science ,Computer science ,Programming language ,business.industry ,Smart pointer ,Linked list ,computer.software_genre ,Data structure ,Memory management ,Pointer (computer programming) ,Resource management (computing) ,Programmer ,Software engineering ,business ,computer - Abstract
Students traditionally have difficulties in implementing abstract data structures (ADS) in C++. To a large extent, these difficulties are due to language complexity in terms of memory management with raw pointers – the programmer must take care of too many details to provide reliable, efficient and secure implementation. Since all these technical details distract students from the essence of the studied algorithms, we decided to use in the course in DSA (Data Structures and Algorithms) an automated resource management, provided by the C++ standard ISO/IEC 14882:2011. In this work we share experience of using smart pointers to implement linked lists and discuss pedagogical aspects and effectiveness of the new classes, compared to the traditional library containers and implementation via built-in pointers.
- Published
- 2015
43. A probabilistic pointer analysis for speculative optimizations
- Author
-
Jeff Da Silva and J. Gregory Steffan
- Subjects
Tagged pointer ,Theoretical computer science ,Computer science ,Optimizing compiler ,Smart pointer ,General Medicine ,Computer Graphics and Computer-Aided Design ,Program analysis ,Dangling pointer ,Escape analysis ,Pointer (computer programming) ,General Earth and Planetary Sciences ,Algorithm ,Pointer analysis ,Software ,General Environmental Science - Abstract
Pointer analysis is a critical compiler analysis used to disambiguate the indirect memory references that result from the use of pointers and pointer-based data structures. A conventional pointer analysis deduces for every pair of pointers, at any program point, whether a points-to relation between them (i) definitely exists, (ii) definitely does not exist, or (iii) maybe exists. Many compiler optimizations rely on accurate pointer analysis, and to ensure correctness cannot optimize in the maybe case. In contrast, recently-proposed speculative optimizations can aggressively exploit the maybe case, especially if the likelihood that two pointers alias can be quantified. This paper proposes a Probabilistic Pointer Analysis (PPA) algorithm that statically predicts the probability of each points-to relation at every program point. Building on simple control-flow edge profiling, our analysis is both one-level context and flow sensitive-yet can still scale to large programs including the SPEC 2000 integer benchmark suite. The key to our approach is to compute points-to probabilities through the use of linear transfer functions that are efficiently encoded as sparse matrices.We demonstrate that our analysis can provide accurate probabilities, even without edge-profile information. We also find that-even without considering probability information-our analysis provides an accurate approach to performing pointer analysis.
- Published
- 2006
44. Hardware/software optimization for array & pointer boundary checking against buffer overflow attacks
- Author
-
Keith C. C. Chan, Edwin H.-M. Sha, Chun Xue, Zili Shao, and Jiannong Cao
- Subjects
Computer Networks and Communications ,business.industry ,Computer science ,media_common.quotation_subject ,Smart pointer ,Parallel computing ,Theoretical Computer Science ,Software ,Algorithmic program debugging ,Debugging ,Artificial Intelligence ,Hardware and Architecture ,Bounds checking ,Asynchronous communication ,Pointer (computer programming) ,Embedded system ,business ,media_common ,Buffer overflow - Abstract
Malicious intrusions by buffer overflow attacks cause serious security problems and pose serious threats for networks and distributed systems such as clusters, Grids and P2P systems. Array & pointer boundary checking is one of the most effective approaches for defending against buffer overflow attacks. However, a big performance overhead may occur after boundary checking is applied. Typically, it may cause 2-5 times slowdown [T.M. Austin, E.B. Scott, S.S. Gurindar, Efficient detection of all pointer and array access errors, in: Proceedings of the ACM SIGPLAN '94 Conference on Programming Language Design and Implementation, 1994, pp. 290-301; R.W.M. Jones, P.H.J. Kelly, Backwards-compatible bounds checking for arrays and pointers in c programs, in: The Third International Workshop on Automated and Algorithmic Debugging, 1997, pp. 13-26]. In this paper, we propose a hardware/software method to optimize the performance of array & pointer boundary checking by designing a special boundary checking instruction. The experimental results show that our method can effectively reduce the overhead of array & pointer boundary checking.
- Published
- 2006
45. Program slicing with dynamic points-to sets
- Author
-
Craig Chambers, Markus Mock, Darren C. Atkinson, and Susan J. Eggers
- Subjects
Function pointer ,Computer engineering ,Computer science ,Programming language ,Pointer (computer programming) ,Escape analysis ,Program slicing ,Smart pointer ,Call graph ,computer.software_genre ,Pointer analysis ,computer ,Software - Abstract
Program slicing is a potentially useful analysis for aiding program understanding. However, in reality even slices of small programs are often too large to be useful. Imprecise pointer analyses have been suggested as one cause of this problem. In this paper, we use dynamic points-to data, which represents optimistic pointer information, to obtain a bound on the best case slice size improvement that can be achieved with improved pointer precision. Our experiments show that slice size can be reduced significantly for programs that make frequent use of calls through function pointers because for them the dynamic pointer data results in a considerably smaller call graph, which leads to fewer data dependences. Programs without or with only few calls through function pointers, however, show considerably less improvement. We discovered that C programs appear to have a significant fraction of direct and nonspurious pointer data dependences so that reducing spurious dependences via pointers is only of limited benefit. Consequently, to make slicing useful in general for such programs, improvements beyond better pointer analyses are necessary. On the other hand, since we show that collecting dynamic function pointer information can be performed with little overhead (average slowdown of 10 percent for our benchmarks), dynamic pointer information may be a practical approach to making slicing of programs with frequent function pointer use more successful in practice.
- Published
- 2005
46. A type system for static and dynamic checking of C++ pointers
- Author
-
Giuseppe Della Penna
- Subjects
Java syntax ,Computer Networks and Communications ,Computer science ,Programming language ,Type systems ,Smart pointer ,Type system ,Type signature ,computer.software_genre ,C++, Legacy code, Pointer analysis, Code safety, Type systems ,Allocator ,Pointer (computer programming) ,Pointer analysis ,Type safety ,Run-time type information ,Code safety ,computer ,C++ ,Software ,Legacy code - Abstract
Object-oriented programming is the most used programming paradigm when dealing with large-scale, modular software. In this field, the two leading languages are Java and C++. The former has superior qualities in terms of safety and ease of programming, whereas the latter is often considered an ''old'' language, too complex and potentially unsafe. In this paper, we describe a new type system designed to analyze the security problems derived from pointer manipulation in C++. This type system tries to trap the most common errors through static analysis, i.e., at compile-time, and only when static analysis fails it generates and embeds code fragments that apply runtime checks on specific instructions. The aim of this new type system is to give C++ the same safety of Java in the most important memory-related operations, without adding much runtime overhead. An experimental implementation of the type system is also presented, embedded in a C++ analysis tool called GPCC.
- Published
- 2005
47. A garbage collection policy based on empirical behavior
- Author
-
J. Morris Chang and Woo Hyong Lee
- Subjects
Information Systems and Management ,Computer science ,Memory corruption ,Parallel computing ,Static memory allocation ,Execution time ,Theoretical Computer Science ,Memory leak ,Dynamic memory management ,Placement syntax ,Artificial Intelligence ,Interleaved memory ,Memory safety ,Manual memory management ,C dynamic memory allocation ,Smart pointer ,Memory map ,Computer Science Applications ,Allocator ,Memory management ,Control and Systems Engineering ,Pointer (computer programming) ,Region-based memory management ,Memory model ,Garbage ,Software ,Garbage collection - Abstract
Many C++ studies show that dynamic memory management is one of the most expensive components in many software systems. C++ programs tend to carry out object creation and deletion prolifically. As a result, dynamic memory management can consume up to 30% of the program execution time in C++. In many cases, programmers need automatic dynamic memory management to free them from the problem of having to manage the C++'s large number of memory invocations. Unlike other object-oriented languages, C++ does not contain an automatic memory management policy among its language features. This paper presents a garbage collection strategy, called GC++, which collects garbage automatically with high speed of object allocation/deallocation. This high speed allocation/deallocation come from the utilization of memory allocation/deallocation behavior.The C++ allocation/deallocation patterns are determined experimentally in this paper. The proposed scheme is made feasible by minimizing memory allocation/deal-location calls and reusing objects based on other empirical investigations. To implement GC++, we applied the technique of Smart Pointer, which is one of the standard template containers. Our allocation scheme is simple and fast, since it requires no splitting and coalescing, and reduces the number of malloc() calls. It maintains its own free-list, which is used for object-reuse. Our scheme is purely source-code oriented and built on the top of the normal C++ memory manager. Therefore, this approach is portable, can be applied with existing code and is safe to use with different memory managers.
- Published
- 2004
48. The implementation of generic smart pointers for advanced defensive programming
- Author
-
Anthony Savidis
- Subjects
Manual memory management ,Indirection ,Reference counting ,Computer science ,Hazard pointer ,Programming language ,Smart pointer ,computer.software_genre ,Memory leak ,Memory management ,Dangling pointer ,TheoryofComputation_LOGICSANDMEANINGSOFPROGRAMS ,Pointer (computer programming) ,Operating system ,Macro ,computer ,Pointer analysis ,Garbage ,Memory safety ,Software ,Garbage collection - Abstract
Smart pointers denote a well-known technique for collective resource ownership, e.g. sharing dynamic object instances, while usually supporting automatic garbage collection based on reference counting. The original method has been retargeted to serve as a generic defensive programming method for 'exhaustive tracking' of erroneous pointer use in C++. Automatic bug tracking is supported in a unified manner both for pointers to heap memory, i.e. free storage, as well as for pointers to stack or global memory, i.e. auto or static storage. Overall, the presented technique (a) offers a simple contract for memory allocation and use; (b) supports type and indirection depth genericity; (c) implements most operators supported for built-in pointers with embedded bug defense; (d) offers an alternative way of employing a garbage collection facility for memory leak detection; and (e) provides an appropriate collection of utility macros, through which defensive pointers should be used, with an alternative version re-targeted to normal native pointers.
- Published
- 2004
49. DIPS: an efficient pointer swizzling strategy for incremental uncaching environments
- Author
-
Jun-Ki Min and Chin-Wan Chung
- Subjects
Computer science ,Distributed computing ,Smart pointer ,Parallel computing ,Object (computer science) ,Hardware and Architecture ,Pointer swizzling ,Pointer (computer programming) ,Escape analysis ,Locality of reference ,Table (database) ,Overhead (computing) ,Virtual function ,Software ,Information Systems - Abstract
Pointer swizzling improves the performance of OODBMSs by reducing the number of table lookups. However, the object replacement incurs the unswizzling overhead. In this paper, we propose a new pointer swizzling strategy, the dynamic indirect pointer swizzling (DIPS). DIPS dynamically applies pointer swizzling techniques in order to reduce the overhead of unswizzling. DIPS uses the temporal locality information which is gathered by the object buffer manager. The information is used to select the object to whose pointers the pointer swizzling techniques are applied and to dynamically bind the pointer swizzling techniques using the virtual function mechanism. We show the efficiency of the proposed strategy through experiments over various object buffer sizes and workloads.
- Published
- 2004
50. Precise Call Graphs for C Programs with Function Pointers
- Author
-
Ana Milanova, Atanas Rountev, and Barbara G. Ryder
- Subjects
Tagged pointer ,Pointer aliasing ,Computer science ,Programming language ,Opaque pointer ,Smart pointer ,Call graph ,computer.software_genre ,Function pointer ,Pointer swizzling ,Dangling pointer ,Pointer (computer programming) ,Escape analysis ,Pointer analysis ,computer ,Software - Abstract
The use of pointers presents serious problems for software productivity tools for software understanding, restructuring, and testing. Pointers enable indirect memory accesses through pointer dereferences, as well as indirect procedure calls (e.g., through function pointers in C). Such indirect accesses and calls can be disambiguated with pointer analysis. In this paper we evaluate the precision of one specific pointer analysis (the FA pointer analysis by Zhang et al.) for the purposes of call graph construction for C programs with function pointers. The analysis is incorporated in a production-strength code-browsing tool from Siemens Corporate Research in which the program call graph is used as a primary tool for code understanding. The FA pointer analysis uses an inexpensive, almost-linear, flow- and context-insensitive algorithm. To measure analysis precision, we compare the call graph constructed by this analysis with the most precise call graph obtainable by a large category of existing pointer analyses. Surprisingly, for all our data programs the FA analysis achieves the best possible precision. This result indicates that for the purposes of call graph construction, inexpensive pointer analyses may provide precision comparable to the precision of expensive pointer analyses.
- Published
- 2004
Catalog
Discovery Service for Jio Institute Digital Library
For full access to our library's resources, please sign in.