skip to main content
research-article
Open Access
Artifacts Available
Artifacts Evaluated & Functional

Reliable and fast DWARF-based stack unwinding

Published:10 October 2019Publication History
Skip Abstract Section

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.

Skip Supplemental Material Section

Supplemental Material

a146-bastian

Presentation at OOPSLA '19

References

  1. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  2. Eli Bendersky. 2019. pyelftools. https://github.com/eliben/pyelftoolsGoogle ScholarGoogle Scholar
  3. 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 ScholarGoogle ScholarCross RefCross Ref
  4. Cristina Cifuentes. 1994. Reverse compilation techniques. Ph.D. Dissertation. Queensland University of Technology. https: //eprints.qut.edu.au/36820/Google ScholarGoogle Scholar
  5. Jonathan Corbet. 2017. The ORCs are coming. LWN.net (2017). https://lwn.net/Articles/728339/Google ScholarGoogle Scholar
  6. DWARF. 2017. DWARF Debugging Information Format version 5. DWARF Debugging Information Format Committee. http://dwarfstd.orgGoogle ScholarGoogle Scholar
  7. Anonymous Google Engineer. 2018. Personal communication.Google ScholarGoogle Scholar
  8. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  9. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  10. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  11. 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 ScholarGoogle Scholar
  12. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  13. 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 ScholarGoogle ScholarCross RefCross Ref
  14. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  15. Yanmin Zhang. 2008. Hackbench. https://people.redhat.com/mingo/cfs-scheduler/tools/hackbench.cGoogle ScholarGoogle Scholar

Index Terms

  1. Reliable and fast DWARF-based stack unwinding

      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

      Full Access

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader
      About Cookies On This Site

      We use cookies to ensure that we give you the best experience on our website.

      Learn more

      Got it!