fftw mingw 预编译二进制文件和 vs 2010 的内存损坏?

发布于 2024-11-08 16:32:53 字数 315 浏览 4 评论 0原文

我想知道是否有人从未使用与 Visual Studio 2010 项目链接的预编译 mingw fftw 二进制文件遇到过内存损坏问题。奇怪的是,即使没有调用任何 fftw API,仅 fftw libs 链接(由 lib /def:libfftw3-3.def 生成,如 fftw doc 所解释)会给我的项目带来麻烦。 好吧,我将按照作者的建议尝试在 vs 2010 中从头开始编译 fftw,但我很好奇仅仅链接 lib 会导致副作用。据我所知,这似乎不是我们的 C++ 代码的问题...

一些 env.详细信息:win 32 位,vs 2010 中的非托管 c++ 项目

谢谢!

I would like to know if anyone has never experienced memory corruption problems using precompiled mingw fftw binaries linked with visual studio 2010 project. The strange thing is that just the fftw libs linking (generated with lib /def:libfftw3-3.def as explained by fftw doc) brings troubles in my project even if none of fftw API gets invoked.
Well, I'll try compiling fftw from scratch in vs 2010 as the author suggests, but I'm curious about the fact that just linking the lib can cause side effects. As far as I can tell, it does not seem a problem of our c++ code...

Some env. details: win 32 bits, unmanaged c++ project in vs 2010

Thank you!

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

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

发布评论

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

评论(2

天气好吗我好吗 2024-11-15 16:32:53

我不知道 fftw 库是什么,所以我不确定它可能具体做什么来导致不稳定。 DLL 在加载时有可能执行代码,因此您没有主动调用它并不一定意味着它没有执行任何操作。

但是,MinGW 链接到随 Windows 系统分发的 msvcrt.dll 运行时,而在 VS 2010 中使用 DLL 运行时的正常构建将链接到 MSVCRT100.DLL。混合运行时 DLL 是一个可能导致神秘问题的领域,特别是如果从一个运行时进行分配并在另一个运行时释放(或者甚至在另一个运行时使用,我相信如果涉及调试运行时)。

您最好的选择可能是尝试使用 VS 2010 重新编译 fftw 库(我假设源代码可用 - 希望使用 MSVC 重建不会太困难)。

可以说服 VS 2010 使用 msvcrt.dll 运行时(微软就是这样做的),但细节并不明显,我的注释在其他地方。

I don't know that the fftw library is, so I'm not sure what it might specifically be doing to cause instability. It's possible for a DLL to execute code when it's loaded, so the fact that you're not actively calling it doesn't necessarily mean it's not doing anything.

However, MinGW links to the msvcrt.dll runtime that's distributed with the Windows system, while a normal build using the DLL runtime in VS 2010 will link against MSVCRT100.DLL. Mixing runtime DLLs is an area that can cause mysterious problems, in particular if allocations are made from one runtime and freed in another (or even used in another I believe if the debug runtime is involved).

Your best bet might be to try to recompile the fftw library with VS 2010 (I assume the source is available - hopefully it's not too difficult to rebuild with MSVC).

It's possible to convince VS 2010 to use the msvcrt.dll runtime (Microsoft does it), but the details are non-obvious and my notes are elsewhere.

内心旳酸楚 2024-11-15 16:32:53

fftw 确实做了一些大量的代码生成/分析/CPU 定位;

显然他们在第一次运行时就这样做了。因此,可能存在

  1. 一个错误,阻止初始分析运行成功(尝试以管理员身份运行一次?)
  2. 来自不兼容安装的剩余配置;我猜想 fftw 将进行健全性检查以验证找到的配置是否与当前运行的架构匹配,但如果该过程中出现问题,您可以从查找并手动删除该配置数据中受益,

抱歉,我不记得具体情况(地点)

fftw does do some hefty code generation/profiling/CPU targeting;

Apparently they do this the first time it's run. So there may be

  1. a bug that prevents the initial profiling run to succeed (try to run as admin for one time?)
  2. a leftover config from an incompatible installation; I gues fftw will do a sanity check to verify that the config found matches the currently running architecture, but in case something is amiss in that process, you could benefit from finding and manually deleting that config data

Sorry I donot remember specifics (locations)

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