访问冲突写入位置0xfdfdfdfd [英] Access violation writing location 0xfdfdfdfd

查看:694
本文介绍了访问冲突写入位置0xfdfdfdfd的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

几天来我一直遇到这个问题,但如何解决却一无所获.我从来没有遇到过这样的错误:

myproject.exe中0x00511e0e(msvcr100d.dll)的未处理异常: 0xC0000005:访问冲突写入位置0xfdfdfdfd.

我真的不知所措.有帮助吗?

解决方案

0xfdfdfdfd是MSVC调试堆实现(

  • 您分配对象(或者可能是向量)的数组,其第一个数据成员是指针,然后执行相同的操作.
  • 我认为后者更有可能的原因是,在未结束之前在指针数组中使用未初始化的指针会中断,因此您必须从头开始,这是不寻常的事情. /p>

    I have been having this problem for a few days now and I can find nothing on how to fix it. I have never had an error like this one :

    Unhandled exception at 0x00511e0e (msvcr100d.dll) in myproject.exe: 0xC0000005: Access violation writing location 0xfdfdfdfd.

    I really am at a loss of what to do. Any help?

    解决方案

    0xfdfdfdfd is a magic value in the MSVC debug heap implementation (details here) that's put as a canary directly before and behind an allocated region of storage. Somehow you're using it as a pointer and writing to it.

    It's difficult to say with certainty what the error is, since you didn't think it necessary to show any code. I suspect one of two things:

    1. You allocate a pointer array and use the "element" behind the last element uninitialized, or (more likely)
    2. You allocate an array of objects (or possibly a vector) whose first data member is a pointer and do the same.

    The reason I think the latter more likely is that using pointers in the pointer array uninitialised would break before you got to the end, so you'd have to start at the end, which would be an unusual thing to do.

    这篇关于访问冲突写入位置0xfdfdfdfd的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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