Advertisement

Context-Bounded Analysis for POWER

  • Parosh Aziz Abdulla
  • Mohamed Faouzi Atig
  • Ahmed Bouajjani
  • Tuan Phong Ngo
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 10206)

Abstract

We propose an under-approximate reachability analysis algorithm for programs running under the POWER memory model, in the spirit of the work on context-bounded analysis intitiated by Qadeer et al. in 2005 for detecting bugs in concurrent programs (supposed to be running under the classical SC model). To that end, we first introduce a new notion of context-bounding that is suitable for reasoning about computations under POWER, which generalizes the one defined by Atig et al. in 2011 for the TSO memory model. Then, we provide a polynomial size reduction of the context-bounded state reachability problem under POWER to the same problem under SC: Given an input concurrent program \(\mathcal {P}\), our method produces a concurrent program \(\mathcal {P}'\) such that, for a fixed number of context switches, running \(\mathcal {P}'\) under SC yields the same set of reachable states as running \(\mathcal {P}\) under POWER. The generated program \(\mathcal {P}'\) contains the same number of processes as \(\mathcal {P}\), and operates on the same data domain. By leveraging the standard model checker CBMC, we have implemented a prototype tool and applied it on a set of benchmarks, showing the feasibility of our approach.

Keywords

Inference Rule Time Stamp Read Instruction Concurrent Program Context Switch 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

References

  1. 1.
    SV-COM17 benchmark suit (2017). https://sv-comp.sosy-lab.org/2017/benchmarks.php
  2. 2.
    Abdulla, P.A., Aronis, S., Atig, M.F., Jonsson, B., Leonardsson, C., Sagonas, K.: Stateless model checking for TSO and PSO. In: Baier, C., Tinelli, C. (eds.) TACAS 2015. LNCS, vol. 9035, pp. 353–367. Springer, Heidelberg (2015). doi: 10.1007/978-3-662-46681-0_28 Google Scholar
  3. 3.
    Abdulla, P.A., Atig, M.F., Bouajjani, A., Ngo, T.P.: The benefits of duality in verifying concurrent programs under TSO. In: CONCUR. LIPIcs, vol. 59, pp. 5:1–5:15. Schloss Dagstuhl-Leibniz-Zentrum fuer Informatik (2016)Google Scholar
  4. 4.
    Abdulla, P.A., Atig, M.F., Chen, Y.-F., Leonardsson, C., Rezine, A.: Automatic fence insertion in integer programs via predicate abstraction. In: Miné, A., Schmidt, D. (eds.) SAS 2012. LNCS, vol. 7460, pp. 164–180. Springer, Heidelberg (2012). doi: 10.1007/978-3-642-33125-1_13 CrossRefGoogle Scholar
  5. 5.
    Abdulla, P.A., Atig, M.F., Chen, Y.-F., Leonardsson, C., Rezine, A.: Counter-example guided fence insertion under TSO. In: Flanagan, C., König, B. (eds.) TACAS 2012. LNCS, vol. 7214, pp. 204–219. Springer, Heidelberg (2012). doi: 10.1007/978-3-642-28756-5_15 CrossRefGoogle Scholar
  6. 6.
    Abdulla, P.A., Atig, M.F., Jonsson, B., Leonardsson, C.: Stateless model checking for POWER. In: Chaudhuri, S., Farzan, A. (eds.) CAV 2016. LNCS, vol. 9780, pp. 134–156. Springer, Cham (2016). doi: 10.1007/978-3-319-41540-6_8 Google Scholar
  7. 7.
    Abdulla, P.A., Atig, M.F., Lång, M., Ngo, T.P.: Precise and sound automatic fence insertion procedure under PSO. In: Bouajjani, A., Fauconnier, H. (eds.) NETYS 2015. LNCS, vol. 9466, pp. 32–47. Springer, Cham (2015). doi: 10.1007/978-3-319-26850-7_3 CrossRefGoogle Scholar
  8. 8.
    Abdulla, P.A., Atig, M.F., Ngo, T.-P.: The best of both worlds: trading efficiency and optimality in fence insertion for TSO. In: Vitek, J. (ed.) ESOP 2015. LNCS, vol. 9032, pp. 308–332. Springer, Heidelberg (2015). doi: 10.1007/978-3-662-46669-8_13 CrossRefGoogle Scholar
  9. 9.
    Alglave, J., Kroening, D., Nimal, V., Tautschnig, M.: Software verification for weak memory via program transformation. In: Felleisen, M., Gardner, P. (eds.) ESOP 2013. LNCS, vol. 7792, pp. 512–532. Springer, Heidelberg (2013). doi: 10.1007/978-3-642-37036-6_28 CrossRefGoogle Scholar
  10. 10.
    Alglave, J., Kroening, D., Tautschnig, M.: Partial orders for efficient bounded model checking of concurrent software. In: Sharygina, N., Veith, H. (eds.) CAV 2013. LNCS, vol. 8044, pp. 141–157. Springer, Heidelberg (2013). doi: 10.1007/978-3-642-39799-8_9 CrossRefGoogle Scholar
  11. 11.
    Alglave, J., Maranget, L., Tautschnig, M.: Herding cats: modelling, simulation, testing, and data mining for weak memory. ACM TOPLAS 36(2), 7:1–7:74 (2014)CrossRefGoogle Scholar
  12. 12.
    Atig, M.F., Bouajjani, A., Parlato, G.: Getting rid of store-buffers in TSO analysis. In: Gopalakrishnan, G., Qadeer, S. (eds.) CAV 2011. LNCS, vol. 6806, pp. 99–115. Springer, Heidelberg (2011). doi: 10.1007/978-3-642-22110-1_9 CrossRefGoogle Scholar
  13. 13.
    Bouajjani, A., Derevenetc, E., Meyer, R.: Checking and enforcing robustness against TSO. In: Felleisen, M., Gardner, P. (eds.) ESOP 2013. LNCS, vol. 7792, pp. 533–553. Springer, Heidelberg (2013). doi: 10.1007/978-3-642-37036-6_29 CrossRefGoogle Scholar
  14. 14.
    Burckhardt, S., Alur, R., Martin, M.M.K.: CheckFence: checking consistency of concurrent data types on relaxed memory models. In: PLDI, pp. 12–21. ACM (2007)Google Scholar
  15. 15.
    Burckhardt, S., Musuvathi, M.: Effective program verification for relaxed memory models. In: Gupta, A., Malik, S. (eds.) CAV 2008. LNCS, vol. 5123, pp. 107–120. Springer, Heidelberg (2008). doi: 10.1007/978-3-540-70545-1_12 CrossRefGoogle Scholar
  16. 16.
    Burnim, J., Sen, K., Stergiou, C.: Testing concurrent programs on relaxed memory models. In: ISSTA, pp. 122–132. ACM (2011)Google Scholar
  17. 17.
    Clarke, E., Kroening, D., Lerda, F.: A tool for checking ANSI-C programs. In: Jensen, K., Podelski, A. (eds.) TACAS 2004. LNCS, vol. 2988, pp. 168–176. Springer, Heidelberg (2004). doi: 10.1007/978-3-540-24730-2_15 CrossRefGoogle Scholar
  18. 18.
    Dan, A.M., Meshman, Y., Vechev, M., Yahav, E.: Predicate abstraction for relaxed memory models. In: Logozzo, F., Fähndrich, M. (eds.) SAS 2013. LNCS, vol. 7935, pp. 84–104. Springer, Heidelberg (2013). doi: 10.1007/978-3-642-38856-9_7 CrossRefGoogle Scholar
  19. 19.
    Dan, A., Meshman, Y., Vechev, M., Yahav, E.: Effective abstractions for verification under relaxed memory models. Comput. Lang. Syst. Struct. 47(Part 1), 62–76 (2017)zbMATHGoogle Scholar
  20. 20.
    Demsky, B., Lam, P.: Satcheck: sat-directed stateless model checking for SC and TSO. In: OOPSLA 2015, pp. 20–36. ACM (2015)Google Scholar
  21. 21.
    Derevenetc, E., Meyer, R.: Robustness against power is PSpace-complete. In: Esparza, J., Fraigniaud, P., Husfeldt, T., Koutsoupias, E. (eds.) ICALP 2014. LNCS, vol. 8573, pp. 158–170. Springer, Heidelberg (2014). doi: 10.1007/978-3-662-43951-7_14 Google Scholar
  22. 22.
    Huang, S., Huang, J.: Maximal causality reduction for TSO and PSO. In: OOPSLA 2016, pp. 447–461 (2016)Google Scholar
  23. 23.
    Kuperstein, M., Vechev, M.T., Yahav, E.: Automatic inference of memory fences. In: FMCAD, pp. 111–119. IEEE (2010)Google Scholar
  24. 24.
    Kuperstein, M., Vechev, M.T., Yahav, E.: Partial-coherence abstractions for relaxed memory models. In: PLDI, pp. 187–198. ACM (2011)Google Scholar
  25. 25.
    Torre, S., Madhusudan, P., Parlato, G.: Reducing context-bounded concurrent reachability to sequential reachability. In: Bouajjani, A., Maler, O. (eds.) CAV 2009. LNCS, vol. 5643, pp. 477–492. Springer, Heidelberg (2009). doi: 10.1007/978-3-642-02658-4_36 CrossRefGoogle Scholar
  26. 26.
    Lahav, O., Vafeiadis, V.: Explaining relaxed memory models with program transformations. In: Fitzgerald, J., Heitmeyer, C., Gnesi, S., Philippou, A. (eds.) FM 2016. LNCS, vol. 9995, pp. 479–495. Springer, Cham (2016). doi: 10.1007/978-3-319-48989-6_29 CrossRefGoogle Scholar
  27. 27.
    Lal, A., Reps, T.W.: Reducing concurrent analysis under a context bound to sequential analysis. FMSD 35(1), 73–97 (2009)zbMATHGoogle Scholar
  28. 28.
    Lamport, L.: How to make a multiprocessor computer that correctly executes multiprocess programs. IEEE Trans. Comput. C–28(9), 690–691 (1979)CrossRefzbMATHGoogle Scholar
  29. 29.
    Liu, F., Nedev, N., Prisadnikov, N., Vechev, M.T., Yahav, E.: Dynamic synthesis for relaxed memory models. In: PLDI 2012, pp. 429–440. ACM (2012)Google Scholar
  30. 30.
    Mador-Haim, S., Maranget, L., Sarkar, S., Memarian, K., Alglave, J., Owens, S., Alur, R., Martin, M.M.K., Sewell, P., Williams, D.: An axiomatic memory model for POWER multiprocessors. In: Madhusudan, P., Seshia, S.A. (eds.) CAV 2012. LNCS, vol. 7358, pp. 495–512. Springer, Heidelberg (2012). doi: 10.1007/978-3-642-31424-7_36 CrossRefGoogle Scholar
  31. 31.
    Musuvathi, M., Qadeer, S.: Iterative context bounding for systematic testing of multithreaded programs. In: PLDI, pp. 446–455. ACM (2007)Google Scholar
  32. 32.
    Owens, S., Sarkar, S., Sewell, P.: A better x86 memory model: x86-TSO. In: Berghofer, S., Nipkow, T., Urban, C., Wenzel, M. (eds.) TPHOLs 2009. LNCS, vol. 5674, pp. 391–407. Springer, Heidelberg (2009). doi: 10.1007/978-3-642-03359-9_27 CrossRefGoogle Scholar
  33. 33.
    Qadeer, S., Rehof, J.: Context-bounded model checking of concurrent software. In: Halbwachs, N., Zuck, L.D. (eds.) TACAS 2005. LNCS, vol. 3440, pp. 93–107. Springer, Heidelberg (2005). doi: 10.1007/978-3-540-31980-1_7 CrossRefGoogle Scholar
  34. 34.
    Sarkar, S., Sewell, P., Alglave, J., Maranget, L., Williams, D.: Understanding POWER multiprocessors. In: PLDI, pp. 175–186. ACM (2011)Google Scholar
  35. 35.
    Sewell, P., Sarkar, S., Owens, S., Nardelli, F.Z., Myreen, M.O.: x86-TSO: a rigorous and usable programmer’s model for x86 multiprocessors. CACM 53, 89–97 (2010)CrossRefGoogle Scholar
  36. 36.
    Tomasco, E., Lam, T.N., Fischer, B., La Torre, S., Parlato, G.: Embedding weak memory models within eager sequentialization (2016). http://eprints.soton.ac.uk/402285/
  37. 37.
    Tomasco, E., Lam, T.N., Inverso, O., Fischer, B., La Torre, S., Parlato, G.: Lazy sequentialization for TSO and PSO via shared memory abstractions. In: FMCAD 2016, pp. 193–200 (2016)Google Scholar
  38. 38.
    Travkin, O., Wehrheim, H.: Verification of concurrent programs on weak memory models. In: Sampaio, A., Wang, F. (eds.) ICTAC 2016. LNCS, vol. 9965, pp. 3–24. Springer, Cham (2016). doi: 10.1007/978-3-319-46750-4_1 CrossRefGoogle Scholar
  39. 39.
    Yang, Y., Gopalakrishnan, G., Lindstrom, G., Slind, K.: Nemos: a framework for axiomatic and executable specifications of memory consistency models. In: IPDPS. IEEE (2004)Google Scholar
  40. 40.
    Zhang, N., Kusano, M., Wang, C.: Dynamic partial order reduction for relaxed memory models. In: PLDI, pp. 250–259. ACM (2015)Google Scholar

Copyright information

© Springer-Verlag GmbH Germany 2017

Authors and Affiliations

  • Parosh Aziz Abdulla
    • 1
  • Mohamed Faouzi Atig
    • 1
  • Ahmed Bouajjani
    • 2
  • Tuan Phong Ngo
    • 1
  1. 1.Uppsala UniversityUppsalaSweden
  2. 2.IRIFUniversité Paris DiderotParisFrance

Personalised recommendations