Abstract
We present a reversible debugger for imperative parallel programs with block structures. A program runs in the runtime of abstract machines executed concurrently, where each abstract machine has the instruction set both for forward executions and backward executions. In order to efficiently localize a defect, we annotate a program by contracts with expects and ensures as C++ contracts. When a condition at ensures is violated, there exists some defect. Then, the reversible runtime traces back to the last ensure annotation and check the configuration to find out the source of the problem. By repeating this process, it is possible to localize the defect efficiently, preserving the environment of that particular execution. For controlling executions of parallel blocks, annotations are with the condition expressions of blocks running in parallel and those for variables. We illustrate the debugging process by presenting a prototype implementation by Python.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
An implementation of the reversible debugger in this paper is at: https://github.com/syuen1/RevDebugger/.
- 2.
Here we use the extended BNF where \(A^*\) and \(A^+\) is the repetition of A more than 0-times and once respectively, and A? is either A or \(\varepsilon \).
References
Burlò, C.B., Francalanza, A., Scalas, A.: On the monitorability of session types, in theory and practice. In: Proceedings of ECOOP 2021. LIPIcs, vol. 194, pp. 20:1–20:30 (2021)
Giachino, E., Lanese, I., Mezzina, C.A.: Causal-consistent reversible debugging. In: Gnesi, S., Rensink, A. (eds.) FASE 2014. LNCS, vol. 8411, pp. 370–384. Springer, Heidelberg (2014). https://doi.org/10.1007/978-3-642-54804-8_26
Hoey, J., Lanese, I., Nishida, N., Ulidowski, I., Vidal, G.: A case study for reversible computing: reversible debugging of concurrent programs. In: Ulidowski, I., Lanese, I., Schultz, U.P., Ferreira, C. (eds.) RC 2020. LNCS, vol. 12070, pp. 108–127. Springer, Cham (2020). https://doi.org/10.1007/978-3-030-47361-7_5
Hoey, J., Ulidowski, I., Yuen, S.: Reversing parallel programs with blocks and procedures. In: Proceedings of EXPRESS/SOS 2018. EPTCS, vol. 276, pp. 69–86 (2018)
Ikeda, T., Yuen, S.: A reversible runtime environment for parallel programs. In: Lanese, I., Rawski, M. (eds.) RC 2020. LNCS, vol. 12227, pp. 272–279. Springer, Cham (2020). https://doi.org/10.1007/978-3-030-52482-1_18
Ikeda, T., Yuen, S.: A reversible runtime for parallel programs with recursive blocks. IPSJ Trans. Program. (PRO) 14(5), 34–48 (2021). (in Japanese)
Lanese, I., Nishida, N., Palacios, A., Vidal, G.: CauDEr: a causal-consistent reversible debugger for Erlang. In: Gallagher, J.P., Sulzmann, M. (eds.) FLOPS 2018. LNCS, vol. 10818, pp. 247–263. Springer, Cham (2018). https://doi.org/10.1007/978-3-319-90686-7_16
Lanese, I., Palacios, A., Vidal, G.: Causal-consistent replay debugging for message passing programs. In: Pérez, J.A., Yoshida, N. (eds.) FORTE 2019. LNCS, vol. 11535, pp. 167–184. Springer, Cham (2019). https://doi.org/10.1007/978-3-030-21759-4_10
Lienhardt, M., Lanese, I., Mezzina, C.A., Stefani, J.-B.: A reversible abstract machine and its space overhead. In: Giese, H., Rosu, G. (eds.) FMOODS/FORTE -2012. LNCS, vol. 7273, pp. 1–17. Springer, Heidelberg (2012). https://doi.org/10.1007/978-3-642-30793-5_1
Morandi, B., Bauer, S.S., Meyer, B.: SCOOP – a contract-based concurrent object-oriented programming model. In: Müller, P. (ed.) LASER 2007-2008. LNCS, vol. 6029, pp. 41–90. Springer, Heidelberg (2010). https://doi.org/10.1007/978-3-642-13010-6_3
Reis, G.D., Garcia, J.D., Lakos, J., Meredith, A., Myers, N., Stroustrup, B.: Support for contract based programming in C++ (2018). http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0542r3.html
Shibanai, K., Watanabe, T.: Actoverse: a reversible debugger for actors. In: Proceedings of AGERE 2017, pp. 50–57. ACM (2017)
Acknowledgement
The authors thank Dr. Irek Ulidwoski and Dr. James Hoey for their valuable discussion and suggestions while Dr. Ulidowski’s visit for JSPS Fellowship S21051. This work was supported b0y JSPS KAKENHI Grant Numbers JP17H01722 and JP21H03415.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2022 The Author(s), under exclusive license to Springer Nature Switzerland AG
About this paper
Cite this paper
Ikeda, T., Yuen, S. (2022). A Reversible Debugger for Imperative Parallel Programs with Contracts. In: Mezzina, C.A., Podlaski, K. (eds) Reversible Computation. RC 2022. Lecture Notes in Computer Science, vol 13354. Springer, Cham. https://doi.org/10.1007/978-3-031-09005-9_14
Download citation
DOI: https://doi.org/10.1007/978-3-031-09005-9_14
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-031-09004-2
Online ISBN: 978-3-031-09005-9
eBook Packages: Computer ScienceComputer Science (R0)