Ray's Knowledge Base
Unlock

Get a stack from a GCC 12 container crash with Valgrind, since the image has no gdb

RecipeVerified 5 Oct 2026Holds project: dftracer-utils
Recipe. When to use it, the steps, and what showed that they work.

When to use#

A segfault or bad read appears only in docker-test-gcc12.

Steps#

  1. Run the single failing test binary and case under valgrind inside the container: docker run --rm -v "$PWD":/work -w /work/build/build-docker-gcc12 dftracer-gcc12 bash -c "valgrind <test binary> <case>".
  2. Read the stack in the Valgrind report.

Evidence#

The dftracer-gcc12 image has no gdb but does have Valgrind (note from 2026-10-05).

Also found by searching

  • how to get a stack trace of a segfault in the GCC 12 container
  • dftracer-gcc12 image has no gdb
  • run valgrind on one failing test inside docker
  • debug a crash that only happens under GCC 12