Abstract
A predictive runtime analysis technique is proposed for detecting violations of safety properties from apparently successful executions of concurrent systems. In this paper we focus on concurrent systems developed using common object-oriented multithreaded programming languages, in particular, Java. Specifically, we provide an algorithm to observe execution traces of multithreaded programs and, based on appropriate code instrumentation that allows one to atomically extract a partial-order causality from a linear sequence of events, we predict other schedules that are compatible with the run. The technique uses a weak happens-before relation which orders a write of a shared variable with all its subsequent reads that occur before the next write to the variable. A permutation of the observed events is a possible execution of a program if and only if it does not contradict the weak happens-before relation. Even though an observed execution trace may not violate the given specification, our algorithm infers other possible executions (consistent with the observed execution) that violate the given specification, if such an execution exists. Therefore, it can predict concurrency errors from non-violating runs.
Chapter PDF
Similar content being viewed by others
Keywords
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
References
Babaoğlu, O., Marzullo, K.: Consistent global states of distributed systems: Fundamental concepts and mechanisms. In: Mullender, S. (ed.) Distributed Systems, pp. 55–96 (1993)
Barringer, H., Goldberg, A., Havelund, K., Sen, K.: Rule-based runtime verification. In: Steffen, B., Levi, G. (eds.) VMCAI 2004. LNCS, vol. 2937, pp. 44–57. Springer, Heidelberg (2004)
Cain, H.W., Lipasti, M.H.: Verifying sequential consistency using vector clocks. In: Proceedings of the 14th annual ACM Symposium on Parallel Algorithms and Architectures, pp. 153–154. ACM, New York (2002)
Dahm, M.: Byte code engineering with the BCEL API. Technical Report B-17-98, Freie Universitat at Berlin, Institut für Informatik (April 2001)
Dinning, A., Schonberg, E.: Detecting access anomalies in programs with critical sections. In: Proc. of the ACM/ONR Workshop on Parallel and Distributed Debugging (1991)
Drusinsky, D.: Temporal Rover, http://www.time-rover.com
Drusinsky, D.: The Temporal Rover and the ATG Rover. In: Havelund, K., Penix, J., Visser, W. (eds.) SPIN 2000. LNCS, vol. 1885, pp. 323–330. Springer, Heidelberg (2000)
Fidge, C.J.: Partial orders for parallel debugging. In: Proceedings of the 1988 ACM SIGPLAN and SIGOPS workshop on Parallel and Distributed debugging, pp. 183–194. ACM, New York (1988)
Gunter, E.L., Kurshan, R.P., Peled, D.: PET: An interactive software testing tool. In: Havelund, K., Penix, J., Visser, W. (eds.) SPIN 2000. LNCS, vol. 1885, pp. 552–556. Springer, Heidelberg (2000)
Havelund, K., Roşu, G.: Monitoring Java Programs with Java PathExplorer. In: Proc. of Workshop on Runtime Verification (RV’01). ENTCS, vol. 55 (2001)
Havelund, K., Roşu, G.: Synthesizing monitors for safety properties. In: Katoen, J.-P., Stevens, P. (eds.) TACAS 2002. LNCS, vol. 2280, pp. 342–356. Springer, Heidelberg (2002)
Java MultiPathExplorer (JMPaX). Download, http://fsl.cs.uiuc.edu/jmpax/
Kim, M., Kannan, S., Lee, I., Sokolsky, O.: Java-MaC: a Run-time Assurance Tool for Java. In: Proceedings of the 1st Workshop on Runtime Verification (RV’01). ENTCS, vol. 55 (2001)
Mattern, F.: Virtual time and global states of distributed systems. In: Parallel and Distributed Algorithms: proceedings of the International Workshop on Parallel and Distributed Algorithms, pp. 215–226. Elsevier, Amsterdam (1989)
Savage, S., Burrows, M., Nelson, G., Sobalvarro, P., Anderson, T.: Eraser: A dynamic data race detector for multithreaded programs. ACM Transactions on Computer Systems 15(4), 391–411 (1997)
Sen, K., Roşu, G.: Generating optimal monitors for extended regular expressions. In: Proc. of the 3rd Workshop on Runtime Verification (RV’03). ENTCS, vol. 89, pp. 162–181 (2003)
Sen, K., Roşu, G., Agha, G.: Runtime safety analysis of multithreaded programs. In: Proceedings of 4th joint European Software Engineering Conference and ACM SIGSOFT Symposium on the Foundations of Software Engineering (ESEC/FSE’03). ACM, New York (2003)
Sen, K., Roşu, G., Agha, G.: Online efficient predictive safety analysis of multithreaded programs. In: Jensen, K., Podelski, A. (eds.) TACAS 2004. LNCS, vol. 2988, pp. 123–138. Springer, Heidelberg (2004)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2005 IFIP International Federation for Information Processing
About this paper
Cite this paper
Sen, K., Roşu, G., Agha, G. (2005). Detecting Errors in Multithreaded Programs by Generalized Predictive Analysis of Executions. In: Steffen, M., Zavattaro, G. (eds) Formal Methods for Open Object-Based Distributed Systems. FMOODS 2005. Lecture Notes in Computer Science, vol 3535. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11494881_14
Download citation
DOI: https://doi.org/10.1007/11494881_14
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-26181-0
Online ISBN: 978-3-540-31556-8
eBook Packages: Computer ScienceComputer Science (R0)