Skip to main content

Endicheck: Dynamic Analysis for Detecting Endianness Bugs

Part of the Lecture Notes in Computer Science book series (LNTCS,volume 12079)

Abstract

Computers store numbers in two mutually incompatible ways: little-endian or big-endian. They differ in the order of bytes within representation of numbers. This ordering is called endianness. When two computer systems, programs or devices communicate, they must agree on which endianness to use, in order to avoid misinterpretation of numeric data values.

We present Endicheck, a dynamic analysis tool for detecting endianness bugs, which is based on the popular Valgrind framework. It helps developers to find those code locations in their program where they forgot to swap bytes properly. Endicheck requires less source code annotations than existing tools, such as Sparse used by Linux kernel developers, and it can also detect potential bugs that would only manifest if the given program was run on computer with an opposite endianness. Our approach has been evaluated and validated on the Radeon SI Linux OpenGL driver, which is known to contain endianness-related bugs, and on several open-source programs. Results of experiments show that Endicheck can successfully identify many endianness-related bugs and provide useful diagnostic messages together with the source code locations of respective bugs.

References

  1. Bond, M.D., Nethercote, N., Kent, S.W., Guyer, S.Z., McKinley, K.S.: Tracking Bad Apples: Reporting the Origin of Null and Undefined Value Errors. In: Proceedings of OOPSLA 2007. ACM (2007)

    Google Scholar 

  2. Burrows, M., Freund, S.N., Wiener, J.L.: Run-Time Type Checking for Binary Programs. In: Proceedings of CC 2003. LNCS, vol. 2622. Springer (2003)

    Google Scholar 

  3. Kapl, R.: Dynamic Analysis for Finding Endianity Bugs. Master thesis, Charles University, Prague, June 2018

    Google Scholar 

  4. Liu, Y., Milanova, A.: Static Analysis for Inference of Explicit Information Flow. In: Proceedings of PASTE 2008. ACM (2008)

    Google Scholar 

  5. Seward, J., Nethercote, N.: Using Valgrind to Detect Undefined Value Errors with Bit-Precision. In: Proceedings of USENIX 2005 Annual Technical Conference. USENIX Association (2005)

    Google Scholar 

  6. Nethercote, N., Seward, J.: Valgrind: A Framework for Heavyweight Dynamic Binary Instrumentation. In: Proceedings of PLDI 2007. ACM (2007)

    Google Scholar 

  7. Nethercote, N., Seward, J.: How to Shadow Every Byte of Memory Used by a Program. In: Proceedings of VEE 2007. ACM (2007)

    Google Scholar 

  8. Newsome, J., Song, D.: Dynamic Taint Analysis for Automatic Detection, Analysis, and Signature Generation of Exploits on Commodity Software. In: Proceedings of NDSS 2005. The Internet Society (2005)

    Google Scholar 

  9. Serebryany, K., Bruening, D., Potapenko, A., Vyukov, D.: AddressSanitizer: A Fast Address Sanity Checker. In: Proceedings of USENIX 2012 Annual Technical Conference. USENIX Association (2012)

    Google Scholar 

  10. Clang 8 documentation / DataFlowSanitizer. https://clang.llvm.org/docs/DataFlowSanitizer.html (accessed in October 2019)

  11. Sparse: a semantic parser for C programs. https://lwn.net/Articles/689907/ (accessed in October 2019)

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Pavel Parízek .

Editor information

Editors and Affiliations

Rights and permissions

Open Access This chapter is licensed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license and indicate if changes were made.

The images or other third party material in this chapter are included in the chapter's Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the chapter's Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder.

Reprints and Permissions

Copyright information

© 2020 The Author(s)

About this paper

Verify currency and authenticity via CrossMark

Cite this paper

Kápl, R., Parízek, P. (2020). Endicheck: Dynamic Analysis for Detecting Endianness Bugs. In: Biere, A., Parker, D. (eds) Tools and Algorithms for the Construction and Analysis of Systems. TACAS 2020. Lecture Notes in Computer Science(), vol 12079. Springer, Cham. https://doi.org/10.1007/978-3-030-45237-7_15

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-45237-7_15

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-45236-0

  • Online ISBN: 978-3-030-45237-7

  • eBook Packages: Computer ScienceComputer Science (R0)