Training on Linux & C Debugging Techniques

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 16+ 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 Lab Assignment – Linux & C Debugging

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.

  1. /*
  2.  * Memory Leak Program
  3.  * Author: Manish Kumar Bhojasia, Location: Bangalore, India
  4.  */
  6. #include <stdio.h>
  7. #include <stdlib.h>
  8. #include <string.h>
  10. #define KB1     1024
  11. #define MEMSIZE (4 * KB1)
  15. char *gptr;
  16. int num;
  18. char * f1_alloc(void);
  19. char * f2_copyme(void);
  20. void   f3_free(char *);
  22. main()
  23. {
  24.     srand((int)getpid());
  25.     while (1) {
  26.         gptr = f1_alloc();
  27.         strcpy(gptr, string);
  28.         f2_copyme();
  29.         f3_free(gptr);
  30.     }
  31. }
  33. char *f1_alloc()
  34. {
  35.     return (malloc(MEMSIZE));
  36. }
  37. char *f2_copyme()
  38. {
  39.     static int len, i = 0;
  40.     char *s;
  42.     len = strlen(string);
  43.     s = (char *)malloc(len);
  44.     strncpy(s, string, len);
  45.     i++;
  46.     if (!(i % MEMSIZE))
  47.         printf("i=%d, %s\n", i, s);
  48. }
  50. void f3_free(char *p)
  51. {
  52.     num = rand() % 3;
  53.     if (!num)
  54.         free(p);
  55. }

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

Course Outline

  • C program to Process
  • Compilation Steps
  • Preprocessor
  • Compiler
  • Assembler
  • Linker / Loader
  • GCC options
  • Fixing Warnings in the Code
  • Include Files
  • Libraries
  • Static Vs Dynamic Library
  • Static Library Generation
  • Dynamic Library Generation
  • Linking with Libraries
  • File Formats
  • ELF Format
  • Symbol Tables
  • Anatomy of a Process
  • Process Map
  • Memory Layout
  • Code Segment
  • Data Segment
  • Stack Segment
  • Heap Segment
  • Object Dump
  • Stack Frames
  • Mapping Assembly to C
  • Managing Heap
  • Pmap / Pstack
  • Strace
  • Debugging Tools
  • GDB Debugger
  • Debugging Running Process
  • Core dump analysis
  • Symbols & Optimizations
  • Default Optimization Levels
  • Common Failures
  • Failure Notifications
  • Common Faults
  • Segmentation Violation
  • Stack Overflow
  • Heap Overflow
  • Arithmetic Overflow
  • Illegal code execution
  • Stack Issue
  • Endian-ness issue
  • C library assertion
  • Data Type mismatch
Manish Bhojasia, a technology veteran with 17+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He is Linux Kernel Developer and SAN Architect and is passionate about competency developments in these areas. He lives in Bangalore and delivers focused training sessions to IT professionals in Linux Kernel, Linux Debugging, Linux Device Drivers, Linux Networking, Linux Storage & Cluster Administration, Advanced C Programming, SAN Storage Technologies, SCSI Internals and Storage Protocols such as iSCSI & Fiber Channel. Stay connected with him below.

Practice Interview Questions & Answers, Quizzes, Objective, Multiple Choice Aptitude Tests for Freshers and Experienced People in these topics - Learn C, C++, Java and C# Programming with coding example on Simple problems as well as tough Algorithms and Data-structures along with runtime output: - C Programs, Data-Structures and Algorithms, C++ Algorithms, Java Algorithms, C# Programs, Android Programs in Java

C Tutorials and Linux Commands Tutorial - C Tutorials, Linux Commands

Career Mentoring with our Founder / CTO - Read More
It was a wonderful course, a thorough study through the bits and pieces of Storage Devices and the other advancements in the SAN technology which was very informative for me. Well prepared slides, practical thoughts and fully interactive class.
— Milind - Microsoft
The Linux System Programming training presented by Manish was very good. His presentation was very precise, clear and in-depth covering the real-time design problems and solutions.
— Suneeth - Brocade
The depth of C coverage, the common pitfalls, the presentation by Manish and his pace were all remarkable. Gave a clear picture of the inner working of C language design.
— Shivanshu - Netapp
The course was well designed and coverage was satisfactorily deep. The linux programming assignments were designed to get a feel of real time issues and covered lot of areas of uncertainty. The project work suggested at the end of the course was invaluable.
— Somenath - EMC
Thank you for providing such an awesome experience on Linux Device Driver Programming. The real beauty in this training that I could witness was its practical exposures to design, issues and explanations on the same in a neat way.
— Roshan - Oracle/Sun
I checked a lot of other training centers before deciding to go with Sanfoundry and am glad I did. The training was very interactive and covered the most important industry aspects of SAN technology needed currently. I admire Manish's immense knowledge on the subject and his friendly attitude.
— Anoop - Hewlett Packard
Advanced C Course content quality was awesome. Lab exercise by Manish are really good as well as tough to cover C programming concepts indepth. The quality of teaching is superb.
— Vikas - Cisco
Best of Best in SAN training from the scratch to more detailed explanation. It was a very informative and good learning experience. I also completed the SNIA certification after going through this course in 1 week.
— Praveen – Oracle
Manish’s presentation was very nice and cleared all my open doubts. Device Driver Lab exercises are really challenging and we really need to break our heads to design and code.
— Gunasekhar – Ericsson
The Linux Kernel Programming Course structure is very good. The trainer is very knowledgable and is ever willing to clear the doubts. The programming exercises are given to understand the topics in more depth.
— Thomas – Seagate
It was a wonderful experience, and I learnt a lot from Advanced-C course. There was so much more to the C language than I thought initially, and Manish Sir taught it in such a way that we got a deep understanding of the language, and the nuances of debugging. The four days were challenging, but enjoyable. In short, our trainer is brilliant, and so is the course.
— Meha – BITS Pilani, Hyd
Manish has tremendous knowledge regarding SAN. Looking forward to FC Administration Courses also from him. Thanks a lot !!!
— Srinivasa – IBM
The Linux Systems Programming course was very good and topics were discussed in depth. Also this is a very rare course and not many institutes in India conduct such courses at such depths. The presentation were clear and good and the lab exercises were designed in such a way that the concepts could be understood practically.
— Sashant – Wipro
The methodic way in which the training was conducted made it very comprehensible. Manish's knowledge and experience in kernel programming is an excellent "hand-hold" for starting to understand kernel internals.
— Srinivas – Radisys
Subscribe Newsletter & Posts
Follow Manish & Sanfoundry