Demystifying Process Address Space: Heap, Stack, and Beyond
summary
Linux x86 process layout shows 48-bit virtual addresses split into user vs kernel space, kernel uses KPTI for isolation, and ASLR randomizes most mappings; pmap and readelf + objdump reveal segments, ELF program headers, and the interpreter path. Heap allocation flips between brk and mmap depending on malloc’s threshold; stacks always grow downward and threads get separate mmap’d stacks with guard pages. JIT-style code is placed via mmap/mprotect, bytes copied and executed successfully.
AI-written summary · about
chapters (13)
- 0:00Process address space intro
- 7:06Virtual vs physical memory
- 13:26Kernel vs user space
- 16:37Demo of memory layout
- 24:25Inspecting memory with pmap
- 33:13Heap memory region
- 36:45Stack memory region
- 41:25Debugging stack with GDB
- 47:50Environment variables
- 48:53Memory mapping segment
- 53:14Minimizing memory layout
- 55:44Thread stacks and guard pages
- 57:49Dynamic code execution
related talks
51mIntroduction to Memory Management in Linux
01h 00mFrom Program to Process - What Happens After the Compiler
26mLet's demystify memory
43mAddress Space Isolation for Enhanced Safety of the Linux Kernel
30mFlexible Paging in Linux: Per-process Page Size
50mBreaking Kernel Address Space Layout Randomization (KASLR) With Intel TSX
01h 04mThe Bits Between the Bits: How We Get to main()
01h 01mHow to start a program
