
Trace Every System Call a Program Makes With strace
Run a program under strace, read each line as name, arguments and result, then filter, follow child processes and write the trace to a file to find real faults.
Tag
445 posts

Run a program under strace, read each line as name, arguments and result, then filter, follow child processes and write the trace to a file to find real faults.

Build Go programs for 32-bit and 64-bit Arm boards with GOOS, GOARCH and GOARM, pick the right GOARM value, and verify the result with file and go version -m.

Write, assemble and step through your first 6502 program in the Easy 6502 browser simulator, from a single pixel to a loop that fills a whole row.

Compile with -fsanitize=address to catch heap overflows, use after free, double free and leaks, and learn to read the report that names the exact line.

Read a TMP102 sensor on a Raspberry Pi Pico with i2c_init, i2c_write_blocking and i2c_read_blocking, using nostop for the repeated start.

A system call is the controlled jump from a user program into the kernel. See how write() becomes a syscall instruction, a number in rax and a return value.

Run an Autotools configure script for another architecture with --host, --build and a sysroot, and read the cross-compiling errors it prints when it goes wrong.

Learn every 6502 register and status flag: what A, X, Y, SP, PC and the N V B D I Z C bits do, which instructions change them, and how to trace them.

Hard, firm and soft real-time differ in what a missed deadline costs, not in how short it is. Learn to classify requirements with examples and a utility test.

Turn Segmentation fault (core dumped) into a line number: compile with -g, enable core files, open the core in gdb, and read the backtrace and variables.

Write an Arduino I2C scanner with Wire.beginTransmission and endTransmission, read the error codes and fix the usual reasons a device does not appear.

Amdahl's law caps parallel speedup at one over the serial fraction. Work the numbers in C and see why a 95 percent parallel program tops out at 20 times.