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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T03:49:20+00:00 2026-05-14T03:49:20+00:00

The following C++ program crashes on my Windows XP machine with a message Abnormal

  • 0

The following C++ program crashes on my Windows XP machine with a message “Abnormal program termination”

class Thing {};
int main()
{    
    for (;;) new Thing();    
}

I would say it’s an out of memory problem, except I’m not sure Windows gets near the limit. Is it Windows killing it on purpose? If so, how does it decide?

  • 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-14T03:49:21+00:00Added an answer on May 14, 2026 at 3:49 am

    You’re right it’s an out-of-memory problem that causes your program to end. But it’s not Windows that decides to end it with “Abnormal program termination”. It’s the C++ runtime (“msvcrt*.dll” on Windows) that raises the std::bad_alloc exception when new Thing fails to allocate memory.

    You can verify that with a simple change:

    #include <exception>
    #include <iostream>
    class Thing {};
    int main()
    {
        try
        {    
            for (;;) new Thing();    
        }
        catch(std::bad_alloc e)
        {
            std::cout << "ending with bad_alloc" << std::endl;
        }        
    }
    

    This will end the program normally when the program is out of memory. If you don’t catch that exception, the unhandled exception will be handled by the C++ runtime, thus creating that famous “Abnormal program termination” message (or something similar).

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

Sidebar

Ask A Question

Stats

  • Questions 501k
  • Answers 501k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer greensound.equals("gsone") May 16, 2026 at 2:19 pm
  • Editorial Team
    Editorial Team added an answer Here's one way: Public Function ClearCellsBelowValuesRange() Dim Rng As Excel.Range,… May 16, 2026 at 2:19 pm
  • Editorial Team
    Editorial Team added an answer There are at least two approaches you could use. One… May 16, 2026 at 2:19 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

Does the following program invoke Undefined Behaviour in C? int main() { printf(Printf asking:
I made the following program #include <iostream> #include <typeinfo> template<class T> struct Class {
When an application crashes on Windows and a debugger such as Visual Studio is
My program has a trouble: When GC perform garbage collection,my program always crashes at
In the following program am giving name as don so the command will search
I have the following program. However, I can't understand why I have to pass
I wrote an application for Windows 7 using C# and VS2008 and it runs
On a customer machine (WinXP SP2) to which I have no access, I have
I'm stuck with the following bit of code. NSString *gridRef = [[NSString alloc] initWithFormat:
this might be a bit long so my apologies. consider the following code (i've

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.