Thread: Issues with Valgrind...looking for something comparable

  1. #1
    Registered User
    Join Date
    Dec 2011
    Posts
    30

    Valgrind not showing line numbers of errors. Looking for alternative.

    I am wanting to use Valgrind, but it is not providing me enough information (such as line numbers) of where a problem exists in the code. I am not sure if it is because I am using Ubuntu (Xubuntu). The installation for Valgrind went fine.

    I am having the exact same output as this person:

    c - Valgrind not showing line numbers in spite of -g flag (on Ubuntu 11.10/VirtualBox) - Stack Overflow

    I have tried all of the suggestions on that page, and yet nothing has worked. I have tried the trace option as well which does not resolve the issue.

    Just like the person in the thread I am compiling with the -g option.

    I was wondering if there is a alternative to Valgrind that performs as well if not better.


    Thanks
    Last edited by Cron; 06-25-2013 at 09:26 AM.

  2. #2
    Registered User
    Join Date
    May 2009
    Posts
    4,183
    Verify you are not striping the debug values using the "-s" option or the strip command.
    Verify you are NOT using optimization; that might remove some info.

    Tim S.
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

  3. #3
    Registered User
    Join Date
    Dec 2011
    Posts
    30
    Quote Originally Posted by stahta01 View Post
    Verify you are not striping the debug values using the "-s" option or the strip command.
    Verify you are NOT using optimization; that might remove some info.

    Tim S.
    I have the makefile set to:

    Code:
    CFLAGS=-Wall -g
    
    clean:
         rm -f <progname>
    When I compile this is what is shown:

    Code:
    $make <progname>
    cc -Wall -g <progname> -o <progname>

    Then I use:
    Code:
    $./valgrind <progname>
    After this I am unable to tell where the errors are, and the output looks just like the example from the above link.

    I do not think I am striping or adding optimization unless those options are set in a config file or something.

  4. #4
    Registered User
    Join Date
    Jul 2012
    Posts
    51
    There seems to be issues with valgrind and some debian based distros [see note #2]. I tried compiling valgrind from source on xubuntu 13.04 and got this:
    Code:
    checking the GLIBC_VERSION version... unsupported version 2.17
    Maybe that is your problem?

    Try using another (stable) distro, since afaik ubuntu uses debian unstable.

  5. #5
    Registered User
    Join Date
    Dec 2011
    Posts
    30
    Quote Originally Posted by fnprintf View Post
    There seems to be issues with valgrind and some debian based distros [see note #2]. I tried compiling valgrind from source on xubuntu 13.04 and got this:
    Code:
    checking the GLIBC_VERSION version... unsupported version 2.17
    Maybe that is your problem?

    Try using another (stable) distro, since afaik ubuntu uses debian unstable.

    Is having Valgrind worth going through all the trouble? If so I will definitely do it. I can have Slackware up and running instead of xubuntu.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Using Valgrind
    By peripatein in forum C Programming
    Replies: 10
    Last Post: 05-24-2013, 03:48 PM
  2. Valgrind
    By anirban in forum C Programming
    Replies: 2
    Last Post: 10-26-2010, 10:07 PM
  3. Two comparable loop but different results...help please
    By spottedzebra in forum C Programming
    Replies: 1
    Last Post: 09-09-2010, 11:43 PM
  4. How Far Should You Go To Use Valgrind?
    By jeffcobb in forum C++ Programming
    Replies: 36
    Last Post: 02-25-2010, 05:02 PM
  5. Is valgrind always right?
    By g4j31a5 in forum Linux Programming
    Replies: 3
    Last Post: 07-16-2007, 10:39 PM