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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T19:13:33+00:00 2026-06-07T19:13:33+00:00

I am reading the book – C Interfaces and Implementations by David Hanson. This

  • 0

I am reading the book – “C Interfaces and Implementations” by David Hanson. This exercise questions seems interesting and am unable to find a solution:

On some systems, a program can invoke a debugger on itself when it has
detected an error. This facility is particularly useful during
development, when assertion failures may be common.

Can you provide a short example on how to invoke a debugger.

void handle_seg_fault(int arg)
{
    /* how to invoke debugger from within here */
}

int main()
{
    int *ptr = NULL;
    signal(SIGSEGV, handle_seg_fault);
    /* generate segmentation fault */
    *ptr = 1;
}
  • 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-07T19:13:35+00:00Added an answer on June 7, 2026 at 7:13 pm

    Elaborating on Christian.K’s comment, fork()ing a debugger in the face of something like a SIGFPE or SIGSEGV might not be the best of ideas, because…

    1. your program is potentially corrupt to begin with, making the fork() unsafe;
    2. you might want to use something different for debugging than what the program has hardcoded;
    3. the average application user does not know how to handle a debugger;
    4. anyone competent with a debugger will usually prefer the coredump over the auto-invoked debugger.

    A coredump that I can copy to a testbed beats a debugger instance at my customer’s workplace any time of the day. A debugger interface makes for a lousy end-user error message.

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

Sidebar

Related Questions

I'm reading this book on C# and .NET and I'm learning a bunch of
I am reading a book which mentions this If the compiler knows every use
I mentioned in one of my earlier questions that I'm reading book C++ Coding
While reading a book, i came across this statement: The methods of an object
I'm reading a book to read and it covers this below example. somelist =
So I am reading this book titled Java Concurrency in Practice and I am
I am reading this book called Java Concurrency in Practice and the author gives
I am reading a book in which author used a code like this public
So I was reading this book where it says that if I create a
I was reading this book Art of Exploitation, which is kinda good book and

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.