Home Valgrind shows question marks
Reply: 0

Valgrind shows question marks

user1904 Published in June 25, 2018, 7:54 am

I have compiled a program using Code::Blocks. I have turned on "produce debugging symbols" under the "Debug" target, and also turned off "strip all symbols..." But when I run the program with Valgrind I get question marks in the output:

$ valgrind --leak-check=yes --track-origins=yes --log-file=valgrind_output.txt

==3766== Memcheck, a memory error detector
==3766== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==3766== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
==3766== Command: /home/xxxxxx/bin/myprg
==3766== Parent PID: 3209
==3766== Warning: client switching stacks?  SP change: 0xffefff978 --> 0xffed13da0
==3766==          to suppress, use: --max-stackframe=3062744 or greater
==3766== Invalid write of size 4
==3766==    at 0x40892B: ??? (in /home/xxxxxx/bin/myprg)
==3766==    by 0x40275C: ??? (in /home/xxxxxx/bin/myprg)
==3766==    by 0x56FB82F: (below main) (libc-start.c:291)
==3766==  Address 0xffed13ddc is on thread 1's stack
==3766== Invalid write of size 4
==3766==    at 0x408931: ??? (in /home/xxxxxx/bin/myprg)
==3766==    by 0x40275C: ??? (in /home/xxxxxx/bin/myprg)
==3766==    by 0x56FB82F: (below main) (libc-start.c:291)
==3766==  Address 0xffed13dd4 is on thread 1's stack

What is the meaning of this output, and how do I find the piece of code that is causing this error?

Update: Solution

The problem was with Code::Blocks. It is necessary to correctly configure the project build options for the whole project and not just the "Debug" target. So all flags except "-std=c++11" were removed from the "whole project" options, so nothing was overriding the "Debug" options. Also the linker ".o" files need to be deleted when the options are changed, to force Code::Blocks to rebuild the executable.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.335501 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO