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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:54:24+00:00 2026-05-23T00:54:24+00:00

I am having a bit of trouble understanding the Valgrind output: 1> Invalid write

  • 0

I am having a bit of trouble understanding the Valgrind output:

1> “Invalid write of size 4” is coming up in an auto-generated adb file,

  return (gnat_exit_status); -- this is line 314 of b~main.adb

and the gnat_exit_status is defined like this:

   gnat_exit_status : Integer;
   pragma Import (C, gnat_exit_status);

2> “Process terminating with default action of signal 11 (SIGSEGV)” Is this valgrind or my program? I get a return value of 139 from valgrind, but when running main by itself, i get 0, which is what i expect!

Full output of memcheck:

$ valgrind ./main
==2844== Memcheck, a memory error detector
==2844== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.
==2844== Using Valgrind-3.6.0.SVN-Debian and LibVEX; rerun with -h for copyright info
==2844== Command: ./main
==2844== 
==2844== Invalid write of size 4
==2844==    at 0x804BA2F: main (b~main.adb:314)
==2844==  Address 0xbee56294 is not stack'd, malloc'd or (recently) free'd
==2844== 
==2844== 
==2844== Process terminating with default action of signal 11 (SIGSEGV)
==2844==  Access not within mapped region at address 0xBEE56294
==2844==    at 0x804BA2F: main (b~main.adb:314)
==2844==  If you believe this happened as a result of a stack
==2844==  overflow in your program's main thread (unlikely but
==2844==  possible), you can try to increase the size of the
==2844==  main thread stack using the --main-stacksize= flag.
==2844==  The main thread stack size used in this run was 8388608.
==2844== 
==2844== HEAP SUMMARY:
==2844==     in use at exit: 0 bytes in 0 blocks
==2844==   total heap usage: 0 allocs, 0 frees, 0 bytes allocated
==2844== 
==2844== All heap blocks were freed -- no leaks are possible
==2844== 
==2844== For counts of detected and suppressed errors, rerun with: -v
==2844== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 19 from 8)
Segmentation fault
$ 

Any Help Appreciated 🙂

NWS

  • 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-23T00:54:24+00:00Added an answer on May 23, 2026 at 12:54 am

    I haven’t used Valgrind since college, but there are a few things i can give you to point you in the right way.

    First i know that how the prog is compiled makes a difference. You should use the -g flag and NOT use -O# (optimization). Additionally, I always ran Valgrind with -v so it outputs the most info (lots of info).

    Check out this page:
    http://www.redhat.com/magazine/015jan06/features/valgrind/

    bout half way down is a section titled “Before running valgrind” and “How to read the valgrind error report” will help you.

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

Sidebar

Related Questions

I'm having a bit of trouble understanding what the assignment operator is used for
I'm having a bit of trouble understanding how to send a 2D array to
So I'm having a bit of trouble understanding this example that was shown in
I'm having a bit of a trouble understanding how to fit a particular design
I am having trouble understanding the difference between a 32 bit processor and 64
I'm having some trouble understanding a bit of code. I've got 2 classes Company
I'm having a bit of trouble loading an html file in a WebView control
Im having a bit of trouble understanding the more complex system calls in assembly.
I am having a bit of trouble understanding this bug. Here is the code:
I am having a bit of trouble understanding how I will design a class.

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.