简体   繁体   English

Windows QueueUserWorkItem C ++发行模式问题

[英]Windows QueueUserWorkItem C++ Release mode issue

I have c++ code that uses QueueUserWorkItem to call a function that from a wrapper class that calls winsock accept. 我有使用QueueUserWorkItem调用来自调用winsock accept的包装类的函数的c ++代码。 This works fine in debug, it also works if I run the release executable from using the Start Profile option from Dependency Walker. 这在调试中效果很好,如果我使用Dependency Walker的“启动配置文件”选项运行发行版可执行文件,它也可以工作。 However if I run the release executable normally, it crashes on the call to QueueUserWorkItem. 但是,如果我正常运行发布可执行文件,则在调用QueueUserWorkItem时会崩溃。 As soon as it calls that function the application just exits. 调用该函数后,应用程序立即退出。 Execution never reaches the function I pass into QueueUserWorkItem, however the function pointer is valid. 执行永远不会到达我传递给QueueUserWorkItem的函数,但是该函数指针是有效的。

Does anyone know of anything that could cause QueueUserWorkItem to crash in release mode but not debug? 有谁知道任何可能导致QueueUserWorkItem在发布模式下崩溃但无法调试的信息?

Does anyone know of anything that could cause <random function> to crash in release mode but not debug? 有谁知道任何可能导致<random function>在发布模式下崩溃但无法调试的信息吗?

Yes, buffer overflows. 是的,缓冲区溢出。 Debug build have guards placed around them that you can overwrite, but in Release mode you're probably overwriting important memory. 调试版本周围放置了可以覆盖的防护,但是在发布模式下,您可能覆盖了重要的内存。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM