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

  • Home
  • SEARCH
  • 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 8675173
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T19:53:13+00:00 2026-06-12T19:53:13+00:00

I have declared two variables (one global and other local) in a simple C

  • 0

I have declared two variables (one global and other local) in a simple C program, apart from two arrays having different sizes data. I cause a buffer overflow using strcpy() routine before making a return 0; call. And I see segmentation fault error on the terminal screen.

I know that after receiving this SIGSEGV signal, system takes a core dump of process memory and terminates that process, but does system do clean-up (zero-out) of stack/heap memory and other sections like BSS segment, text segment etc?

I guess, in normal termination of a process, system does clean-up (zero-out) of memory but I am not so sure.

I am using Ubunutu 10.12 and gcc to run the program.

  • 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-12T19:53:15+00:00Added an answer on June 12, 2026 at 7:53 pm

    When a Linux process terminates (either normally, by calling the _exit syscall, e.g. by returning from main, or thru a signal like SIGSEGV), its address space ceases to exist.

    In practice, the kernel does not zero the former process’ memory, it just add the relevant pages to some set of free pages and will reuse these pages later. When reusing a page it will clear it or fill it with appropriate content. All this happens inside the kernel, applications only see appropriately filled (or cleared) pages.

    You should read more about virtual memory and I invite you to read some good advanced unix programming and advanced linux programming books.

    Processes see only virtual memory, their address space is set up thru the execve(2) syscall and may be changed, e.g. with mmap(2) syscall.

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

Sidebar

Related Questions

I have two images in my drawable folder, one called Red and the other
Here's the deal. I've had two identical global variables in two different .c files,
I have declared some local variable in one function like this: void* thread_function (void*
I have two tables: Sales.SalesOrderHeader(SalesOrderID(PK), SalesOrderNumber, Status,..) Sales.SalesOrderDetail(SalesOrderID(PK,FK), ..) I've declared a variable @numdetail
I have declared two string buffers like, private StringBuffer buf = new StringBuffer(1024); private
In my xml file, I have declared two imageview and later I add image
I have two methods declared public void MethodA(object o, Action<string> action) { } public
I have two domains declared in my app. class Posts { String title String
I have two classes - MyBaseClass and BaseClassContainer - that are declared like such:
D has two types of constness: immutable variables are ones that were declared immutable,

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.