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

The Archive Base Latest Questions

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

I am getting segmentation fault despite having a signal handler for SIGSEGV . The

  • 0

I am getting segmentation fault despite having a signal handler for SIGSEGV. The first time data is written to protected memory, I can see that signal handler is called, but before the signal handler exits, segmentation fault appears.

What can be causing it? Isn’t my SIGSEGV handler supposed to catch all the segmentation faults?

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

    I could see where if the segmentation fault is related to the stack pointer accessing memory where it’s not allowed by the OS, then you won’t be able to make any calls with the current stack pointer for your process … that includes calls to signal handlers. In other words the compiler-created prologue for your signal handler function has to setup an activation record on the stack … if the stack pointer itself is invalid, then that won’t be possible. One way this could happen is by overflowing a memory array that then writes-over the activation record for the currently executing function.

    You can define another area of memory to be used as a stack for your signal handlers though sigaltstack(), and then setting the SA_ONSTACK option in sigaction() for the signal. This might be something you might want to try.

    Finally, you could also run into issues if you’re using non-async-safe functions or somehow are accessing pointers or memory that is outside the memory segment allotted to your process by the OS in your signal handler.

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

Sidebar

Related Questions

I'm getting a segmentation fault the first time I call malloc() after I protect
Im getting segmentation fault from pthread_mutex_lock, heres my backtrace: Program received signal SIGSEGV, Segmentation
I have a process in Linux that's getting a segmentation fault. How can I
I can't get to know why do I keep getting this segmentation fault in
I have a C program below written on UNIX. I am getting segmentation fault.
Can anyone explain why I am getting segmentation fault in the following example? #include
When and how sqlstm.sqpadto = sqlstm.sqadto can cause segmentation fault? I am getting segmentation
I am getting a segmentation fault while running this code. I can't work out
I am getting segmentation fault in this code but i cant figure out why.
I am getting a segmentation fault with the following code after adding structs to

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.