Title
SF006 – Linux & C Debugging Techniques
Course Overview
Most of the software bugs center around memory leaks which invariably results in segmentation violation followed by a core dump. Linux and C debugging course gives an in-depth coverage on various programming errors, a detailed address level breakup of memory map of a process, ways to debug the program as well as core dump analysis. The participant will learn to detect and debug different type of issues in the code with or without gdb debugger. Participant will also get a sound understanding of C development environment along with reading assembly and binary files and stack frames creation.
Course Highlight
- Course will be delivered by our Founder/Director who is an Expert with 20+ years of experience in Linux Kernel and SAN software development.
- The course flow will be an assignment driven model so that participants can have a hands-on experience of various debugging techniques.
- Participants will be writing, reviewing and debugging lots of C programs dealing with segmentation violation, stack overflow, heap overflow, arithmetic overflow, illegal code execution, stack issue, endian-ness issue, c library assertion, data type mismatches, etc.
Course Delivery
- Lectures, Classroom Discussions and Lab Exercises
- 30% Theory, 70% Lab
- Location: Sanfoundry Institute, Bangalore, India
Sample GDB Learning Exercise
Sample Lab Assignment – Linux & C Debugging
advertisement
advertisement
Run the C code mentioned below in your computer (preferably Linux ubuntu / redhat / fedora / centos / debian / suse, etc…). Your computer will seem to hang after 5 to 10 minutes of running this code or maybe the program will crash. So, debug the following C-code under Linux platform & identify 10 Issues with this code.
/*
* Sanfoundry.com Memory Leak Program
* Author: Manish Kumar Bhojasia, Location: Bangalore, India
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define KB1 1024
#define MEMSIZE (4 * KB1)
char *string = "IDENTIFY 10 ISSUES IN THIS MEMLEAK PROGRAM";
char *gstring = "IDENTIFY 10 ISSUES IN THIS MEMLEAK PROGRAM";
char *gptr;
int num;
char * f1_alloc(void);
char * f2_copyme(void);
void f3_free(char *);
main()
{
srand((int)getpid());
while (1) {
gptr = f1_alloc();
strcpy(gptr, string);
f2_copyme();
f3_free(gptr);
}
}
char *f1_alloc()
{
return (malloc(MEMSIZE));
}
char *f2_copyme()
{
static int len, i = 0;
char *s;
len = strlen(string);
s = (char *)malloc(len);
strncpy(s, string, len);
i++;
if (!(i % MEMSIZE))
printf("i=%d, %s\n", i, s);
}
void f3_free(char *p)
{
num = rand() % 3;
if (!num)
free(p);
}
Pre-Requisites
Basic understanding of C programming language
Target Audience
IT Professionals who are doing development, maintenance and testing of software products
Fee, Schedule & Registration
Click Here for Linux & C Debugging course training schedule, fee and registration information
Click Here for Linux & C Debugging course training schedule, fee and registration information
Course Outline
|
|