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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T06:50:45+00:00 2026-06-03T06:50:45+00:00

I have C/C++ code which is giving a segfault. It is compiled using gcc/g++

  • 0

I have C/C++ code which is giving a segfault. It is compiled using gcc/g++ on a RH Linux Enterprise server. I used the Valgrind memory checker on the executable with:

valgrind --tool=memcheck --leak-check=full --show-reachable=yes

I get this as one of Valgrind’s output messages:

==7053== Invalid read of size 1
==7053==    at 0xDBC96C: func1 (file1:4742)
==7053==    by 0xDB8769: func2 (file1.c:3478)
==7053==    by 0xDB167E: func3 (file1.c:2032)
==7053==    by 0xDB0378: func4 (file1.c:1542)
==7053==    by 0xDB97D8: func5 (file1.c:3697)
==7053==    by 0xDB17A7: func6 (file1.c:2120)
==7053==    by 0xDBD55E: func7 (file2.c:271) 

==7053==  Address 0x1bcaf2f0 is not stack'd, malloc'd or (recently) free'd 

I read that to mean that my code has accessed an invalid memory location it is not allowed to.

My questions:

  1. How do I find out which buffer memory access has been invalid, and which of the functions above has done that.

  2. How can I use the address 0x1bcaf2f0, which valgrind is saying is invalid. How can I find the symbol (essentially, the buffer name) at that address? Memory map file, any other way.

  3. Any other general pointers, valgrind options or other tools for using Valgrind to detect memory (heap/stack corruption) errors?

  • 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-06-03T06:50:46+00:00Added an answer on June 3, 2026 at 6:50 am

    Ad 1: In your example, that’d be func1 in line file1:4742 (1). The following functions are the stack trace. Analyzing that line should lead you to the invalid memory access.

    Ad 2: Try splitting it into multiple simpler lines in case it’s too complex and not obvious which exact call is causing the warning.

    Ad 3: memcheck is the quintessential valgrind tool for detecting errors with heap memory. It won’t help for stack corruption though.

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

Sidebar

Related Questions

I have some code which works fine on one server but is giving a
I have this code in C++ which is giving weird output: #include<iostream> using namespace
I have the following code which is giving me a Method POST, Status (canceled)
I have code which as been working against an older Active Directory server and
I have code which performs query on Jboss server. It has JNDI based datasource
Hi I have code which sets up a basic client to server scenario and
I am customizing my table cells. I have this code (simplified) which is giving
I have used ajax in the code which works perfectly and give me json
I have tried to simplify and annotate the code which is giving me a
I have some code which is using delegate method of jquery. e.g.: $(document).delegate('.forImg','dblclick',function(event){. .

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.