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 7500233
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T20:06:36+00:00 2026-05-29T20:06:36+00:00

I try to track down a memory leak in a c++ program using valgrind.

  • 0

I try to track down a memory leak in a c++ program using valgrind. The program is compiled with g++ and can be run without throwing any errors. Unfortunately valgrind alters the behaviour of my program in a way that it crashes after throwing a runtime-error. As this crash happens before reaching the relevant parts of the code, I have no chance to track down my memory leak.

The whole problem is illustrated by the attached console output.

myUser@computer:~$ ./myProgram input.xml

Processing...

Finished successfully...

----------------------
Hit Enter to continue...

myUser@computer:~$ valgrind --leak-check=yes --log-file=valgrindLog ./myProgram input.xml

Processing...
myProgram-error: Not working Polymorphism. Base class method called instead of derived class method. End-of-myProgram-error.
terminate called after throwing an instance of 'char const*'
Aborted
myUser@computer:~$ g++ -dumpversion
4.4.5
myUser@computer:~$ valgrind --version
valgrind-3.6.0.SVN-Debian
myUser@computer:~$ uname -r
2.6.35-30-generic
myUser@computer:~$ cat /etc/*-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=10.10
DISTRIB_CODENAME=maverick
DISTRIB_DESCRIPTION="Ubuntu 10.10"
  • 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-29T20:06:37+00:00Added an answer on May 29, 2026 at 8:06 pm

    It is likely that valgrind is changing the behavior of your code because you have a bug more serious than a memory leak. Bug free, portable code probably won’t throw exceptions just because you run it with valgrind.

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

Sidebar

Related Questions

I'm receiving errors from Gtk that I can't track down. Every time my mouse
Try as I might, I can't get a JNLP file to run locally (via
I had this working, made a change somewhere and now I can't track down
I'm helping to try track down and reproduce an issue with our web application
I use git svn to track a SVN repo. When I try to do
When I try to drill down into a cube in our client application, I
I am trying to track down an issue with a cURL call in PHP.
I've spent about three weeks on trying to track down this error, so forgive
I have been using Wireshark and I noticed that my plugin seem to track
I'm having problems with a slow memory leak in my mixed mode C++/CLR .NET

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.