Skip to main content

2017 | OriginalPaper | Buchkapitel

Verifying Robustness of Event-Driven Asynchronous Programs Against Concurrency

verfasst von : Ahmed Bouajjani, Michael Emmi, Constantin Enea, Burcu Kulahcioglu Ozkan, Serdar Tasiran

Erschienen in: Programming Languages and Systems

Verlag: Springer Berlin Heidelberg

Aktivieren Sie unsere intelligente Suche, um passende Fachinhalte oder Patente zu finden.

search-config
loading …

Abstract

We define a correctness criterion, called robustness against concurrency, for a class of event-driven asynchronous programs that are at the basis of modern UI frameworks in Android, iOS, and Javascript. A program is robust when all possible behaviors admitted by the program under arbitrary procedure and event interleavings are admitted even if asynchronous procedures (respectively, events) are assumed to execute serially, one after the other, accessing shared memory in isolation. We characterize robustness as a conjunction of two correctness criteria: event-serializability (i.e., events can be seen as atomic) and event-determinism (executions within each event are insensitive to the interleavings between concurrent tasks dynamically spawned by the event). Then, we provide efficient algorithms for checking these two criteria based on polynomial reductions to reachability problems in sequential programs. This result is surprising because it allows to avoid explicit handling of all concurrent executions in the analysis, which leads to an important gain in complexity. We demonstrate via case studies on Android apps that the typical mistakes programmers make are captured as robustness violations, and that violations can be detected efficiently using our approach.

Sie haben noch keine Lizenz? Dann Informieren Sie sich jetzt über unsere Produkte:

Springer Professional "Wirtschaft+Technik"

Online-Abonnement

Mit Springer Professional "Wirtschaft+Technik" erhalten Sie Zugriff auf:

  • über 102.000 Bücher
  • über 537 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Maschinenbau + Werkstoffe
  • Versicherung + Risiko

Jetzt Wissensvorsprung sichern!

Springer Professional "Technik"

Online-Abonnement

Mit Springer Professional "Technik" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 390 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Maschinenbau + Werkstoffe




 

Jetzt Wissensvorsprung sichern!

Springer Professional "Wirtschaft"

Online-Abonnement

Mit Springer Professional "Wirtschaft" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 340 Zeitschriften

aus folgenden Fachgebieten:

  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Versicherung + Risiko




Jetzt Wissensvorsprung sichern!

Fußnoten
1
For simplicity, we have ignored the set of events which are executed when comparing global state reached by aribitrary and event-serial executions, resp. Reaching a global state using the same set of events is easy to formalize but tedious.
 
2
We refer to the standard notion of (stuttering) simulation where (sequences of) transitions in \({\mathsf {detStr}^{-}({e})}\) are mapped to transitions of e.
 
3
Modulo the omission of the labels \(\mathrm {invoke}(i)\), \(\mathrm {begin}(i)\), \(\mathrm {return}(i)\) related to asynchronous invocations.
 
Literatur
6.
Zurück zum Zitat Alur, R., McMillan, K.L., Peled, D.: Model-checking of correctness conditions for concurrent objects. Inf. Comput. 160(1–2), 167–188 (2000)MathSciNetCrossRef Alur, R., McMillan, K.L., Peled, D.: Model-checking of correctness conditions for concurrent objects. Inf. Comput. 160(1–2), 167–188 (2000)MathSciNetCrossRef
7.
Zurück zum Zitat Arzt, S., Rasthofer, S., Bodden, E.: Instrumenting android and Java applications as easy as abc. In: Legay, A., Bensalem, S. (eds.) RV 2013. LNCS, vol. 8174, pp. 364–381. Springer, Heidelberg (2013). doi:10.1007/978-3-642-40787-1_26CrossRef Arzt, S., Rasthofer, S., Bodden, E.: Instrumenting android and Java applications as easy as abc. In: Legay, A., Bensalem, S. (eds.) RV 2013. LNCS, vol. 8174, pp. 364–381. Springer, Heidelberg (2013). doi:10.​1007/​978-3-642-40787-1_​26CrossRef
8.
Zurück zum Zitat Bielik, P., Raychev, V., Vechev. M.: Scalable race detection for android applications. In: Proceedings of ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications, OOPSLA 2015, NY, USA, pp. 332–348. ACM (2015) Bielik, P., Raychev, V., Vechev. M.: Scalable race detection for android applications. In: Proceedings of ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications, OOPSLA 2015, NY, USA, pp. 332–348. ACM (2015)
9.
Zurück zum Zitat Bocchino, Jr. R.L., Adve, V.S., Adve, S.V., Snir, M.: Parallel programming must be deterministic by default. In: Proceedings of 1st USENIX Conference on Hot Topics in Parallelism, HotPar 2009, CA, USA (2009) Bocchino, Jr. R.L., Adve, V.S., Adve, S.V., Snir, M.: Parallel programming must be deterministic by default. In: Proceedings of 1st USENIX Conference on Hot Topics in Parallelism, HotPar 2009, CA, USA (2009)
10.
Zurück zum Zitat Bouajjani, A., Emmi, M., Enea, C., Hamza, J.: Verifying concurrent programs against sequential specifications. In: Felleisen, M., Gardner, P. (eds.) ESOP 2013. LNCS, vol. 7792, pp. 290–309. Springer, Heidelberg (2013). doi:10.1007/978-3-642-37036-6_17CrossRef Bouajjani, A., Emmi, M., Enea, C., Hamza, J.: Verifying concurrent programs against sequential specifications. In: Felleisen, M., Gardner, P. (eds.) ESOP 2013. LNCS, vol. 7792, pp. 290–309. Springer, Heidelberg (2013). doi:10.​1007/​978-3-642-37036-6_​17CrossRef
11.
Zurück zum Zitat Burnim, J., Sen, K.: Asserting and checking determinism for multithreaded programs. Commun. ACM 53(6), 97–105 (2010)CrossRef Burnim, J., Sen, K.: Asserting and checking determinism for multithreaded programs. Commun. ACM 53(6), 97–105 (2010)CrossRef
12.
Zurück zum Zitat Emmi, M., Qadeer, S., Rakamarić, Z.: Delay-bounded scheduling. SIGPLAN Not. 46(1), 411–422 (2011). ISSN 0362-1340CrossRef Emmi, M., Qadeer, S., Rakamarić, Z.: Delay-bounded scheduling. SIGPLAN Not. 46(1), 411–422 (2011). ISSN 0362-1340CrossRef
13.
Zurück zum Zitat Emmi, M., Lal, A., Qadeer, S.: Asynchronous programs with prioritized task-buffers. In: Proceedings of International Symposium on Foundations of Software Engineering, FSE 2012, pp. 48:1–48:11. ACM (2012) Emmi, M., Lal, A., Qadeer, S.: Asynchronous programs with prioritized task-buffers. In: Proceedings of International Symposium on Foundations of Software Engineering, FSE 2012, pp. 48:1–48:11. ACM (2012)
14.
Zurück zum Zitat Emmi, M., Ozkan, B.K., Tasiran, S.: Exploiting synchronization in the analysis of shared-memory asynchronous programs. In: Proceedings of International SPIN Symposium on Model Checking of Software, pp. 20–29. ACM (2014) Emmi, M., Ozkan, B.K., Tasiran, S.: Exploiting synchronization in the analysis of shared-memory asynchronous programs. In: Proceedings of International SPIN Symposium on Model Checking of Software, pp. 20–29. ACM (2014)
17.
Zurück zum Zitat Flanagan, C., Freund, S.N.: Atomizer: a dynamic atomicity checker for multithreaded programs. Sci. Comput. Program. 71(2), 89–109 (2008)MathSciNetCrossRef Flanagan, C., Freund, S.N.: Atomizer: a dynamic atomicity checker for multithreaded programs. Sci. Comput. Program. 71(2), 89–109 (2008)MathSciNetCrossRef
18.
Zurück zum Zitat Flanagan, C., Freund, S.N., Lifshin, M., Qadeer, S.: Types for atomicity: static checking and inference for Java. ACM Trans. Program. Lang. Syst. 30(4), 20 (2008)CrossRef Flanagan, C., Freund, S.N., Lifshin, M., Qadeer, S.: Types for atomicity: static checking and inference for Java. ACM Trans. Program. Lang. Syst. 30(4), 20 (2008)CrossRef
19.
Zurück zum Zitat Flanagan, C., Freund, S.N., Yi, J.: Velodrome: a sound and complete dynamic atomicity checker for multithreaded programs. In: Proceedings of ACM SIGPLAN Conference on Programming Language Design and Implementation, pp. 293–303 (2008) Flanagan, C., Freund, S.N., Yi, J.: Velodrome: a sound and complete dynamic atomicity checker for multithreaded programs. In: Proceedings of ACM SIGPLAN Conference on Programming Language Design and Implementation, pp. 293–303 (2008)
20.
Zurück zum Zitat Hatcliff, J., Robby, Dwyer, M.B.: Verifying atomicity specifications for concurrent object-oriented software using model-checking. In: Steffen, B., Levi, G. (eds.) VMCAI 2004. LNCS, vol. 2937, pp. 175–190. Springer, Heidelberg (2004). doi:10.1007/978-3-540-24622-0_16 Hatcliff, J., Robby, Dwyer, M.B.: Verifying atomicity specifications for concurrent object-oriented software using model-checking. In: Steffen, B., Levi, G. (eds.) VMCAI 2004. LNCS, vol. 2937, pp. 175–190. Springer, Heidelberg (2004). doi:10.​1007/​978-3-540-24622-0_​16
21.
Zurück zum Zitat Hsiao, C.-H., Yu, J., Narayanasamy, S., Kong, Z., Pereira, C.L., Pokam, G.A., Chen, P.M., Flinn, J.: Race detection for event-driven mobile applications. In: Proceedings of 35th ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2014, pp. 326–336. ACM (2014) Hsiao, C.-H., Yu, J., Narayanasamy, S., Kong, Z., Pereira, C.L., Pokam, G.A., Chen, P.M., Flinn, J.: Race detection for event-driven mobile applications. In: Proceedings of 35th ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2014, pp. 326–336. ACM (2014)
22.
Zurück zum Zitat Bocchino Jr. R.L., Adve, V.S., Dig, D., Adve, S.V., Heumann, S., Komuravelli, R., Overbey, J., Simmons, P., Sung, H. and Vakilian, M.: A type and effect system for deterministic parallel Java. In: Proceedings of OOPSLA, pp. 97–116 (2009) Bocchino Jr. R.L., Adve, V.S., Dig, D., Adve, S.V., Heumann, S., Komuravelli, R., Overbey, J., Simmons, P., Sung, H. and Vakilian, M.: A type and effect system for deterministic parallel Java. In: Proceedings of OOPSLA, pp. 97–116 (2009)
23.
Zurück zum Zitat Lin, Y., Ra, C., Dig, D.: Retrofitting concurrency for android applications through refactoring. In: Proceedings of International Symposium on Foundations of Software Engineering, FSE 2014, NY, USA, pp. 341–352. ACM (2014) Lin, Y., Ra, C., Dig, D.: Retrofitting concurrency for android applications through refactoring. In: Proceedings of International Symposium on Foundations of Software Engineering, FSE 2014, NY, USA, pp. 341–352. ACM (2014)
24.
Zurück zum Zitat Lin, Y., Okur, S., Dig, D.: Study and refactoring of android asynchronous programming. In: Proceedings of ASE (2015) Lin, Y., Okur, S., Dig, D.: Study and refactoring of android asynchronous programming. In: Proceedings of ASE (2015)
25.
Zurück zum Zitat Maiya, P., Kanade, A., Majumdar, R.: Race detection for android applications. In: Proceedings of 35th ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2014, pp. 316–325. ACM (2014) Maiya, P., Kanade, A., Majumdar, R.: Race detection for android applications. In: Proceedings of 35th ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2014, pp. 316–325. ACM (2014)
26.
Zurück zum Zitat Ozkan, B.K., Emmi, M., Tasiran, S.: Systematic asynchrony bug exploration for android apps. In: Computer Aided Verification - 27th International Conference, CAV 2015, San Francisco, CA, USA, pp. 455–461 (2015) Ozkan, B.K., Emmi, M., Tasiran, S.: Systematic asynchrony bug exploration for android apps. In: Computer Aided Verification - 27th International Conference, CAV 2015, San Francisco, CA, USA, pp. 455–461 (2015)
27.
28.
Zurück zum Zitat Sadowski, C., Freund, S.N., Flanagan, C.: SingleTrack: a dynamic determinism checker for multithreaded programs. In: Castagna, G. (ed.) ESOP 2009. LNCS, vol. 5502, pp. 394–409. Springer, Heidelberg (2009). doi:10.1007/978-3-642-00590-9_28CrossRef Sadowski, C., Freund, S.N., Flanagan, C.: SingleTrack: a dynamic determinism checker for multithreaded programs. In: Castagna, G. (ed.) ESOP 2009. LNCS, vol. 5502, pp. 394–409. Springer, Heidelberg (2009). doi:10.​1007/​978-3-642-00590-9_​28CrossRef
29.
Zurück zum Zitat Safi, G., Shahbazian, A., Halfond, W.G.J., Medvidovic, N.: Detecting event anomalies in event-based systems. In: Proceedings of International Symposium on Foundations of Software Engineering FSE, pp. 25–37. ACM (2015) Safi, G., Shahbazian, A., Halfond, W.G.J., Medvidovic, N.: Detecting event anomalies in event-based systems. In: Proceedings of International Symposium on Foundations of Software Engineering FSE, pp. 25–37. ACM (2015)
30.
Zurück zum Zitat Sinha, A., Malik, S., Wang, C., Gupta, A.: Predicting serializability violations: SMT-based search vs. DPOR-based search. In: Hardware and Software: Verification and Testing - 7th International Haifa Verification Conference, HVC 2011, Haifa, Israel, Revised Selected Papers, pp. 95–114 (2011) Sinha, A., Malik, S., Wang, C., Gupta, A.: Predicting serializability violations: SMT-based search vs. DPOR-based search. In: Hardware and Software: Verification and Testing - 7th International Haifa Verification Conference, HVC 2011, Haifa, Israel, Revised Selected Papers, pp. 95–114 (2011)
31.
Zurück zum Zitat Steele, Jr. G.L.: Making asynchronous parallelism safe for the world. In: Proceedings of 17th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 1990, NY, USA, pp. 218–231. ACM (1990) Steele, Jr. G.L.: Making asynchronous parallelism safe for the world. In: Proceedings of 17th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 1990, NY, USA, pp. 218–231. ACM (1990)
32.
Zurück zum Zitat von Praun, C., Gross, T.R.: Static detection of atomicity violations in object-oriented programs. J. Object Technol. 3(6), 103–122 (2004)CrossRef von Praun, C., Gross, T.R.: Static detection of atomicity violations in object-oriented programs. J. Object Technol. 3(6), 103–122 (2004)CrossRef
33.
Zurück zum Zitat Wang, L., Stoller, S.D.: Runtime analysis of atomicity for multithreaded programs. IEEE Trans. Softw. Eng. 32(2), 93–110 (2006)CrossRef Wang, L., Stoller, S.D.: Runtime analysis of atomicity for multithreaded programs. IEEE Trans. Softw. Eng. 32(2), 93–110 (2006)CrossRef
34.
Zurück zum Zitat Yi, J., Disney, T., Freund, S.N., Flanagan, C.: Cooperative types for controlling thread interference in Java. In: International Symposium on Software Testing and Analysis, ISSTA, pp. 232–242 (2012) Yi, J., Disney, T., Freund, S.N., Flanagan, C.: Cooperative types for controlling thread interference in Java. In: International Symposium on Software Testing and Analysis, ISSTA, pp. 232–242 (2012)
Metadaten
Titel
Verifying Robustness of Event-Driven Asynchronous Programs Against Concurrency
verfasst von
Ahmed Bouajjani
Michael Emmi
Constantin Enea
Burcu Kulahcioglu Ozkan
Serdar Tasiran
Copyright-Jahr
2017
Verlag
Springer Berlin Heidelberg
DOI
https://doi.org/10.1007/978-3-662-54434-1_7