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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T11:19:32+00:00 2026-06-18T11:19:32+00:00

How do exceptions work from an Operating System’s perspective? Coming from C++, I can

  • 0

How do exceptions work from an Operating System’s perspective?

Coming from C++, I can understand exceptions from a programmer’s perspective.
When an exception gets thrown, the stack begins to unwind, and each activation record has the opportunity to catch and handle the exception.

But whose responsibility was it to throw the exception in the first place?

  1. Is it the Operating System that sends a trigger to the process
    telling it to enter it’s “exception handling state?”
  2. Is the
    process invoking and handling exceptions in it’s own program space,
    unpronounced to the OS?

Here are two crashing programs that illustrate my uncertainty.

int main(){

    int i = 1/0; //did the OS tell the process to end?

    return 0;
}

#include <exception>

int main(){

    throw 11;  //did the process tell the OS it needs to end?

    return 0;
}
  • 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-18T11:19:33+00:00Added an answer on June 18, 2026 at 11:19 am

    C++ exceptions are part of the language, defined by the language standard, and implemented by the compiler and runtime library. There are other exceptions that are detected by the CPU, like divide by zero or dereferencing a NULL pointer, both are examples of Undefined Behavior in the language standard. Those are faults in processor terminology and on x86 for example trigger a fault handler which is then serviced by the OS. The OS can then choose to report that fault to the process that caused it, on Unix this is done with signals. If your process has installed a signal handler for SIGSEGV for example, it can handle the fault generated by the CPU when the process dereferences a NULL pointer… that mechanism is separate from the C++ exceptions defined by the language.

    In your example, when a C++ program throws an exception this is entirely handled by the compiler generated code and the language runtime library, there is no kernel call necessary and there is no hardware fault generated by the processor.

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

Sidebar

Related Questions

Related: Cannot view exceptions thrown during Tomcat startup from Eclipse I have Eclipse setup
I am not sure if Exceptions work the same way in each language, but
I'm trying to validate my php form using exception, but somehow it doesn't work.
How can I handle exceptions in a linq query? For example if I have
I'm experiencing OutOfMemory exceptions in my application, when fetching from the database. It is
I have a OdbcDataReader that gets data from a database and returns a set
I have a bug. In WinForm .NET2.0 application my HeavyFunction can be called from
I want to play MP3 file downloaded from the web using NET provided System.Media.SoundPlayer
I am having problems getting Microsoft Charting: System.Web.DataVisualization.dll To work in the Medium Trust
In an application I work on, any business logic error causes an exception 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.