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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T07:00:43+00:00 2026-05-18T07:00:43+00:00

I am having a strange problem in my code. I have many asserts scattered

  • 0

I am having a strange problem in my code. I have many asserts scattered around the code and all have been working fine. Whenever an assert failed I got a message giving me line number of where the failure happened.
Today I wrote another assert in a function which loads a file. Just wanted to make sure that the fie existed. A very simple assert. Here is the relevant code:

//Check that the file exists and can be opened
FILE* f = fopen(filename, "rb");

#ifdef ASSERTIONS_ON
    assert(f!=NULL);//@problem For some reason while all other asserts work, this one just crashes the program without reporting line
#else
    if(f  == NULL)
        return MODEL_LOAD_FILENOTFOUND;
#endif

fclose(f);

I know that this does not help a lot but just wanted to showcase what my problem is. My OS is Windows 7. The compiler is GCC. The error message I get from Windows is the usual runtime error but without line reporting:

“The application has requested the Runtime to terminate it in an unusual way. Please contact the application’s support team for more information”

What could be the problem? What can possibly cause an assert failure to just request termination without reporting a line where it happens, while in every other case in the same code it works as intended? Thanks in advance for any assistance!

  • 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-18T07:00:44+00:00Added an answer on May 18, 2026 at 7:00 am

    You most likely have FUBAR’ed the stack somewhere before the assert executes.

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

Sidebar

Related Questions

I'm having a strange problem. I have the following code: dbg(condwait: timeout = %d,
I'm having a strange problem. I have to use GetPostBackEventRefence to force a Postback,
I'm having a strange problem here... I have an ASP.NET 3.5 application that has
I'm having a strange problem - I have about 14.5 million bitmap images, that
I'm having a strange problem in that I have php inserting text into a
I'm having a strange problem and not sure how to troubleshoot it. I have
I am having some strange problem and its really frustating me. I have a
I'm having a strange problem in Visual Studio 2008 where my Pending Checkins window
Having a strange issue with some C# code - the Getter method for a
I am having a strange DB2 issue when I run DBUnit tests. My DBUnit

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.