Trace and debug Linux programs

Coming soon. This course is planned; lessons and labs are not available yet. No release date has been announced.

Use C, system calls, ELF and controlled profiling to explain failures and verify small repairs under changed inputs.

Advanced ยท C debugging and execution

Before you begin

Write and debug small C programs, including pointers, ownership and basic process behavior.

The planned project

The planned project asks you to trace a small program failure across source and runtime evidence, make a limited repair and verify it under a changed input or schedule.

Course scope

User-space C and optional x86-64 AT&T reading; kernel-driver development is a later specialty.

Planned course outline

3 planned chapters and 6 lesson outlines.

  1. Cross the user/kernel boundary

    Connect C source to descriptors, syscall results and executable structure.

    1. Planned lesson: Trace descriptors and syscalls

      Planned task: Follow open, read, write and close calls with return values and error paths.

      Changed case to investigate: Permission denial replaces a missing file; revise the diagnosis and repair.

    2. Planned lesson: Read ELF and a small disassembly

      Planned task: Relate loadable segments, symbols and a compiled instruction span without equating them.

      Changed case to investigate: A stripped build removes symbols; use other evidence to locate the relevant routine.

  2. Find the program fault

    Inspect memory and scheduling evidence before changing source.

    1. Planned lesson: Debug memory ownership

      Planned task: Use a debugger to identify a bounded lifetime or invalid-access fault.

      Changed case to investigate: A larger input takes another path; prove the fix there too.

    2. Planned lesson: Reproduce an ordering problem

      Planned task: Document shared state and a controlled schedule that exposes a concurrency bug.

      Changed case to investigate: A different schedule hides the symptom; design a test that still checks the unsafe assumption.

  3. Repair and measure

    Make a small correction and check both behavior and cost.

    1. Planned lesson: Profile the workload

      Planned task: Distinguish hot instructions from blocked time under a repeatable input.

      Changed case to investigate: Input size changes the limiting path; reprofile before optimizing.

    2. Planned lesson: Verify the repair

      Planned task: Change the smallest justified C path and test normal, error and resource behavior.

      Changed case to investigate: A new failure path leaks a descriptor; show the correction and preserved behavior.

See available courses