Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1064263
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T18:54:24+00:00 2026-05-16T18:54:24+00:00

Valgrind is showing an uninitialised value of size 8 error. And occasionally, the below

  • 0

Valgrind is showing an uninitialised value of size 8 error.
And occasionally, the below conditional jump on uninitialised value error.

All I’m doing is printing a formatted string using the stdc++ library that comes with gcc
and the built in vsnprintf.

This is inside a method called format which is part of a custom string class.
What now? everything looks correct. Error seems to be inside _itoa.c. But all I can think of to do on the outside is not use this function, which is not very possible!

==4229== Memcheck, a memory error detector
==4229== Copyright (C) 2002-2009, and GNU GPL'd, by Julian Seward et al.
==4229== Using Valgrind-3.6.0.SVN-Debian and LibVEX; rerun with -h for copyright info
==4229== Command: ./test
==4229== 
==4229== Use of uninitialised value of size 8
==4229==    at 0x54A3DF1: _itoa_word (_itoa.c:196)
==4229==    by 0x54A5138: vfprintf (vfprintf.c:1613)
==4229==    by 0x555C74F: __vsnprintf_chk (vsnprintf_chk.c:65)
==4229==    by 0x407E57: myString::format(char const*, ...) (stdio2.h:79)
==4229==    by 0x419D14: ID::toString() (id.cpp:151)
==4229==    by 0x41D03D: main (test.cpp:126)
==4229== 
==4229== Conditional jump or move depends on uninitialised value(s)
==4229==    at 0x54A3DF8: _itoa_word (_itoa.c:196)
==4229==    by 0x54A5138: vfprintf (vfprintf.c:1613)
==4229==    by 0x555C74F: __vsnprintf_chk (vsnprintf_chk.c:65)
==4229==    by 0x407E57: myString::format(char const*, ...) (stdio2.h:79)
==4229==    by 0x419D14: ID::toString() (uuid.cpp:151)
==4229==    by 0x41D03D: main (test.cpp:126)
==4229== 
==4229== 
==4229== HEAP SUMMARY:
==4229==     in use at exit: 0 bytes in 0 blocks
==4229==   total heap usage: 6 allocs, 6 frees, 1,340 bytes allocated
==4229== 
==4229== All heap blocks were freed -- no leaks are possible
==4229== 
==4229== For counts of detected and suppressed errors, rerun with: -v
==4229== Use --track-origins=yes to see where uninitialised values come from
==4229== ERROR SUMMARY: 3 errors from 2 contexts (suppressed: 4 from 4)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T18:54:25+00:00Added an answer on May 16, 2026 at 6:54 pm

    This is the place in the C library where it is actually looking at your number in order to format it as a string, and it indicates that the number you are formatting came from uninitialized storage.

    Add the valgrind option --track-origins=yes for more details on the origin of the uninitialized value.

    Because it is common to copy around uninitialized memory, e.g. padding in structures, valgrind tracks copying of uninitialized values and does not complain until the point where the value is actually used in a way that might affect your program’s externally-visible behavior. This can make it confusing to determine the original source of the uninitialized value, since it may have been copied several times before anything else was done with it. The option --track-origins=yes tracks additional information to pinpoint the origin of the uninitialized value, so that this can be displayed in the event that the uninitialized value ends up being used.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Valgrind reports error Invalid read of size 8 in the following code. I have
For some reason valgrind keeps throwing the following error: ==6263== Invalid read of size
I've tried running valgrind (memcheck and massif) on an app I wrote, but all
I'm looking for a runtime memory debugger, capable of showing memory usage (not just
valgrind-3.6.0.SVN-Debian gcc (Ubuntu/Linaro 4.4.4-14ubuntu5) 4.4.5 2.6.35-22-generic I am using valgrind to detect memory errors
How can I compile Valgrind on Snow Leopard?
When running Valgrind's memcheck tool, I often get many hundreds of thousands (or more,
When I use this valgrind --leak-check=yes ./Main I have about 185236 errors. It said
When I use this valgrind --leak-check=yes ./Main I have about 185236 errors. It said
To give a quick overview of the program 1.) Opens connection to a socket

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.