TY - GEN
T1 - Efficiently detecting all dangling pointer uses in production servers
AU - Dhurjati, Dinakar
AU - Adve, Vikram
PY - 2006
Y1 - 2006
N2 - In this paper, we propose a novel technique to detect all dangling pointer uses at run-time that is ef cient enough for production use in server codes. One idea (previously used by Electric Fence, PageHeap) is to use a new virtual page for each allocation of the program and rely on page protection mechanisms to check dangling pointer accesses. This naive approach has two limitations that makes it impractical to use in production software: increased physical memory usage and increased address space usage. We propose two key improvements that alleviate both these problems. First, we use a new virtual page for each allocation of the program but map it to the same physical page as the original allocator. This allows using nearly identical physical memory as the original program while still retaining the dangling pointer detection capability. We also show how to implement this idea without requiring any changes to the underlying memory allocator. Our second idea alleviates the problem of virtual address space exhaustion by using a previously developed compiler transformation called Automatic Pool Allocation to reuse many virtual pages. The transformation partitions the memory of the program based on their lifetimes and allows us to reuse virtual pages when portions of memory become inaccessible. Experimentally we nd that the run-time overhead for ve unix servers is less than 4%, for other unix utilities less than 15%. However, in case of allocation intensive benchmarks, we nd our overheads are much worse (up to 11x slowdown).
AB - In this paper, we propose a novel technique to detect all dangling pointer uses at run-time that is ef cient enough for production use in server codes. One idea (previously used by Electric Fence, PageHeap) is to use a new virtual page for each allocation of the program and rely on page protection mechanisms to check dangling pointer accesses. This naive approach has two limitations that makes it impractical to use in production software: increased physical memory usage and increased address space usage. We propose two key improvements that alleviate both these problems. First, we use a new virtual page for each allocation of the program but map it to the same physical page as the original allocator. This allows using nearly identical physical memory as the original program while still retaining the dangling pointer detection capability. We also show how to implement this idea without requiring any changes to the underlying memory allocator. Our second idea alleviates the problem of virtual address space exhaustion by using a previously developed compiler transformation called Automatic Pool Allocation to reuse many virtual pages. The transformation partitions the memory of the program based on their lifetimes and allows us to reuse virtual pages when portions of memory become inaccessible. Experimentally we nd that the run-time overhead for ve unix servers is less than 4%, for other unix utilities less than 15%. However, in case of allocation intensive benchmarks, we nd our overheads are much worse (up to 11x slowdown).
UR - http://www.scopus.com/inward/record.url?scp=33845580061&partnerID=8YFLogxK
UR - http://www.scopus.com/inward/citedby.url?scp=33845580061&partnerID=8YFLogxK
U2 - 10.1109/DSN.2006.31
DO - 10.1109/DSN.2006.31
M3 - Conference contribution
AN - SCOPUS:33845580061
SN - 0769526071
SN - 9780769526072
T3 - Proceedings of the International Conference on Dependable Systems and Networks
SP - 269
EP - 278
BT - Proceedings - DSN 2006
T2 - DSN 2006: 2006 International Conference on Dependable Systems and Networks
Y2 - 25 June 2006 through 28 June 2006
ER -