diff --git a/debugging-techniques.txt b/debugging-techniques.txt new file mode 100644 index 0000000..b726526 --- /dev/null +++ b/debugging-techniques.txt @@ -0,0 +1,5 @@ +DEBUGGING TECHNIQUES: +--------------------- + + + diff --git a/process-stack.txt b/process-stack.txt index 29e0c6c..17d1e17 100644 --- a/process-stack.txt +++ b/process-stack.txt @@ -131,3 +131,57 @@ Section 7: Foundation of Processes (Part A): We can also use Address-sanitizers + + * Stack Overflow: + ~~~~~~~~~~~~~~~ + + + When the size of any number of call stack crosses the + finite size of the allocated stack of the program, then + it leads to stack overflow. + + +---------------------------+ + | | + | stack | | + |---------------------------| | + | | | + | array[0] | | + | array[1] | | + | | | | + | | | | + | | | \|/ + | | | * + | array[99....] | + |---------------------------| + | array[10....0] | + | heap | + | | + |---------------------------| + | | + | data | + | | + | | + |---------------------------| + | | + | .text | + | | + +---------------------------+ + + + * Address Sanitizer: + ~~~~~~~~~~~~~~~~~~ + + To know about potential memory leaks, we can enable stanitizer flag + + Compiler flag: + -fsanitize=address + + + * To detect memory leak, we can use valgrind. + + Command: + $valgrind --leak-check=full ./ + + OR + + $valgrind ./