我正在使用 Aubio 库启动一个项目“ rel="nofollow">openFrameworks,所以我将 Aubio 演示中的代码复制到我的项目中,进行修改等。 Aubio 函数 new_aubio_pitchdetection()
效果很好,但类似函数 new_aubio_onset() 则不然。事实上,它在所有东西的 freeImage 库中给了我一个 EXC_BAD_ACCESS 错误——我在项目中的任何地方都没有引用它。 (FreeImage 内置于 openFrameworks 中,是的,但除此之外我不会接近它)
该错误将我带到文件 ofImage.cpp
并显示:
//这是需要调色的灰度图像: http:// sourceforge.net/forum/message.php?msg_id=2856879
我熟悉内存管理上下文中的 EXC_BAD_ACCESS,但这看起来可能存在命名空间问题?我发现这个函数如何在如此遥远的(并且据说是非活动的)代码中导致错误,这让我的小大脑完全困惑。
当然,我可以发布代码示例,但这似乎是一个比代码片段中更基本的问题。
I'm starting a project using the Aubio library within openFrameworks, so I'm copying in code to my project from Aubio demos, modifting, etc. The Aubio function new_aubio_pitchdetection()
works great, but the similar function new_aubio_onset()
doesn't. In fact, it gives me an EXC_BAD_ACCESS error in the freeImage library of all things-- which I'm not referencing at all, anywhere in my project. (FreeImage is built into openFrameworks, yes, but other than that I'm not going near it)
The error takes me to the file ofImage.cpp
and says:
//this is for grayscale images they need to be paletted from: http://sourceforge.net/forum/message.php?msg_id=2856879
I'm familiar with EXC_BAD_ACCESS in a memory-management context, but this looks like maybe there's a namespace problem going on? I find it completely baffling to my little brain how this function can cause an error in such distant (and supposedly nonactive) code.
I can post code samples, of course, but this seems to be a problem on a more fundamental level than can be seen in a snippet.
发布评论
评论(1)
该代码很可能会破坏堆。这可能会导致广泛的问题,几乎所有代码都在使用堆。失败的代码不对损坏负责。使用良好的调试分配器对此进行诊断,查看 CRT 中可用的内容。或者彻底的代码审查。
The code is most probably corrupting the heap. That can cause widespread problems, just about any code is using the heap. The code that fails is not responsible for the corruption. Diagnose this with a good debug allocator, see what's available in your CRT. Or a thorough code review.