Delphi 6编译器选项(Pentium安全FDIV) [英] Delphi 6 Compiler Options (Pentium-safe FDIV)

查看:64
本文介绍了Delphi 6编译器选项(Pentium安全FDIV)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从用户那里收到了MadExcept的崩溃报告.例外是无效的浮点运算.

I recieved a crash report from MadExcept from a user. The Exception was Invalid floating point operation.

不过,奇怪的是,调用堆栈在@FSafeDivide处死亡.

The odd part though is that the callstack dies at @FSafeDivide.

我做了一个Google,发现这是对某些未正确分割的奔腾芯片的检查.如果测试失败,则所有划分将以软件而非硬件完成.我在编译器设置中启用了Pentium-Safe FDIV选项.

I did a google and found out that this was a check for certain pentium chips which didn't do division correctly. If the test failed all the divisions would be done in software rather than hardware. I have the Pentium-Safe FDIV option turned on in my compiler settings.

这是否可能导致错误?我还在其他地方读到,作为异常类的EInvalidOp可能是堆栈溢出或类似的东西.

Could this have caused the error? I also read somewhere else that the EInvalidOp which was the exception class can be a stack overflow or something.

这是疯子的狙击手,除了要阅读的消息.

Here's a snipit of the mad except message if you want to read it.

异常类:EInvalidOp异常消息:无效的浮点运算.

exception class : EInvalidOp exception message : Invalid floating point operation.

thread $1014 (TMyBossThread):
00403509 M5b3.exe System                @FSafeDivide
008300c9 M5b3.exe MMyWorkerThread    317 TMyBossThread.Search
0073e87a M5b3.exe MMyManagerThread 186 TMyWorkerThread.Execute
008e8c17 M5b3.exe madExcept             HookedTThreadExecute
0042c150 M5b3.exe Classes               ThreadProc
00405354 M5b3.exe System                ThreadWrapper
008e8af9 M5b3.exe madExcept             CallThreadProcSafe
008e8b63 M5b3.exe madExcept             ThreadExceptFrame
created by main thread ($864) at:
0073e828 M5b3.exe MMyManagerThread 171 TMyManagerThread.Create

推荐答案

首先,除非实际上还有人在奔腾I早期的芯片上运行,否则您应该关闭该编译器选项.这是为了解决某些特定CPU的故障,自1995年以来销售的任何芯片都没有此问题.

First, unless you actually have people still running on early Pentium I chips, you should probably turn that compiler option off. It's to address a glitch in a few specific CPUs, and any chip sold since 1995 has not had the problem.

已经说过,如果您在一个分区中进行了无效的浮点运算,则该问题最有可能在您的代码中某个地方出现,尤其是因为FSafeDivide是应该产生正确结果的例程.看一下TMyBossThread.Search,第317行,看看它在这里的划分.还要看一下316行,因为堆栈跟踪有时会使您指向您所关注的那一行之后.

Having said that, if you've got an invalid floating point operation in a division, the problem's most likely in your code somewhere, especially since FSafeDivide is the routine that's supposed to produce the right results. Take a look at TMyBossThread.Search, line 317, and see what it's dividing there. Also look at line 316, since stack traces can sometimes point you to the line after the one you care about.

这篇关于Delphi 6编译器选项(Pentium安全FDIV)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆