Abstract
We present an automated and configurable technique for runtime safety analysis of multithreaded programs that is able to predict safety violations from successful executions. Based on a formal specification of safety properties provided by a user, our technique enables us to automatically instrument a given program and create an observer so that the program emits relevant state update events to the observer and the observer checks these updates against the safety specification. The events are stamped with dynamic vector clocks, enabling the observer to infer a causal partial order on the state updates. All event traces that are consistent with this partial order, including the actual execution trace, are then analyzed online and in parallel. A warning is issued whenever one of these potential traces violates the specification. Our technique is scalable and can provide better coverage than conventional testing, but its coverage need not be exhaustive. In fact, one can trade off scalability and comprehensiveness: a window in the state space may be specified allowing the observer to infer some of the more likely runs; if the size of the window is 1, then only the actual execution trace is analyzed, as is the case in conventional testing; if the size of the window is ∞, then all the execution traces consistent with the actual execution trace are analyzed.
Similar content being viewed by others
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. Reading, MA: Addison-Wesley 1993
Barringer, H., Goldberg, A., Havelund, K., Sen, K.: Rule-based runtime verification. In: Proceedings of the 5th International Conference on Verification, Model Checking and Abstract Interpretation (VMCAI’04). Lecture Notes in Computer Science, vol. 2937, pp. 44–57. Venice, Italy, Berlin, Heidelberg, New York: Springer 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. New York: ACM Press 2002
Choi, J.D., Gupta, M., Serrano, M.J., Sreedhar, V.C., Midkiff, S.P.: Escape analysis for java. In: Proceedings of the 1999 ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages and Applications (OOPSLA ’99), SIGPLAN Notices, Denver, CO, 34(10), 1–19 (1999)
Dahm, M.: Byte code engineering with the bcel api. Technical Report B-17-98, Freie Universit at Berlin, Institut für Informatik (2001)
Dick, J., Faivre, A.: Automating the generation and sequencing of test cases from model-based specifications. In: Proceedings of Formal Methods Europe (FME’93): Industrial Strength Formal Methods. Lecture Notes in Computer Science, vol. 670, pp. 268–284. Berlin, Heidelberg, New York: Springer 1993
Drusinsky, D.: Temporal rover. http://www.time-rover.com
Drusinsky, D.: The temporal rover and the ATG rover. In: SPIN Model Checking and Software Verification. Lecture Notes in Computer Science, vol. 1885, pp. 323–330. Berlin, Heidelberg, New York: Springer 2000
Drusinsky, D.: Monitoring temporal rules combined with time series. In: Proceedings of CAV’03: Computer Aided Verification. Boulder, CO. Lecture Notes in Computer Science, vol. 2725, pp. 114–118. Berlin, Heidelberg, New York: Springer 2003
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. New York: ACM Press 1988
Gunter, E.L., Kurshan, R.P., Peled, D.: PET: An interactive software testing tool. In: Computer Aided Verification (CAV’00). Lecture Notes in Computer Science, vol. 1885, pp. 552–556. Berlin, Heidelberg, New York: Springer 2003
Havelund, K., Roşu, G.: Monitoring java programs with java PathExplorer. In: Proceedings of the 1st Workshop on Runtime Verification (RV’01). Electronic Notes in Theoretical Computer Science, vol. 55. Amsterdam: Elsevier 2001
Havelund, K., Rošu, G.: Synthesizing monitors for safety properties. In: Proceedings of the 8th International Conference on Tools and Algorithms for the Construction and Analysis of Systems (TACAS’02). Lecture Notes in Computer Science, vol. 2280, pp. 342–356. Berlin, Heidelberg, New York: Springer 2002
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). Electronic Notes in Theoretical Computer Science, vol. 55. Amsterdam: Elsevier 2001
Lee, D., Yannakakis, M.: Principles and methods of testing finite state machines – A survey. Proc IEEE 84, 1090–1126 (1996)
Lencevicius, R., Ran, A., Yairi, R.: Third eye specification-based analysis of software execution traces. In: International Workshop on Automated Program Analysis, Testing and Verification (Workshop of ICSE 2000), pp. 51–56 (2000)
Marzullo, K., Neiger, G.: Detection of global state predicates. In: Proceedings of the 5th International Workshop on Distributed Algorithms (WADG’91). Lecture Notes in Computer Science, vol. 579, pp. 254–272. Berlin, Heidelberg, New York: Springer 1991
Mattern, M.: Virtual time and global states of distributed systems. In: Proceedings of the International Workshop on Parallel and Distributed Algorithms, pp. 215–226. Amsterdam: Elsevier 1989
Sen, A., Garg, V.K.: Partial order trace analyzer (pota) for distrubted programs. In: Proceedings of the 3rd Workshop on Runtime Verification (RV’03). Electronic Notes in Theoretical Computer Science, vol. 89. Amsterdam: Elsevier 2003
Sen, K., Roşu, G.: Generating optimal monitors for extended regular expressions. In: Proceedings of the 3rd Workshop on Runtime Verification (RV’03). Electronic Notes in Theoretical Computer Science, vol. 89. Amsterdam: Elsevier 2003
Sen, K., Roşu, G., Agha, G.: Generating optimal linear temporal logic monitors by coinduction. In: Proceedings of the 8th Asian Computing Science Conference (ASIAN’03). Lecture Notes in Computer Science, vol. 2896, pp. 260–275. Berlin, Heidelberg, New York: Springer 2003
Sen, K., Roşu, G., Agha, G.: Runtime safety analysis of multithreaded programs. In: Proceedings of the 4th Joint European Software Engineering Conference and ACM SIGSOFT Symposium on the Foundations of Software Engineering (ESEC/FSE’03). New York: ACM Press 2003
Sen, K., Roşu, G., Agha, G.: Online efficient predictive safety analysis of multithreaded programs. In: Proceedings of the 10th International Conference on Tools and Algorithms for the Construction and Analysis of Systems (TACAS’04), Barcelona. Lecture Notes in Computer Science, vol. 2988, pp. 123–138. Berlin, Heidelberg, New York: Springer 2004
Shtrichman, O., Goldring, R.: The ‘logic-assurance’ system – a tool for testing and controlling real-time systems. In: Proceedings of the 8th Israeli Conference on Computer Systems and Sofware Engineering (ICCSSE97), pp. 47–55 (1997)
Stockmeyer, L.J., Meyer, A.R.: Word problems requiring exponential time (preliminary report), pp. 1–9. New York: ACM Press 1973
Vilkomir, S.A., Bowen, J.P.: Formalization of software testing criteria using the Z notation. In: Proceedings of COMPSAC 01: 25th IEEE Annual International Computer Software and Applications Conference, pp. 351–356. New York: IEEE Press 2001
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
About this article
Cite this article
Sen, K., Roşu, G. & Agha, G. Online efficient predictive safety analysis of multithreaded programs. Int J Softw Tools Technol Transfer 8, 248–260 (2006). https://doi.org/10.1007/s10009-005-0192-y
Published:
Issue Date:
DOI: https://doi.org/10.1007/s10009-005-0192-y