On Jan 20, 2013, at 3:50 PM CST, Nick Overdijk wrote:

> I have a nice stacktrace from some memory error in valgrind, and it fails to 
> print the source file + line number somewhere. Here's the trace:
> 
> ==63113== Conditional jump or move depends on uninitialised value(s)
[…]
> ==63113==  Uninitialised value was created by a stack allocation
> ==63113==    at 0x10002D7D4: run_image(std::__1::basic_string<char, 
> std::__1::char_traits<char>, std::__1::allocator<char> >, 
> std::__1::basic_string<char, std::__1::char_traits<char>, 
> std::__1::allocator<char> >, std::__1::basic_string<char, 
> std::__1::char_traits<char>, std::__1::allocator<char> >, 
> std::__1::basic_ostream<char, std::__1::char_traits<char> >&) (in 
> /Users/nick/Documents/Code/diag/REPO/BIN/stage1)
[…]
> This is on my Mac, running OSX 10.7, running valgrind 3.8.1
> 
> I was wondering why atos can give me source + line number and valgrind can't.

How exactly are you building the source file that contains this particular 
line?  I've encountered some weirdness if I do a direct ".c"-->"a.out" build 
without first creating ".o" files.  That is:

----8<----
gcc foo.c
dsymutil a.out
----8<----

will NOT show file/line info in valgrind, but:

----8<----
gcc -c foo.c
gcc foo.o
dsymutil a.out
----8<----

will.  This sometimes happens even if gdb can show me the correct debug info.  
I never thought too much of it and assumed it was Darwin's fault, since the 
".dSYM" system is such a bad idea for other reasons.  I suppose that it could 
be a Valgrind issue though...

-Dave



------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d
_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to