skip to main content
10.1145/1985793.1985796acmconferencesArticle/Chapter ViewAbstractPublication PagesicseConference Proceedingsconference-collections
research-article

aComment: mining annotations from comments and code to detect interrupt related concurrency bugs

Published:21 May 2011Publication History

ABSTRACT

Concurrency bugs in an operating system (OS) are detrimental as they can cause the OS to fail and affect all applications running on top of the OS. Detecting OS concurrency bugs is challenging due to the complexity of the OS synchronization, particularly with the presence of the OS specific interrupt context. Existing dynamic concurrency bug detection techniques are designed for user level applications and cannot be applied to operating systems.

To detect OS concurrency bugs, we proposed a new type of annotations - interrupt related annotations - and generated 96,821 such annotations for the Linux kernel with little manual effort. These annotations have been used to automatically detect 9 real OS concurrency bugs (7 of which were previously unknown). Two of the key techniques that make the above contributions possible are: (1) using a hybrid approach to extract annotations from both code and comments written in natural language to achieve better coverage and accuracy in annotation extraction and bug detection; and (2) automatically propagating annotations to caller functions to improve annotating and bug detection. These two techniques are general and can be applied to non-OS code, code written in other programming languages such as Java, and for extracting other types of specifications.

References

  1. Ghostdoc. http://submain.com/products/ghostdoc.aspx.Google ScholarGoogle Scholar
  2. Runtime locking correctness validator. http://www.mjmwired.net/kernel/Documentation/lockdep-design.txt.Google ScholarGoogle Scholar
  3. Z. Anderson, D. Gay, R. Ennals, and E. Brewer. SharC: Checking data sharing strategies for multithreaded C. In PLDI, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. T. Ball, B. Hackett, S. Lahiri, and S. Qadeer. Annotation-based property checking for systems software. Research report MSR-TR-2008-82, Microsoft Research, May 2008.Google ScholarGoogle Scholar
  5. M. D. Bond, K. E. Coons, and K. S. McKinley. PACER: Proportional detection of data races. In PLDI, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. L. C. Briand, Y. Labiche, and X. Liu. Using machine learning to support debugging with Tarantula. In ISSRE, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. J. Burnim and K. Sen. DETERMIN: Inferring likely deterministic specifications of multithreaded programs. In ICSE, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. J.-D. Choi, K. Lee, A. Loginov, R. O'Callahan, V. Sarkar, and M. Sridharan. Efficient and precise datarace detection for multithreaded object-oriented programs. In PLDI, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. J. Condit, M. Harren, Z. R. Anderson, D. Gay, and G. C. Necula. Dependent types for low-level programming. In ESOP, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. J. Corbet, A. Rubini, and G. Kroah-Hartman. Linux Device Drivers, Third Edition. Reilly, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. E. W. Dijkstra. The structure of the "THE"-multiprogramming system. In SOSP, 1967. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. D. R. Engler and K. Ashcraft. RacerX: Effective, static detection of race conditions and deadlocks. In SOSP, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. D. R. Engler, D. Y. Chen, S. Hallem, A. Chou, and B. Chelf. Bugs as deviant behavior: A general approach to inferring errors in systems code. In SOSP, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. M. D. Ernst, A. Czeisler, W. G. Griswold, and D. Notkin. Quickly detecting relevant program invariants. In ICSE, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. D. Evans. Static detection of dynamic memory errors. In PLDI, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. D. Evans and D. Larochelle. Improving security using extensible lightweight static analysis. IEEE Software, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. C. Flanagan and S. N. Freund. Atomizer: A dynamic atomicity checker for multithreaded programs. In POPL, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Z. P. Fry, D. Shepherd, E. Hill, L. Pollock, and K. Vijay-Shanker. Analysing source code: Looking for useful verb-direct object pairs in all the right places. IET Software Special Issue on Natural Language in Software Development, 2008.Google ScholarGoogle ScholarCross RefCross Ref
  19. O. Glickman and I. Dagan. Acquiring lexical paraphrases from a single corpus. In RANLP, 2003.Google ScholarGoogle Scholar
  20. C. Hammer, J. Dolby, M. Vaziri, and F. Tip. Dynamic detection of atomic-set-serializability violations. In ICSE, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. T. Harris and K. Fraser. Language support for lightweight transactions. SIGPLAN Not., 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. J. Hatcliff, Robby, and M. B. Dwyer. Verifying atomicity specifications for concurrent object-oriented software using model-checking. In VMCAI, 2004.Google ScholarGoogle ScholarCross RefCross Ref
  23. M. Herlihy and J. E. B. Moss. Transactional memory: Architectural support for lock-free data structures. SIGARCH Comput. Archit. News, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. P. Inverardi and S. Uchitel. Proving deadlock freedom in component-based programming. In FASE, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. H. Jula, D. Tralamazza, C. Zamfir, and G. Candea. Deadlock immunity: Enabling systems to defend against deadlocks. In OSDI, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. D. E. Knuth. Literate programming. Computer Journal, 27(2), 1984. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. D. Kramer. API documentation from source code comments: A case study of javadoc. In SIGDOC, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. V. Kuznetsov, V. Chipounov, and G. Candea. Testing closed-source binary device drivers with DDT. In USENIX ATC, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Z. Lai, S.-C. Cheung, and W. K. Chan. Detecting atomic-set serializability violations in multithreaded programs through active randomized testing. In ICSE, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. N. Leveson. The Therac-25 accidents.Google ScholarGoogle Scholar
  31. Z. Li and Y. Zhou. PR-Miner: Automatically extracting implicit programming rules and detecting violations in large software code. In FSE, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. D. Lin and P. Pantel. Discovery of inference rules for question-answering. Natural Language Engineering, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. B. Livshits and T. Zimmermann. DynaMine: Finding common error patterns by mining software revision histories. In FSE, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. D. Lorenzoli, L. Mariani, and M. Pezzè. Automatic generation of software behavioral models. In ICSE, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. S. Lu, S. Park, C. Hu, X. Ma, W. Jiang, Z. Li, R. A. Popa, and Y. Zhou. MUVI: Automatically inferring multi-variable access correlations and detecting related semantic and concurrency bugs. In SOSP, October 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. S. Lu, J. Tucek, F. Qin, and Y. Zhou. AVIO: Detecting atomicity violations via access interleaving invariants. In ASPLOS, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. H. Malik, I. Chowdhury, H.-M. Tsou, Z. M. Jiang, and A. E. Hassan. Understanding the rationale for updating a function's comment. In ICSM, 2008.Google ScholarGoogle Scholar
  38. Microsoft. MSDN run-time library reference - SAL annotations. http://msdn2.microsoft.com/en-us/library/ms235402.aspx.Google ScholarGoogle Scholar
  39. S. Microsystems. Lock_Lint - Static data race and deadlock detection tool for C. http://developers.sun.com/sunstudio/articles/locklint.html.Google ScholarGoogle Scholar
  40. B. Murphy. Automating software failure reporting. Queue, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. M. Musuvathi and S. Qadeer. Iterative context bounding for systematic testing of multithreaded programs. In PLDI, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. M. Naik, C.-S. Park, K. Sen, and D. Gay. Effective static deadlock detection. In ICSE, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. S. Narayanasamy, Z. Wang, J. Tigani, A. Edwards, and B. Calder. Automatically classifying benign and harmful data races all using replay analysis. In PLDI, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. R. H. B. Netzer and B. P. Miller. Improving the accuracy of data race detection. In PPoPP, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  45. R. O'Callahan and J.-D. Choi. Hybrid dynamic data race detection. In PPoPP, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  46. Y. Padioleau, L. Tan, and Y. Zhou. Listening to programmers - Taxonomies and characteristics of comments in operating system code. In ICSE, May 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  47. D. Perkovic and P. J. Keleher. Online data-race detection via coherency guarantees. In OSDI, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  48. D. Posnett, C. Bird, and P. T. Devanbu. THEX: Mining metapatterns from java. In MSR, 2010.Google ScholarGoogle ScholarCross RefCross Ref
  49. Z. Rakamaric. STORM: Static unit checking of concurrent programs. In ICSE Student Research Competition, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  50. D. S. Rosenblum. Design and verification of distributed tasking supervisors for concurrent programming languages. 1988.Google ScholarGoogle Scholar
  51. N. Rungta, E. Mercer, and W. Visser. Efficient testing of concurrent programs with abstraction-guided symbolic execution. In SPIN, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  52. L. Ryzhyk, P. Chubb, I. Kuz, and G. Heiser. Dingo: Taming device drivers. In EuroSys, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  53. A. Sasturkar, R. Agarwal, L. Wang, and S. D. Stoller. Automated type-based analysis of data races and atomicity. In PPoPP, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  54. S. Savage, M. Burrows, G. Nelson, P. Sobalvarro, and T. Anderson. Eraser: A dynamic data race detector for multithreaded programs. ACM Transactions on Computer Systems, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  55. SecurityFocus. Software bug contributed to blackout.Google ScholarGoogle Scholar
  56. E. Sherman, M. B. Dwyer, and S. Elbaum. Saturation-based testing of concurrent programs. In FSE, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  57. N. Sterling. WARLOCK - A static data race analysis tool. In USENIX Winter Technical Conference, 1993.Google ScholarGoogle Scholar
  58. M.-A. Storey, J. Ryall, R. I. Bull, D. Myers, and J. Singer. To do or to bug: Exploring how task annotations play a role in the work practices of software developers. In ICSE '08, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  59. L. Tan, C. Liu, Z. Li, X. Wang, S. Lu, Y. Zhou, and C. Zhai. Bug characteristics in modern open source software. In University of Waterloo Technical Report, 2011.Google ScholarGoogle Scholar
  60. L. Tan, D. Yuan, G. Krishna, and Y. Zhou. /* iComment: Bugs or bad comments? */. In Proceedings of the 21st ACM Symposium on Operating Systems Principles (SOSP), 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  61. S. Thummalapenta and T. Xie. Mining exception-handling rules as sequence association rules. In ICSE, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  62. L. Torvalds. Sparse - A semantic parser for C. http://www.kernel.org/pub/software/devel/sparse/.Google ScholarGoogle Scholar
  63. Y. Wang, T. Kelly, M. Kudlur, S. Lafortune, and S. Mahlke. Gadara: Dynamic deadlock avoidance for mult-threaded programs. In OSDI, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  64. A. Wasylkowski, A. Zeller, and C. Lindig. Detecting object usage anomalies. In FSE, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  65. M. Xu, R. Bodk, and M. D. Hill. A serializability violation detector for shared-memory server programs. In PLDI, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  66. J. Yang, T. Kremenek, Y. Xie, and D. Engler. MECA: An extensible, expressive system and language for statically checking security properties. In CCS, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  67. Y. Yu, T. Rodeheffer, and W. Chen. RaceTrack: Efficient detection of data race conditions via adaptive tracking. In SOSP, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  68. W. Zhang, C. Sun, and S. Lu. ConMem: Detecting severe concurrency bugs through an effect-oriented approach. In ASPLOS, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  69. J. Zheng, L. Williams, N. Nagappan, W. Snipes, J. P. Hudepohl, and M. A. Vouk. On the value of static analysis for fault detection in software. IEEE Trans. Softw. Eng., 32(4), 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  70. H. Zhong, L. Zhang, T. Xie, and H. Mei. Inferring resource specifications from natural language API documentation. In ASE, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. aComment: mining annotations from comments and code to detect interrupt related concurrency bugs

    Recommendations

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in
    • Published in

      cover image ACM Conferences
      ICSE '11: Proceedings of the 33rd International Conference on Software Engineering
      May 2011
      1258 pages
      ISBN:9781450304450
      DOI:10.1145/1985793

      Copyright © 2011 ACM

      Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 21 May 2011

      Permissions

      Request permissions about this article.

      Request Permissions

      Check for updates

      Qualifiers

      • research-article

      Acceptance Rates

      Overall Acceptance Rate276of1,856submissions,15%

      Upcoming Conference

      ICSE 2025

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader