Java Memory Model Simulation using SMT Solver

SMT 해결기를 이용한 자바 메모리 모델 시뮬레이션

  • 이태훈 (경기대학교 정보과학부) ;
  • 권기현 (경기대학교 정보과학부)
  • Published : 2009.01.15

Abstract

Recently developed compilers perform some optimizations in order to speed up the execution time of source program. These optimizations require the transformation of the sequence of program statements. This transformation does not give any problems in a single-threaded program. However, the transformation gives some significant errors in a multi-threaded program. State-of-the-art model checkers such as Java-Pathfinder do not consider the transformation resulted in the optimization step in a compiler since they just consider a single memory model. In this paper, we describe a new technique which is based on SMT solver. The Java Memory Model Simulator based on SMT Solver can compute all possible output of given multi-thread program within one second which, in contrast, Traditional Java Memory Model Simulator takes one minute.

많은 컴파일러는 속도를 높이기 위해서 최적화를 수행한다. 최적화의 결과로 프로그램의 구문이 변경된다. 단일 스레드 소프트웨어에서는 변경된 구문이 영향을 받지 않지만 멀티스레드 소프트웨어에서는 변경된 구문 때문에 예상하지 못한 실행 결과가 발생할 수 있다. 멀티 스레드자바 소프트웨어는 스레드들 간에 메모리를 통한 상호작용을 자바 메모리 모델을 통해서 명세 한다. 자바 메모리 모델은 자바언어의 표준 메모리 모델이다. 하지만 현재까지 나와 있는 어떠한 자바 모델 체킹 도구도 자바 메모리 모델을 지원하지 않는다. 본 논문에서는 자바 메모리 모델을 지원하는 모델 체킹 도구를 개발하기 위해서 자바 메모리 모델을 지원하는 시물레이터를 많은 모델 체킹 도구에서 사용되는 SMT 기반으로 구현했다. SMT 기반 메모리 모델 시뮬레이터는 기존의 메모리 모델 시뮬레이터에서 몇분이 걸리는 계산 결과를 1초 이내에 계산하였다. 또한 이를 통해 기존 소프트웨어 모델 체킹에서 표현할 수 없는 실행 결과를 빠르게 표현할 수 있다.

Keywords

References

  1. J. Gosling, B. Joy, G. Steele and G. Bracha, “The Java Language Specification Third Edition,” Addi-son-Wesley, 2005
  2. J. Manson and W. Pugh “The Java Memory Model Simulator,” In Workshop on Formal Tech-niques for Java-like Programs, in association with ECOOP. June, 2002
  3. T. Q. Huynh and A. Roychoudhury, “Memory model sensitive bytecode verification,” Formal Methods In System Design Volume 31, Number 3, pp. 271-305, October 18, 2007 https://doi.org/10.1007/s10703-007-0041-6
  4. F. Pong and M. Dubois, “Formal Automatic Verification of Cache Coherence in Multiproces-sors with Relaxed Memory Models,” IEEE Transactions on Parallel and Distributed System, Volume 11, Issue 9, pp. 989-1006, 2000 https://doi.org/10.1109/71.879780
  5. A. Biere, A. Cimatti, E.M Clarke, O. Strichman, and Y. Zhu, “Bounded Model Checking,” Vol. 58 of Advances in Computers, 2003
  6. A. Armando, J. Mantovani, and L. Platania, “Bou-nded Model Checking of Software using SMT Solvers instead of SAT Solvers,” In the pro-ceedings of the 13th SPIN workshop, Vienna(A). LNCS 3925, Springer Verlag. 2006
  7. T. Ball, R. Majumdar, T. Milistein, and S.K. Rajamani. “Automatic Predicate Abstraction of C Programs,” In the Procedings of PLDI, SIGPLAN Notices 36(5), pp. 203-213, 2001 https://doi.org/10.1145/381694.378846
  8. E.M. Clarke, O. Grumberg, S. Jha, Y. Lu, and H. Veith, "Counterexample-guided abstraction refinement," In Proc. Computer-Aided Verification 2000, Lecture Notes in Computer Science. Springer, 2000 https://doi.org/10.1007/10722167
  9. L. Moura and N. Bjorner, “Z3: An Efficient SMT Solver,” Conference on Tools and Algorithms for the Construction and Analysis of Systems(TACAS), Budapest, Hungary, 2008
  10. E.M. Clarke, D. Kroening, and F. Lerda, “A Tool for Checking ANSI-C Programs,” Lecture Notes in Computer Science 2988, pp. 168-176, 2004
  11. L. Lamport, "How to make a multiprocessor com-puter that correctly executes multiprocess pro-grams," IEEE Transactions on Computers 9, 29, 690-691, 1979 https://doi.org/10.1109/TC.1979.1675439
  12. J. Manson, W. Pugh, S.V. Adve, "The Java Memory Model," In the Proceedings of the POPL 2005, pp. 378-391, 2005
  13. B. Dutertre and L. Moura, "The YICES SMT Solver," Computer Science Laboratory, SRI Inter-national, 2006. http://yices.csl.sri.com