Skip to content
tyfkda edited this page Feb 13, 2025 · 7 revisions

OS, environment related

  • Red Zone : 128 bytes safe stack area in leaf function

Tools

Csmith

csmith-project/csmith: Csmith, a random generator of C programs

  • Generate random C program. It can use to detect compiler bugs.
# Mac
export CSMITH_PATH=$HOMEBREW_CELLAR/csmith/2.3.0/include/csmith-2.3.0
  • csmith > tmp.c
  • cc -I $CSMITH_PATH tmp.c
Trobules
  • Infinite loop
    • int16_t p_33; for (p_33 = 8; (p_33 != (-12)); p_33 = safe_sub_func_uint8_t_u_u(p_33, 1)) ...
    • Adding --no-safe-math solves the problem,
    • but causes floating exception on x86-64

//

Clone this wiki locally