skip to main content
10.1145/3611643.3613101acmconferencesArticle/Chapter ViewAbstractPublication PagesfseConference Proceedingsconference-collections
research-article

Ad Hoc Syntax-Guided Program Reduction

Published:30 November 2023Publication History

ABSTRACT

Program reduction is a widely adopted, indispensable technique for debugging language implementations such as compilers and interpreters. Given a program 𝑃 and a bug triggered by 𝑃, a program reducer can produce a minimized program π‘ƒβˆ— that is derived from 𝑃 and still triggers the same bug. Perses is one of the state-of-the-art program reducers. It leverages the syntax of 𝑃 to guide the reduction process for efficiency and effectiveness. It is language-agnostic as its reduction algorithm is independent of any language-specific syntax. Conceptually to support a new language, Perses only needs the context-free grammar 𝐺 of the language; in practice, it is not easy. One needs to first manually transform 𝐺 into a special grammar form PNF with a tool provided by Perses, second manually change the code base of Perses to integrate the new language, and lastly build a binary of Perses.

This paper presents our latest work to improve the usability of Perses by extending Perses to perform ad hoc program reduction for any new language as long as the language has a context-free grammar 𝐺. With this extended version (referred to as Persesadhoc), the difficulty of supporting new languages is significantly reduced: a user only needs to write a configuration file and execute one command to support a new language in Perses, compared to manually transforming the grammar format, modifying the code base, and re-building Perses.

Our case study demonstrates that with Persesadhoc, the Perses related infrastructure code required for supporting GLSL can be reduced from 190 lines of code to 20. Our extensive evaluations also show that Persesadhoc is as effective and efficient as Perses in reducing hoc programs, and only takes 10 seconds to support a new language, which is negligible compared to the manual effort required in Perses. A video demonstration of the tool can be found at https://youtu.be/trYwOT0mXhU.

References

  1. ANTLR. 2017. The ANTLR Parser Generator. https://www.antlr.org/ Google ScholarGoogle Scholar
  2. Firefox. 2017. Using Lithium to Reduce Bugs in Firefox. https://github.com/MozillaSecurity/lithium/blob/master/src/lithium/docs/using-for-firefox.md Google ScholarGoogle Scholar
  3. GCC. 2017. A Guide to Testcase Reduction. https://gcc.gnu.org//A_guide_to_testcase_reduction Google ScholarGoogle Scholar
  4. Google. 2015. About Bazel. https://bazel.build/about Google ScholarGoogle Scholar
  5. Khronos Group. 2019. The OpenGL Shading Language Version 4.60.7. https://registry.khronos.org/OpenGL/specs/gl/GLSLangSpec.4.60.pdf Google ScholarGoogle Scholar
  6. Kihong Heo, Woosuk Lee, Pardis Pashakhanloo, and Mayur Naik. 2018. Effective Program Debloating via Reinforcement Learning. In Proceedings of the 2018 ACM SIGSAC Conference on Computer and Communications Security (CCS ’18). Association for Computing Machinery, New York, NY, USA. 380–394. isbn:9781450356930 https://doi.org/10.1145/3243734.3243838 Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Satia Herfert, Jibesh Patra, and Michael Pradel. 2017. Automatically Reducing Tree-Structured Test Inputs. In Proceedings of the 32nd IEEE/ACM International Conference on Automated Software Engineering (ASE 2017). IEEE Press, 861–871. isbn:9781538626849 Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. RenΓ‘ta HodovΓ‘n, Akos Kiss, Daniel Vince, and Zhiqiang Zang. [n. d.]. Picireny. https://github.com/renatahodovan/picireny Google ScholarGoogle Scholar
  9. JS Delta. 2017. JS Delta. https://github.com/wala/jsdelta Google ScholarGoogle Scholar
  10. Christian Gram Kalhauge and Jens Palsberg. 2019. Binary reduction of dependency graphs. In Proceedings of the 2019 27th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering. 556–566. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Christian Gram Kalhauge and Jens Palsberg. 2021. Logical bytecode reduction. In Proceedings of the 42nd ACM SIGPLAN International Conference on Programming Language Design and Implementation. 1003–1016. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Gereon Kremer, Aina Niemetz, and Mathias Preiner. 2021. ddSMT 2.0: Better Delta Debugging for the SMT-LIBv2 Language and Friends. In Computer Aided Verification - 33rd International Conference, CAV 2021, Virtual Event, July 20-23, 2021, Proceedings, Part II, Alexandra Silva and K. Rustan M. Leino (Eds.) (Lecture Notes in Computer Science, Vol. 12760). Springer, 231–242. https://doi.org/10.1007/978-3-030-81688-9_11 Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Bastien Lecoeur, Hasan Mohsin, and Alastair F. Donaldson. 2023. Program Reconditioning: Avoiding Undefined Behaviour When Finding and Reducing Compiler Bugs. Proceedings of the ACM Programming Languages, 7 (2023). Google ScholarGoogle Scholar
  14. LLVM. 2017. How to submit an LLVM bug report. https://llvm.org/docs/HowToSubmitABug.html Google ScholarGoogle Scholar
  15. Ghassan Misherghi and Zhendong Su. 2006. HDD: Hierarchical Delta Debugging. In Proceedings of the 28th International Conference on Software Engineering (ICSE ’06). Association for Computing Machinery, New York, NY, USA. 142–151. isbn:1595933751 https://doi.org/10.1145/1134285.1134307 Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Aina Niemetz and Armin Biere. 2013. ddSMT: a delta debugger for the SMT-LIB v2 format. In Proceedings of the 11th International Workshop on Satisfiability Modulo Theories, SMT. 8–9. Google ScholarGoogle Scholar
  17. John Regehr, Yang Chen, Pascal Cuoq, Eric Eide, Chucky Ellison, and Xuejun Yang. 2012. Test-Case Reduction for C Compiler Bugs. PLDI ’12. Association for Computing Machinery, New York, NY, USA. 12 pages. isbn:9781450312059 https://doi.org/10.1145/2254064.2254104 Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Mozilla Security. 2008. Lithium: Line-Based Testcase Reducer. https://github.com/MozillaSecurity/lithium Google ScholarGoogle Scholar
  19. Chengnian Sun, Yuanbo Li, Qirun Zhang, Tianxiao Gu, and Zhendong Su. 2018. Perses: Syntax-Directed Program Reduction. https://github.com/uw-pluverse/perses Google ScholarGoogle Scholar
  20. Chengnian Sun, Yuanbo Li, Qirun Zhang, Tianxiao Gu, and Zhendong Su. 2018. Perses: Syntax-Guided Program Reduction. In Proceedings of the 40th International Conference on Software Engineering (ICSE ’18). Association for Computing Machinery, New York, NY, USA. 361–371. isbn:9781450356381 https://doi.org/10.1145/3180155.3180236 Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Andreas Zeller and Ralf Hildebrandt. 2002. Simplifying and Isolating Failure-Inducing Input. IEEE Trans. Softw. Eng., 28, 2 (2002), Feb., 183–200. issn:0098-5589 https://doi.org/10.1109/32.988498 Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Ad Hoc Syntax-Guided Program Reduction

    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
      ESEC/FSE 2023: Proceedings of the 31st ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering
      November 2023
      2215 pages
      ISBN:9798400703270
      DOI:10.1145/3611643

      Copyright Β© 2023 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 the author(s) 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: 30 November 2023

      Permissions

      Request permissions about this article.

      Request Permissions

      Check for updates

      Qualifiers

      • research-article

      Acceptance Rates

      Overall Acceptance Rate112of543submissions,21%

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader