Conditional jump depends on uninitialised value C/C++ Origin: Application & API OSI layer 7 · Application Last updated 28 Nov 2026

valgrind: Conditional jump or move depends on uninitialised value(s)

A branch used a value that was never set.

Exact message you may see Conditional jump or move depends on uninitialised valueuninitialised value(s)
Seen on: C/C++ Linux

Meaning

Valgrind reports that a branch depended on memory that was never written. The value may be random on one run and zero on another, which makes the bug appear intermittent.

Common causes

  • Uninitialised local
  • Uninitialised struct field
  • Uninitialised struct member read in a condition
  • Partly filled buffer

⚡ Quick fix

  1. Initialise
  2. Zero allocations
  3. Run with --track-origins=yes to find where the memory came from
  4. Initialise variables at declaration

Detailed fix by platform

Linux

  1. valgrind --track-origins=yes ./app

How to diagnose

  1. Origin — Where?
  2. Recent change — Did it start after a deploy, upgrade, or configuration change? Compare with the last working version.

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Application & API. Errors that are often confused with or caused by this one (click to open):

alloc-dealloc-mismatch — AddressSanitizer: alloc-dealloc-mismatch (malloc vs operator delete) (C/C++)alloc-dealloc-mismatchcall of overloaded is ambiguous — C++: error: call of overloaded 'f(int)' is ambiguous (C/C++)call of overloaded is…cannot declare variable to be of abstract type — C++: error: cannot declare variable 'x' to be of abstract type 'Shape' (pure virtual functions) (C/C++)cannot declare variab…Invalid read of size — valgrind: Invalid read of size 4 / Invalid write — Address is 0 bytes after a block of size (C/C++)Invalid read of sizemay be used uninitialized — C/C++: warning: 'x' may be used uninitialized in this function [-Wmaybe-uninitialized] (C/C++)may be used uninitial…reference to is ambiguous — C++: error: reference to 'X' is ambiguous (using namespace std conflicts) (C/C++)reference to is ambig…use-of-uninitialized-value — MemorySanitizer: use-of-uninitialized-value (C/C++)use-of-uninitialized-…Condition…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.