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.
- ANTLR. 2017. The ANTLR Parser Generator. https://www.antlr.org/ Google Scholar
- Firefox. 2017. Using Lithium to Reduce Bugs in Firefox. https://github.com/MozillaSecurity/lithium/blob/master/src/lithium/docs/using-for-firefox.md Google Scholar
- GCC. 2017. A Guide to Testcase Reduction. https://gcc.gnu.org//A_guide_to_testcase_reduction Google Scholar
- Google. 2015. About Bazel. https://bazel.build/about Google Scholar
- Khronos Group. 2019. The OpenGL Shading Language Version 4.60.7. https://registry.khronos.org/OpenGL/specs/gl/GLSLangSpec.4.60.pdf Google Scholar
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- RenΓ‘ta HodovΓ‘n, Akos Kiss, Daniel Vince, and Zhiqiang Zang. [n. d.]. Picireny. https://github.com/renatahodovan/picireny Google Scholar
- JS Delta. 2017. JS Delta. https://github.com/wala/jsdelta Google Scholar
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 Scholar
- LLVM. 2017. How to submit an LLVM bug report. https://llvm.org/docs/HowToSubmitABug.html Google Scholar
- 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 ScholarDigital Library
- 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 Scholar
- 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 ScholarDigital Library
- Mozilla Security. 2008. Lithium: Line-Based Testcase Reducer. https://github.com/MozillaSecurity/lithium Google Scholar
- Chengnian Sun, Yuanbo Li, Qirun Zhang, Tianxiao Gu, and Zhendong Su. 2018. Perses: Syntax-Directed Program Reduction. https://github.com/uw-pluverse/perses Google Scholar
- 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 ScholarDigital Library
- 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 ScholarDigital Library
Index Terms
- Ad Hoc Syntax-Guided Program Reduction
Recommendations
Perses: syntax-guided program reduction
ICSE '18: Proceedings of the 40th International Conference on Software EngineeringGiven a program P that exhibits a certain property Ξ¨ (e.g., a C program that crashes GCC when it is being compiled), the goal of program reduction is to minimize P to a smaller variant Pβ² that still exhibits the same property, i.e., Ξ¨(Pβ²). Program ...
PPR: Pairwise Program Reduction
ESEC/FSE 2023: Proceedings of the 31st ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software EngineeringProgram reduction is a practical technique widely used for debugging compilers. To report a compiler bug with a bug-triggering program, one needs to minimize the program by removing bugirrelevant program elements first. Though existing program ...
On the Caching Schemes to Speed Up Program Reduction
Program reduction is a highly practical, widely demanded technique to help debug language tools, such as compilers, interpreters and debuggers. Given a program P that exhibits a property Ο, conceptually, program reduction iteratively applies various ...
Comments