Skip to main content

A Reversible Debugger for Imperative Parallel Programs with Contracts

  • Conference paper
  • First Online:
Reversible Computation (RC 2022)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 13354))

Included in the following conference series:

  • 360 Accesses

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 54.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 69.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    An implementation of the reversible debugger in this paper is at: https://github.com/syuen1/RevDebugger/.

  2. 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

  1. 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)

    Google Scholar 

  2. 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

    Chapter  Google Scholar 

  3. 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

    Chapter  Google Scholar 

  4. 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)

    Google Scholar 

  5. 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

    Chapter  MATH  Google Scholar 

  6. Ikeda, T., Yuen, S.: A reversible runtime for parallel programs with recursive blocks. IPSJ Trans. Program. (PRO) 14(5), 34–48 (2021). (in Japanese)

    Google Scholar 

  7. 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

    Chapter  Google Scholar 

  8. 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

    Chapter  Google Scholar 

  9. 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

    Chapter  Google Scholar 

  10. 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

    Chapter  Google Scholar 

  11. 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

  12. Shibanai, K., Watanabe, T.: Actoverse: a reversible debugger for actors. In: Proceedings of AGERE 2017, pp. 50–57. ACM (2017)

    Google Scholar 

Download references

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

Authors

Corresponding author

Correspondence to Shoji Yuen .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2022 The Author(s), under exclusive license to Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

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)

Publish with us

Policies and ethics