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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T20:22:54+00:00 2026-05-31T20:22:54+00:00

My C++ program exits with a std::logic_error and I’d like to track down the

  • 0

My C++ program exits with a std::logic_error and I’d like to track down the source line that caused it. How can I do that?

TBH, I’m using gdb, using g++ -g in order to add debug info. All I can get are these messages:

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application’s support team for more information.
terminate called after throwing an instance of ‘std::logic_error’
what(): basic_string::_S_construct null not valid

Catchpoint 1 (exception thrown), 0x0045ffa0 in __cxa_throw ()
(gdb) bt
#0  0x0045ffa0 in __cxa_throw ()
#1  0x004601e8 in std::__throw_logic_error(char const*) ()
#2  0x00502238 in typeinfo for std::__timepunct<wchar_t> ()
#3  0x004685f8 in std::runtime_error::what() const ()
#4  0x03210da8 in ?? ()
#5  0x002efbcc in ?? ()
#6  0x00468734 in std::domain_error::~domain_error() ()
#7  0x00000000 in ?? ()
(gdb)
  • 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-31T20:22:55+00:00Added an answer on May 31, 2026 at 8:22 pm

    The exception objects don’t carry any source information with them. However, they hopefully contain a useful message accessible using the what() member. Other than that you’d either have to use a debugger allowing to break when exceptions are thrown or set a break point into the constructor of std::logic_error. As long as exceptions are exceptional this works OK. It doesn’t work too well with code throwing exceptions in non-exceptional cases.

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

Sidebar

Related Questions

I have a function that I want to run whenever my program exits: void
I'd like the program to exit if the input number is less than 0,
Does there exist a free Windows software program that will help you generate regular
I'm writing a program that creates and edits directories and files in a file
I would like to save the programs settings every time the user exits the
I am writing an application program using swing. I need to exit from the
Greetings, my program exits with the code 3. No error messages, no exceptions, and
I have written this simple C program that changes the rotation file name. Eg:
This feels like a newbie issue, but I can't seem to figure it out.
I'm new to std::generate and have attempted to structure a program which uses it

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.