Skip to main content

On Implementing a Monitor-Oriented Programming Framework for Actor Systems

  • Conference paper
  • First Online:
Integrated Formal Methods (IFM 2016)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 9681))

Included in the following conference series:

Abstract

We examine the challenges of implementing a framework for automating Monitor-Oriented Programming in the context of actor-based systems. The inherent modularity resulting from delineations induced by actors makes such systems well suited to this style of programming because monitors can surgically target parts of the system without affecting the computation in other parts. At the same time, actor systems pose new challenges for the instrumentation of the resp. monitoring observations and actions, due to the intrinsic asynchrony and encapsulation that characterise the actor model. We discuss a prototype implementation that tackles these challenges for the case of Erlang OTP, an industry-strength platform for building actor-based concurrent systems. We also demonstrate the effectiveness of our Monitor-Oriented Programming framework by using it to augment the functionality of a third-party software written in Erlang.

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 69.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 89.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.

    Setting the trap_exit flag to false causes linked actors to fail upon receiving an exit message.

  2. 2.

    This may be either explicit using the BIF exit/2 or implicit through process linking [8].

  3. 3.

    These input operations are encapsulated by OTP library functions that are part of the Erlang VM. To keep the VM standard, we instead instrumented on the call returns of these functions.

  4. 4.

    The implementation can be downloaded from https://bitbucket.org/casian/adapter.

References

  1. Akka website. http://www.akka.io

  2. Agha, G.: Actors: A Model of Concurrent Computation in Distributed Systems. MIT Press, Cambridge (1986)

    Google Scholar 

  3. Agha, G., Mason, I.A., Smith, S.F., Talcott, C.L.: A foundation for actor computation. J. Funct. Program. 7, 1–72 (1997)

    Article  MathSciNet  MATH  Google Scholar 

  4. Andrews, J.H., Zhang, Y.: General test result checking with log file analysis. IEEE Trans. Softw. Eng. 29, 634–648 (2003)

    Article  Google Scholar 

  5. Barringer, H., Falcone, Y., Havelund, K., Reger, G., Rydeheard, D.: Quantified event automata: towards expressive and efficient runtime monitors. In: Giannakopoulou, D., Méry, D. (eds.) FM 2012. LNCS, vol. 7436, pp. 68–84. Springer, Heidelberg (2012)

    Chapter  Google Scholar 

  6. Bielova, N., Massacci, F.: Do you really mean what you actually enforced? Edited automata revisited. Int. J. Inf. Secur. 10(4), 239–254 (2011)

    Article  Google Scholar 

  7. Cassar, I., Francalanza, A.: Runtime adaptation for actor systems. In: Bartocci, E., et al. (eds.) RV 2015. LNCS, vol. 9333, pp. 38–54. Springer, Heidelberg (2015). doi:10.1007/978-3-319-23820-3_3

    Chapter  Google Scholar 

  8. Cesarini, F., Thompson, S.: ERLANG Programming, 1st edn. O’Reilly, Sebastopol (2009)

    MATH  Google Scholar 

  9. Chen, F., Roşu, G.: Towards monitoring-oriented programming: a paradigm combining specification and implementation. ENTCS 89, 106–125 (2003). Elsevier

    Google Scholar 

  10. Chen, F., Roşu, G.: Java-MOP: a monitoring oriented programming environment for Java. In: Halbwachs, N., Zuck, L.D. (eds.) TACAS 2005. LNCS, vol. 3440, pp. 546–550. Springer, Heidelberg (2005)

    Chapter  Google Scholar 

  11. Chen, F., Roşu, G.: MOP: an efficient and generic runtime verification framework. In: OOPSLA, pp. 569–588. ACM Press (2007)

    Google Scholar 

  12. Colombo, C., Dimech, G., Francalanza, A.: Investigating instrumentation techniques for ESB runtime verification. In: Calinescu, R., Rumpe, B. (eds.) SEFM 2015. LNCS, vol. 9276, pp. 99–107. Springer, Heidelberg (2015)

    Chapter  Google Scholar 

  13. Colombo, C., Francalanza, A., Gatt, R.: Elarva: a monitoring tool for Erlang. In: Khurshid, S., Sen, K. (eds.) RV 2011. LNCS, vol. 7186, pp. 370–374. Springer, Heidelberg (2012)

    Chapter  Google Scholar 

  14. Colombo, C., Francalanza, A., Mizzi, R., Pace, G.J.: Polylarva: runtime verification with configurable resource-aware monitoring boundaries. In: Eleftherakis, G., Hinchey, M., Holcombe, M. (eds.) SEFM 2012. LNCS, vol. 7504, pp. 218–232. Springer, Heidelberg (2012)

    Chapter  Google Scholar 

  15. Colombo, C., Pace, G.J.: Fast-forward runtime monitoring — an industrial case study. In: Qadeer, S., Tasiran, S. (eds.) RV 2012. LNCS, vol. 7687, pp. 214–228. Springer, Heidelberg (2013)

    Chapter  Google Scholar 

  16. Coppo, M., Dezani-Ciancaglini, M., Venneri, B.: Self-adaptive monitors for multiparty sessions. In: PDP, pp. 688–696. IEEE Computer Society (2014)

    Google Scholar 

  17. d’Amorim, M., Havelund, K.: Event-based runtime verification of Java programs. SIGSOFT Softw. Eng. Notes 30(4), 1–7 (2005)

    Article  Google Scholar 

  18. D’Angelo, B., Sankaranarayanan, S., Sánchez, C., Robinson, W., Finkbeiner, B., Sipma, H.B., Mehrotra, S., Manna, Z.: LOLA: runtime monitoring of synchronous systems. In: TIME, pp. 166–174. IEEE (2005)

    Google Scholar 

  19. Decker, N., Leucker, M., Thoma, D.: jUnitRV–adding runtime verification to jUnit. In: Brat, G., Rungta, N., Venet, A. (eds.) NFM 2013. LNCS, vol. 7871, pp. 459–464. Springer, Heidelberg (2013)

    Chapter  Google Scholar 

  20. Delgado, N., Gates, A.Q., Roach, S.: A taxonomy and catalog of runtime software-fault monitoring tools. IEEE Trans. Softw. Eng. 30(12), 859–872 (2004)

    Article  Google Scholar 

  21. Drusinsky, D.: Monitoring temporal rules combined with time series. In: Hunt Jr., W.A., Somenzi, F. (eds.) CAV 2003. LNCS, vol. 2725, pp. 114–117. Springer, Heidelberg (2003)

    Chapter  Google Scholar 

  22. Erlingsson, U.: The inlined reference monitor approach to security policy enforcement. Ph.D. thesis, Cornell University (2004)

    Google Scholar 

  23. Francalanza, A.: A theory of monitors (extended abstract). In: FoSSaCS (2016, to appear)

    Google Scholar 

  24. Francalanza, A., Aceto, L., Ingolfsdottir, A.: On verifying Hennessy-Milner logic with recursion at runtime. In: Bartocci, E., et al. (eds.) RV 2015. LNCS, vol. 9333, pp. 71–86. Springer, Heidelberg (2015). doi:10.1007/978-3-319-23820-3_5

    Chapter  Google Scholar 

  25. Francalanza, A., Gauci, A., Pace, G.J.: Distributed system contract monitoring. JLAP 82(5–7), 186–215 (2013)

    MathSciNet  MATH  Google Scholar 

  26. Francalanza, A., Seychell, A.: Synthesising correct concurrent runtime monitors. FMSD 46(3), 226–261 (2015)

    MATH  Google Scholar 

  27. Haller, P., Sommers, F.: Actors in Scala. Artima Inc., Mountain View (2012)

    Google Scholar 

  28. Havelund, K., Roşu, G., Programs, M.J.: Monitoring Java programs with Java PathExplorer. ENTCS 55(2), 200–217 (2001)

    Google Scholar 

  29. Hernandez, A., Yaws 1.89: directory traversal vulnerability. http://www.exploit-db.com/exploits/15371/. Accessed 1 Dec 2015

  30. Kessin, Z.: Building Web Applications with Erlang: Working with REST and Web Sockets on Yaws. O’Reilly Media, Sebastopol (2012)

    Google Scholar 

  31. Kim, M., Viswanathan, M., Kannan, S., Lee, I., Sokolsky, O.: Java-MaC: a run-time assurance approach for Java programs. FMSD 24(2), 129–155 (2004)

    MATH  Google Scholar 

  32. Krasnopolski, A.: AOP for Erlang. http://erlaop.sourceforge.net/

  33. Leucker, M., Schallhart, C.: A brief account of runtime verification. JLAP 78(5), 293–303 (2009)

    MATH  Google Scholar 

  34. Ligatti, J., Bauer, L., Walker, D.: Edit automata: enforcement mechanisms for run-time security policies. IJIS 4(1–2), 2–16 (2005)

    Article  Google Scholar 

  35. Logan, M., Merritt, E., Carlsson, R.: Erlang and OTP in Action. Manning, Greenwich (2011)

    Google Scholar 

  36. Luo, Q., Roşu, G.: EnforceMOP: a runtime property enforcement system for multithreaded programs. In: ISSTA, New York, NY, USA, pp. 156–166. ACM (2013)

    Google Scholar 

  37. Meredith, P.O., Jin, D., Griffith, D., Chen, F., Roşu, G.: An overview of the MOP runtime verification framework. STTT 14(3), 249–289 (2012)

    Article  Google Scholar 

  38. Pellizzoni, R., Meredith, P.O., Caccamo, M., Rosu, G.: Hardware runtime monitoring for dependable COTS-based real-time embedded systems. In: RTSS, pp. 481–491. IEEE (2008)

    Google Scholar 

  39. Roşu, G., Havelund, K.: Rewriting-based techniques for runtime verification. Autom. Softw. Eng. 12(2), 151–197 (2005)

    Article  Google Scholar 

  40. Schneider, F.B.: Enforceable security policies. ACM Trans. Inf. Syst. Secur. 3(1), 30–50 (2000)

    Article  Google Scholar 

  41. Sen, K., Vardhan, A., Agha, G., Roşu, G.: Efficient decentralized monitoring of safety in distributed systems. In: ICSE, pp. 418–427 (2004)

    Google Scholar 

  42. Sha, L., Rajkumar, R., Gagliardi, M.: A software architecture for dependable and renewable industrial computing systems. In: International Conference on Process Control. IEEE (1995)

    Google Scholar 

  43. Vinoski, S.: Yaws: yet another web server. IEEE Internet Comput. 15(4), 90–94 (2011)

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Adrian Francalanza .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2016 Springer International Publishing Switzerland

About this paper

Cite this paper

Cassar, I., Francalanza, A. (2016). On Implementing a Monitor-Oriented Programming Framework for Actor Systems. In: Ábrahám, E., Huisman, M. (eds) Integrated Formal Methods. IFM 2016. Lecture Notes in Computer Science(), vol 9681. Springer, Cham. https://doi.org/10.1007/978-3-319-33693-0_12

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-33693-0_12

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-33692-3

  • Online ISBN: 978-3-319-33693-0

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics