Abstract
Debug information, usually encoded in the DWARF format, is a hidden and obscure component of our computing infrastructure. Debug information is obviously used by debuggers, but it also plays a key role in program analysis tools, and, most surprisingly, it can be relied upon by the runtime of high-level programming languages. For instance the C++ runtime leverages DWARF stack unwind tables to implement exceptions! Alas, generating debug information adds significant burden to compiler implementations, and the debug information itself can be pervaded by subtle bugs, making the whole infrastructure unreliable. Additionally, interpreting the debug tables is a time-consuming task and, for some applications as sampling profilers, it turns out to be a performance bottleneck.
In this paper we focus on the DWARF .eh_frame table, that enables stack unwinding in absence of frame-pointers. We will describe two techniques to perform validation and synthesis of the DWARF stack unwinding tables, and their implementation for the x86_64 architecture. The validation tool has proven effective for compiler and inline assembly testing, while the synthesis tool can generate DWARF unwind tables for arbitrary binaries lacking debug information. Additionally, we report on a technique to precompile unwind tables into native x86_64 code, which we have implemented and integrated into libunwind, resulting in 11x-25x DWARF-based unwind speedups.
Supplemental Material
- J. Baker, A. Cunei, T. Kalibera, F. Pizlo, and J. Vitek. 2009. Accurate Garbage Collection in Uncooperative Environments Revisited. Concurr. Comput. : Pract. Exper. 21, 12 (Aug. 2009), 1572–1606. Google Scholar
Digital Library
- Eli Bendersky. 2019. pyelftools. https://github.com/eliben/pyelftoolsGoogle Scholar
- David Brumley, Ivan Jager, Thanassis Avgerinos, and Edward J. Schwartz. 2011. BAP: A Binary Analysis Platform. In Computer Aided Verification - 23rd International Conference, CAV 2011, Snowbird, UT, USA, July 14-20, 2011. Proceedings. 463–469. Google Scholar
Cross Ref
- Cristina Cifuentes. 1994. Reverse compilation techniques. Ph.D. Dissertation. Queensland University of Technology. https: //eprints.qut.edu.au/36820/Google Scholar
- Jonathan Corbet. 2017. The ORCs are coming. LWN.net (2017). https://lwn.net/Articles/728339/Google Scholar
- DWARF. 2017. DWARF Debugging Information Format version 5. DWARF Debugging Information Format Committee. http://dwarfstd.orgGoogle Scholar
- Anonymous Google Engineer. 2018. Personal communication.Google Scholar
- Jingxuan He, Pesho Ivanov, Petar Tsankov, Veselin Raychev, and Martin Vechev. 2018. Debin: Predicting Debug Information in Stripped Binaries. In Proceedings of the 2018 ACM SIGSAC Conference on Computer and Communications Security (CCS ’18). ACM, New York, NY, USA, 1667–1680. Google Scholar
Digital Library
- Fergus Henderson. 2002. Accurate Garbage Collection in an Uncooperative Environment. In Proceedings of the 3rd International Symposium on Memory Management (ISMM ’02). ACM, New York, NY, USA, 150–156. Google Scholar
Digital Library
- Stephen Kell. 2015. Towards a Dynamic Object Model Within Unix Processes. In 2015 ACM International Symposium on New Ideas, New Paradigms, and Reflections on Programming and Software (Onward!) (Onward! 2015). ACM, New York, NY, USA, 224–239. Google Scholar
Digital Library
- James Oakley and Sergey Bratus. 2011. Exploiting the Hard-Working DWARF: Trojan and Exploit Techniques with No Native Executable Code. In 5th USENIX Workshop on Offensive Technologies, WOOT’11, August 8, 2011, San Francisco, CA, USA, Proceedings. 91–102. http://static.usenix.org/event/woot11/tech/final_files/Oakley.pdfGoogle Scholar
- John Regehr, Yang Chen, Pascal Cuoq, Eric Eide, Chucky Ellison, and Xuejun Yang. 2012. Test-case Reduction for C Compiler Bugs. In Proceedings of the 33rd ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI ’12). ACM, New York, NY, USA, 335–346. Google Scholar
Digital Library
- Fridtjof Siebert. 2001. Constant-Time Root Scanning for Deterministic Garbage Collection. In Proceedings of the 10th International Conference on Compiler Construction (CC ’01). Springer-Verlag, London, UK, UK, 304–318. http://dl.acm. org/citation.cfm?id=647477.727769Google Scholar
Cross Ref
- Xuejun Yang, Yang Chen, Eric Eide, and John Regehr. 2011. Finding and understanding bugs in C compilers. In Proceedings of the 32nd ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2011, San Jose, CA, USA, June 4-8, 2011. 283–294. Google Scholar
Digital Library
- Yanmin Zhang. 2008. Hackbench. https://people.redhat.com/mingo/cfs-scheduler/tools/hackbench.cGoogle Scholar
Index Terms
Reliable and fast DWARF-based stack unwinding
Recommendations
Debuggers and Logging Frameworks
Debuggers are cheap and effective tools. Typically we use them in a bottom-up fashion starting from the problem going to its source, but when this strategy fails, we might have to resort to a more tedious top-down breadth-first search. To locate bugs, ...
Transparent mutable replay for multicore debugging and patch validation
ASPLOS '13We present Dora, a mutable record-replay system which allows a recorded execution of an application to be replayed with a modified version of the application. This feature, not available in previous record-replay systems, enables powerful new ...
Transparent mutable replay for multicore debugging and patch validation
ASPLOS '13: Proceedings of the eighteenth international conference on Architectural support for programming languages and operating systemsWe present Dora, a mutable record-replay system which allows a recorded execution of an application to be replayed with a modified version of the application. This feature, not available in previous record-replay systems, enables powerful new ...






Comments