This preview shows page 1. Sign up to view the full content.
Unformatted text preview: lue happens to correspond to an address in the payload of some other allocated block . There is no way for the collector to infer that the data is really an int and not a pointer. Thus the allocator must conservatively mark block as reachable, when in fact it might not be. 10.11 Common Memory-related Bugs in C Programs
Managing and using virtual memory can be a difﬁcult and error-prone task for the C programmers. Memoryrelated bugs are among the most frightening because they often manifest themselves at a distance, in both time and space, from the source of the bug. Write the wrong data to the wrong location, and your program can run for hours before it ﬁnally fails in some distant part of the program. We conclude our discussion of virtual memory with a discussion of some of the common memory-related bugs. 10.11.1 Dereferencing Bad Pointers
As we learned in Section 10.7.2, there are large holes in the virtual address space of a process that are not mapped to any meaningful data. If w...
View Full Document