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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T02:36:15+00:00 2026-06-15T02:36:15+00:00

This has been puzzling me for the last several days! We have an application

  • 0

This has been puzzling me for the last several days!

We have an application where we’re running into a divide-by-zero. That application is purposely built to raise exceptions in such cases, with a call to the _controlfp_s function to change the masks on floating point exceptions.

Now, when running into a divide-by-zero on pretty much all of our machines, Visual Studio 2005 debugger breaks at the proper location within our source files. However, on 1 machine, the break location is all over the place and appears to be irrelevant to the actual cause of the break. So as a test, I built a simple C win32 program with just the following lines of code:

int main(int argc, char *argv[])
{
    float temp1, temp2, temp3;
    unsigned int control;

    _controlfp_s(&control, (_EM_UNDERFLOW + _EM_INEXACT, _MCW_EM);

    temp1=1.0;
    temp2=0.0;
    temp3=temp1/temp2;

    return 0;
}

On all those “good” machines, the code does break at temp3. However, on the bad machine, the code breaks at:

C:\Program Files (x86)\Microsoft Visual Studio 8\VC\crt\src\tidtable.c

function:

__set_flsgetvalue()

Looking at the registers as I step through the assembly code, everything looks fine until I hit the “fstp” instruction… then all the registers seem to be messed up (vs looking as expected on a good machine). When comparing the stack on the good vs bad, I also see stack entries on the bad machine, which I don’t see on the good one…

I’m skipping quite a few details here in an attempt to keep this first pass short… but I’ll add up more if someone is so kind as to try to help.

Notes:
OS Win7 x64, running all the latest VS2005 Service Packs. Compared to a similar (working) machine running same software and service packs. Getting same weird behavior when running on VS2010.

Thanks in advance.

  • 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-15T02:36:17+00:00Added an answer on June 15, 2026 at 2:36 am

    Wow!

    After showing this post to a friend… he found an intel document showing very similar symptoms about some of their cpu’s… I then found the exact document that applied to our specific CPU (intel i5-2500) here:

    http://www.intel.com/content/dam/www/public/us/en/documents/specification-updates/2nd-gen-core-deskt…

    See errata BJ1

    This pretty much exactly describes what I’m running into! I never (seriously) thought it would be an issue at THAT level!

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

Sidebar

Related Questions

The following problem has been puzzling me for a couple of days (nb: this
this one has been puzzling me for a few days now and I feel
This question has been puzzling me for a long time now. I come from
This has been a rather problematic issue on numerous occasions. We have alot of
This has been driving me crazy for the past few minutes I have a
I have been puzzling over a problem this morning with LinqToSQL. I'll try and
This has been asked several times, i know, but help me understand something. You
This has been bugging me lately. Say I have a base class Base. If
This has been driving me mad for a few days... Create a new Window-based
This one has been puzzling my for some time now. Let's imagine a class

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.