[go: up one dir, main page]
More Web Proxy on the site http://driver.im/ skip to main content
article
Open access

Implicit array bounds checking on 64-bit architectures

Published: 01 December 2006 Publication History

Abstract

Several programming languages guarantee that array subscripts are checked to ensure they are within the bounds of the array. While this guarantee improves the correctness and security of array-based code, it adds overhead to array references. This has been an obstacle to using higher-level languages, such as Java, for high-performance parallel computing, where the language specification requires that all array accesses must be checked to ensure they are within bounds. This is because, in practice, array-bounds checking in scientific applications may increase execution time by more than a factor of 2. Previous research has explored optimizations to statically eliminate bounds checks, but the dynamic nature of many scientific codes makes this difficult or impossible. Our approach is, instead, to create a compiler and operating system infrastructure that does not generate explicit bounds checks. It instead places arrays inside of Index Confinement Regions (ICRs), which are large, isolated, mostly unmapped virtual memory regions. Any array reference outside of its bounds will cause a protection violation; this provides implicit bounds checking. Our results show that when applying this infrastructure to high-performance computing programs written in Java, the overhead of bounds checking relative to a program with no bounds checks is reduced from an average of 63% to an average of 9%.

References

[1]
Artigas, P., Gupta, M., Midkiff, S., and Moreira, J. 2000. Automatic loop transformations and parallelization for Java. In Proc. ACM International Conference on Supercomputing. 1--10.
[2]
Bailey, D., Barton, J., Lasinski, T., and Simon, H. 1991. The NAS parallel benchmarks. RNR-91-002, NASA Ames Research Center.
[3]
BEA. 2005. BEA JRockit whitepaper (http://www.bea.com/content/news_events/white_papers/bea_jrockit_wp.pdf).
[4]
Bodik, R., Gupta, R., and Sarkar, V. 2000. ABCD: eliminating array-bounds checks on demand. In Proc. ACM Conference on Programming Language Design and Implementation. 321--333.
[5]
Boisvert, R. F., Dongarra, J. J., Pozo, R., Remington, K. A., and Stewart, G. W. 1998. Optimizing array reference checking in Java programs. Concurrency: Practice and Experience 10, 11-13, 1117--1129.
[6]
Chase, J. S., Levy, H. M., Feeley, M. J., and Lazowska, E. D. 1994. Sharing and protection in a single address space operating system. ACM Transactions on Computer Systems 12, 4 (May), 271--307.
[7]
Chiueh, T. and Hsu, F. 2001. RAD: A compile-time solution to buffer overflow attacks. In Proc. IEEE International Conference on Distributed Computing Systems. 409--420.
[8]
Cowan, C., Pu, C., Maier, D., Walpole, J., Bakke, P., Beattie, S., Grier, A., Wagle, P., Zhang, Q., and Hinton, H. 1998. StackGuard: Automatic adaptive detection and prevention of buffer-overflow attacks. In Proc. USENIX Security Conference. 63--78.
[9]
Dahn, C. and Mancoridis, S. 2003. Using program transformation to secure c programs against buffer overflows. In Working Conference on Reverse Engineering. 323--333.
[10]
Frumkin, M., Schultz, M., Jin, H., and Yan, J. 2002. Implementation of the NAS parallel benchmarks in Java. NAS-02-009, NASA Ames Research Center.
[11]
Gupta, R. 1993. Optimizing array-bound checks using flow analysis. ACM Letters on Programming Languages and Systems 2, 1--4 (Mar.--Dec.), 135--150.
[12]
Intel. 2006. Intel Itanium Architecture Software Developer's Manual (http://download.intel.com/design/itanium/manuals/24531705.pdf).
[13]
Itzkovitz, A. and Schuster, A. 1999. Multiview and Millipage---fine-grain sharing in page-based DSMs. In Proc. USENIX Operating Systems Design and Implementation. 215--228.
[14]
Java hotspot vm options (http://java.sun.com/docs/hotspot/vmoptions.html).
[15]
Kolte, P. and Wolfe, M. 1995. Elimination of redundant array subscript range checks. In Proc. ACM Conference on Programming Language Design and Implementation. 270--278.
[16]
Lam, L. and Chiueh, T. 2005. Checking array-bound violation using segmentation hardware. In Proc. IEEE International Conference on Dependable Systems and Networks. 388--397.
[17]
Markstein, V., Cocke, J., and Markstein, P. 1982. Optimization of range checking. In Proc. ACM Conference on Programming Language Design and Implementation. 114--119.
[18]
McGary, G. Bounds-checking C compiler (http://www.gnu.org/software/gcc/projects/bp/main.html).
[19]
Midkiff, S. P., Moreira, J. E., and Snir, M. 1998. Optimizing array reference checking in Java programs. IBM Systems Journal 37, 3, 409--453.
[20]
Moreira, J., Midkiff, S. P., Gupta, M., Artigas, P., and Snir, M. 2000. Java programming for high performance numerical computing. IBM Systems Journal 39, 1, 21--56.
[21]
Mosberger, D. and Eranian, S. 2002. IA-64 Linux Kernel: Design and Implementation. Prentice-Hall, Eaglewood Cliffs, NJ.
[22]
Perens, B. Electric Fence (http://sunsite.unc.edu/pub/linux/devel/lang/c/electricfence-2.0.5.tar.gz).
[23]
Rugina, R. and Rinard, M. C. 2000. Symbolic bounds analysis of pointers, array indices, and accessed memory regions. In Proc. ACM Conference on Programming Language Design and Implementation. 182--195.
[24]
SUN. 2002. The Java HotSpot virtual machine (http://java.sun.com/products/hotspot/docs/whitepaper/java_hotspot_v1.4.1/jhs_141_wp_d2a.pdf).
[25]
Talluri, M., Hill, M. D., and Khalidi., Y. A. 1995. A new page table for 64-bit address spaces. In Proc. ACM Symposium on Operating Systems Principles. 184--200.
[26]
Winwood, S., Shuf, Y., and Franke, H. 2002. Multiple page size support in the linux kernel.
[27]
Xi, H. and Pfenning, F. 1998. Eliminating array-bound checking through dependent types. In Proc. ACM Conference on Programming Language Design and Implementation. 249--257.
[28]
Xi, H. and Xia, S. 1999. Towards array-bound check elimination in Java virtual machine langauge. In Proc. Centre for Advanced Studies Conference. 110--125.
[29]
Young, M., Avadis Tevanian, J., Rashid, R., Eppinger, D. G. J., Chew, J., Bolosky, W., Black, D., and Baron, R. 1987. The duality of memory and communication in the implementation of a multiprocessor operating system. In Proc. ACM Symposium on Operating Systems Principles. 63--76.

Recommendations

Reviews

R. Clayton

Manipulating virtual memory implementations to provide improved primary storage access protection has a long and fruitful history. Changes in technologies and applications make possible new manipulations providing better protection. This paper describes how Java and 64-bit architectures can be exploited to provide time-efficient array bounds checking. Java requires that out-of-bound array accesses be detected and flagged; the cost of doing so can be expensive for array-intensive applications. However, artfully mapping each array dimension into a contiguous virtual memory segment can reduce array bounds checking to unmapped page access, moving the problem from an expensive language to a relatively cheaper operating system. Because practical programs can have many large segments, a 64-bit address space is essential. However, even with a 64-bit address space, the segment population can stress the operating system, a problem ameliorated by modifying the virtual memory subsystem. Balancing these factors as described in this paper results in code with no explicit checks but full array bounds checking at a cost within 10 percent of not doing any checks at all. This paper is excellent, well written, and clear. Java knowledge is not required; basic memory management knowledge is helpful but not required. In addition to being a model solution for the problem at hand, this paper can also serve as a good example of the engineering influences and tradeoffs found when working at the intersection of user applications, system software, and operating systems. Online Computing Reviews Service

Access critical reviews of Computing literature here

Become a reviewer for Computing Reviews.

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM Transactions on Architecture and Code Optimization
ACM Transactions on Architecture and Code Optimization  Volume 3, Issue 4
December 2006
169 pages
ISSN:1544-3566
EISSN:1544-3973
DOI:10.1145/1187976
Issue’s Table of Contents
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 01 December 2006
Published in TACO Volume 3, Issue 4

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. 64-bit architectures
  2. Array-bounds checking
  3. virtual memory

Qualifiers

  • Article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • 0
    Total Citations
  • 715
    Total Downloads
  • Downloads (Last 12 months)47
  • Downloads (Last 6 weeks)14
Reflects downloads up to 11 Dec 2024

Other Metrics

Citations

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Login options

Full Access

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media