|
From: John D. <jdi...@pr...> - 2012-12-20 23:11:10
|
Hello, I'm trying to debug a memory error. memcheck has helpfully located an error and provided a stack trace showing where the error is occurring. However, I really want the line number of my function that the error is occurring in, but I can't find it. $ valgrind --tool=memcheck --trace-children=yes ./myApp (myApp top secret output omitted) ... ==26269== Memcheck, a memory error detector ==26269== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al. ==26269== Using Valgrind-3.6.1 and LibVEX; rerun with -h for copyright info ==26269== Command: ../starfactory/starfactory ==26269== ==26269== Warning: set address range perms: large range [0x407a58000, 0x7f8147000) (defined) ==26330== Thread 2: ==26330== Conditional jump or move depends on uninitialised value(s) ==26330== at 0x803CA1: boost::multi_index::detail::ordered_index<boost::multi_index::composite_key<...(remainder of my top secret type arguments omitted) (composite_key.hpp:381) ==26330== by 0x7EED1D: ...about 4000 characters of my top secret arguments later we are still going..., boost::multi_index::detail::ordered_index< ... (remainder of valgrind output omitted) Unfortunately, on that last line starting with "by 0x7EED1D", the line appears to be truncated before the line number in the file is specified. Is there a way to increase the buffer or whatever so that this line is not truncated? Is there a work around to this? I tried the "--db-attach=yes" argument, hoping that I could just attach a debugger and see what line it is on that way. However, I was never prompted to attach a debugger with this flag. Are warnings supposed to prompt you to attach a debugger? Maybe it failed because the warning happens in a forked child process and not the original process? Thanks for your time, John PS I know that it is ridiculous that my function arguments take over 4000 characters to write out. I'm sorry. -- John DiMatteo Princeton Consultants, Inc. 2 Research Way Princeton, NJ 08540 609.987.8787 x250 |
|
From: <pa...@fr...> - 2012-12-21 11:40:32
|
----- Original Message -----
> Hello,
>
> However, I really want the line number of my function that the error
> is occurring in, but I can't find it.
>
> $ valgrind --tool=memcheck --trace-children=yes ./myApp
> (myApp top secret output omitted)
[snip]
> Unfortunately, on that last line starting with "by 0x7EED1D", the
> line
> appears to be truncated before the line number in the file is
> specified.
>
> Is there a way to increase the buffer or whatever so that this line
> is
> not truncated?
Hi
Usually when there is a limit, there's a way to change the limit. I think that it's here
static void printIpDesc(UInt n, Addr ip, void* uu_opaque)
{
#define BUF_LEN 4096
static UChar buf[BUF_LEN];
in
coregrind/m_stacktrace.c
Download the Valgrind source, modify BUF_LEN to something larger, build Valgrind and see if it works.
A+
Paul
|