Detecting Memory Related Errors using a Valgrind Tool Suite and Detecting Data Races using Thread Sanitizer Clang

Main Article Content

Saroj. A. Shambharkar

Abstract

It is important for a programmer to detect data races when a programming is done under concurrent systems or using shared memory or parallel programming. Many researchers are implementing their applications using the parallel programming and even for simple c programs ,they are not much concentrating on memory issues,accuracy of a result obtained, speed. It is important and one must take care it. There may found data races in their application code which has to be resolve and for that some data race detectors are required. There is also a need of detecting the memory related problems that may occur with shared memory. As a result of such memory related bugs and data races, the system may slow down the speed of the execution of a program .To improve the speed,the valgrind tool suite is used for memory related problems and ThreadSanitizer is used for detecting data races and some authors used Intel Thread Checker,ADAT,on-the-fly techniques for detecting them. Some tools are reducing the false positives but removing all false positives. Valgrind is providing a number of debugging and profiling tools that helps in improving the accuracy and to enhance the performance of system. This paper is demonstrating and showing the different results obtained by using the mentioned tool suite. The available tools in valgrind tool suite helps a programmer by displaying appropriate messages if any memory related errors and based on these messages the appropriate action can be taken by the programmer. And next time when user start writing similar type of application code, tries to avoid such errors and this makes our programs faster and avoids memory leaks. The memory leaks may happen when the programmer tries to write or read or access any location of an array beyond its bound. There are different categories of memory leaks. From the existing categories the two mostly used are definitely lost and probably lost and the result is showing both the memory leaks. The result through the stack trace tells where the memory leak is allocated. The output can also be store in a log file or simply we can display through appropriate error messages. This paper is showing some of the error messages and demonstrated through some programming example and related error messages using valgrind tool suite.


Keywords: Memory leak; valgrind tool suite; profiling tools; stack trace; ThreadSanitizer; heap memory; Intel Thread Checker; false positive;

Downloads

Download data is not yet available.

Article Details

Section
Articles