Abstract
Dynamic analysis is a popular approach to detecting possible runtime errors in software and for monitoring program behavior, which is based on precise inspection of a single execution trace. It has already proved to be useful especially in the case of multithreaded programs and concurrency errors, such as race conditions. Nevertheless, usage of dynamic analysis requires good tool support, e.g. for program code instrumentation and recording important events. While there exist several dynamic analysis frameworks for Java and C/C++ programs, including RoadRunner, DiSL and Valgrind, we were not aware of any framework targeting the C# language and the .NET platform. Therefore, we present SharpDetect, a new framework for dynamic analysis of .NET programs — that is, however, focused mainly on programs compiled from the source code written in C#. We describe the overall architecture of SharpDetect, the main analysis procedure, selected interesting technical details, its basic usage via command-line, configuration options, and the interface for custom analysis plugins. In addition, we discuss performance overhead of SharpDetect based on experiments with small benchmarks, and demonstrate its practical usefulness through a case study that involves application on NetMQ, a C# implementation of the ZeroMQ messaging middleware, where SharpDetect found one real concurrency error.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Similar content being viewed by others
References
Cizmarik, A.: Dynamic Analysis Framework for C#/.NET Programs. Master thesis, Charles University, Prague, (2020) https://is.cuni.cz/webapps/zzp/detail/209472/45410198
Flanagan, C., Freund, S.N.: FastTrack: efficient and precise dynamic race detection. In Proceedings of PLDI 2009, pp. 121–133. ACM (2009) https://doi.org/10.1145/1542476.1542490
Flanagan, C., Freund, S.N.: The RoadRunner dynamic analysis framework for concurrent programs. In Proceedings of PASTE 2010, pp. 1–8. ACM (2010) https://doi.org/10.1145/1806672.1806674
Marek, L., et al.: Java bytecode instrumentation made easy: the DiSL framework for dynamic program analysis. In: Jhala, R., Igarashi, A. (eds.) APLAS 2012. LNCS, vol. 7705, pp. 256–263. Springer, Heidelberg (2012). https://doi.org/10.1007/978-3-642-35182-2_18
Nethercote, N., Seward, J.: Valgrind: a framework for heavyweight dynamic binary instrumentation. In Proceedings of PLDI 2007, pp. 89–100. ACM (2007) https://doi.org/10.1145/1250734.1250746
Savage, S., Burrows, M., Nelson, G., Sobalvarro, P., Anderson, T.: Eraser: a dynamic data race detector for multithreaded programs. ACM Trans. Comput. Syst. (TOCS) 15(4), 391–411 (1997). https://doi.org/10.1145/265924.265927
Serebryany, K., Iskhodzhanov, T.: ThreadSanitizer: data race detection in practice. In Proceedings of WBIA 2009, pp. 62–71. ACM (2009) https://doi.org/10.1145/1791194.1791203
Dnlib, https://github.com/0xd4d/dnlib. Accessed Jun 2020
The NetMQ library, https://netmq.readthedocs.io/en/latest/. Accessed Jun 2020
NetMQ Custom Clock Implementation, https://github.com/zeromq/netmq/blob/e4dfcf9e8190f85bf4fab9fc657e2c7da820c7f4/src/NetMQ/Core/Utils/Clock.cs#L88. Accessed Jun 2020
.NET Profiling API Reference, https://docs.microsoft.com/en-us/dotnet/framework/unmanaged-api/profiling/. Accessed Jun 2020
A complete list of supported Runtime Identifiers (RID), https://docs.microsoft.com/en-us/dotnet/core/rid-catalog. Accessed Jun 2020
Acknowledgments
This work was partially supported by the Czech Science Foundation project 18-17403S and partially supported by the Charles University institutional funding project SVV 260588.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2020 Springer Nature Switzerland AG
About this paper
Cite this paper
Čižmárik, A., Parízek, P. (2020). SharpDetect: Dynamic Analysis Framework for C#/.NET Programs. In: Deshmukh, J., Ničković, D. (eds) Runtime Verification. RV 2020. Lecture Notes in Computer Science(), vol 12399. Springer, Cham. https://doi.org/10.1007/978-3-030-60508-7_16
Download citation
DOI: https://doi.org/10.1007/978-3-030-60508-7_16
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-030-60507-0
Online ISBN: 978-3-030-60508-7
eBook Packages: Computer ScienceComputer Science (R0)