When pthread create returns argument tid contains the

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

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 difficult 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 finally 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

This note was uploaded on 09/02/2010 for the course ELECTRICAL 360 taught by Professor Schultz during the Spring '10 term at BYU.

Ask a homework question - tutors are online