1996 ◽  
Vol 31 (5) ◽  
pp. 44-53 ◽  
Author(s):  
David Evans

2021 ◽  
Vol 5 (OOPSLA) ◽  
pp. 1-28
Author(s):  
Karl Cronburg ◽  
Samuel Z. Guyer

Dynamic memory managers are a crucial component of almost every modern software system. In addition to implementing efficient allocation and reclamation, memory managers provide the essential abstraction of memory as distinct objects, which underpins the properties of memory safety and type safety. Bugs in memory managers, while not common, are extremely hard to diagnose and fix. One reason is that their implementations often involve tricky pointer calculations, raw memory manipulation, and complex memory state invariants. While these properties are often documented, they are not specified in any precise, machine-checkable form. A second reason is that memory manager bugs can break the client application in bizarre ways that do not immediately implicate the memory manager at all. A third reason is that existing tools for debugging memory errors, such as Memcheck, cannot help because they rely on correct allocation and deallocation information to work. In this paper we present Permchecker, a tool designed specifically to detect and diagnose bugs in memory managers. The key idea in Permchecker is to make the expected structure of the heap explicit by associating typestates with each piece of memory. Typestate captures elements of both type (e.g., page, block, or cell) and state (e.g., allocated, free, or forwarded). Memory manager developers annotate their implementation with information about the expected typestates of memory and how heap operations change those typestates. At runtime, our system tracks the typestates and ensures that each memory access is consistent with the expected typestates. This technique detects errors quickly, before they corrupt the application or the memory manager itself, and it often provides accurate information about the reason for the error. The implementation of Permchecker uses a combination of compile-time annotation and instrumentation, and dynamic binary instrumentation (DBI). Because the overhead of DBI is fairly high, Permchecker is suitable for a testing and debugging setting and not for deployment. It works on a wide variety of existing systems, including explicit malloc/free memory managers and garbage collectors, such as those found in JikesRVM and OpenJDK. Since bugs in these systems are not numerous, we developed a testing methodology in which we automatically inject bugs into the code using bug patterns derived from real bugs. This technique allows us to test Permchecker on hundreds or thousands of buggy variants of the code. We find that Permchecker effectively detects and localizes errors in the vast majority of cases; without it, these bugs result in strange, incorrect behaviors usually long after the actual error occurs.


2017 ◽  
Author(s):  
Gina T Bednarek ◽  
Kristin Shutts

The present research tested whether three-year-old children – like older children and adults – automatically encode other people’s gender. Three-year-old participants (N = 24) learned facts about unfamiliar target children who varied in gender and were asked to remember facts about the targets during a test phase. At test, children made more within-category memory errors (e.g., misattributing a fact associated with one girl to another girl) than between-category errors (e.g., misattributing a fact associated with a girl to a boy). The findings suggest that at least as early as three years of age, children automatically encode whether someone is a boy or a girl upon first meeting them. The results have implications for our understanding of the automaticity and emergence of stereotyping processes.


2009 ◽  
Vol 29 (5) ◽  
pp. 1376-1379 ◽  
Author(s):  
Bai-qiang CHEN ◽  
Tao GUO ◽  
Hui RUAN ◽  
Jun YAN

2011 ◽  
Vol 30 (12) ◽  
pp. 3349-3353 ◽  
Author(s):  
Jia-xing LU ◽  
Fan GUO ◽  
Min YU
Keyword(s):  

Author(s):  
Joseph F. Boudreau ◽  
Eric S. Swanson

While there is no such thing as a “typical” C++ class, several common syntactical constructs lend themselves to extremely widespread use and must be mastered by C++ programmers. To motivate the discussion of software design at the level of the C++ class, examples from computer science and optics are introduced. Important syntactical elements such as constructors, destructors, copy constructors, assignment operators, cast operators, and const qualifiers, together with function overloading, operator overloading, and dynamic memory allocation are discussed. These concepts, illustrated with examples from physics, are presented and explained. Further examples from optical and quantum mechanical problems are left to the exercises. This chapter and its exercises gives the reader sufficient information to begin developing his or her own classes and to experiment with class design through trial and error.


Sign in / Sign up

Export Citation Format

Share Document