客户在使用我们的应用程序时收到 R6002 运行时错误

发布于 2024-10-13 05:03:01 字数 801 浏览 6 评论 0原文

我们有一个使用 Visual C++ 2005 构建的应用程序,一位客户报告说他遇到了以下运行时错误:

Microsoft Visual C++ 运行时库
运行时错误!
程序:[我们应用程序的路径]
R6002
- 未加载浮点支持

根据 Microsoft (在此页面),可能的原因是:

  • 机器没有 FPU(本例中没有:客户有 Intel Core 2 Duo CPU,我还没有看到自 486SX 以来没有 FPU 的机器)
  • printf 或 scanf 与浮点格式规范一起使用,但程序中没有 FP 变量(我们的应用程序包含 FP 变量,但我很确定我们从未将 printf 或 scanf 与 FP 格式一起使用)
  • 与 FORTRAN 有关(我们的应用程序中没有 FORTRAN 代码)

此外,错误是在他们使用我们的应用程序时发生的(特别是在他们选择要处理的文件之后),而不是在应用程序启动时发生。

我意识到这是一个不太可能的事情,但是以前有人在任何地方见过这样的事情吗?谷歌并没有提供任何帮助(有很多未经证实的说法称这是某种病毒感染的症状,但除此之外几乎没有什么)。

如有任何建议,我们深表感谢:-)

We have an application built with Visual C++ 2005, and one customer has reported that he's getting this runtime error:

Microsoft Visual C++ Runtime Library
Runtime Error!
Program: [path to our application]
R6002
- floating point support not loaded

According to Microsoft (on this page), the possible reasons for this are:

  • the machine does not have an FPU (not in this case: the customer has an Intel Core 2 Duo CPU and I haven't seen a machine without FPU since the 486SX)
  • printf or scanf is used with a floating-point format specification but there are no FP variables in the program (our app contains FP variables but I'm pretty sure we never use printf or scanf with FP formats)
  • Something to do with FORTRAN (no FORTRAN code in our app)

Also, the error is occurring while they're using our application (specifically, just after they select a file to be processed), not when the application starts up.

I realise this is a long shot, but has anyone seen anything like this anywhere before? Google was pretty unhelpful (there were lots of unsupported claims that it was a symptom of some kind of virus infection but very little apart from that).

Any suggestions gratefully received :-)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

错々过的事 2024-10-20 05:03:01

您正在链接 CRT 的静态版本吗?如果是这样,则需要在调用 printf() 的二进制文件中包含浮点变量。并且这些变量必须被真正使用(即没有被编译器优化掉)。

另一种可能性是 CRT 初始化和使用这些 FP 例程的代码之间的竞争,但这很难产生。

Are you linking a static version of the CRT? If so, you need to have floating point variables in the binary that calls printf(). And these variables have to be really used (i.e not optimized out by the comppiler).

Another possibility is a race between the CRT initialization and the code that uses these FP routines, but that would be hard to produce.

阪姬 2024-10-20 05:03:01

R6002 可能是由 printf 尝试打印包含百分号的字符串引起的。
此类 printf 失败的最可能根本原因是操纵任意文件并打印其名称的程序。让我惊讶的是,真的有人在文件名中添加百分号! (是的,我意识到这在技术上是合法的。)

R6002 can be caused by printf trying to print a string that contains a percent-sign.
Most likely root cause of such printf failure is a program that manipulates arbitrary files and prints their names. Amazing to me, there really ARE people who put percent-signs in file names! (Yes, I realize that is technically legal.)

流年里的时光 2024-10-20 05:03:01

printf("%f\n", (float)rand() / RAND_MAX);

我在使用 VS2010 命令行 cl 编译的程序中遇到了相同的运行时错误。
报告的错误在没有(浮动)转换的情况下发生,并在我添加它时消失。

printf("%f\n", (float)rand() / RAND_MAX);

I experienced the same runtime error in a program compiled with VS2010 command line cl.
The reported error occurred without the (float) cast and disappeared when I added it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文