开发者

CreateProcess(): "Program too big to fit in memory"

开发者 https://www.devze.com 2023-02-18 08:42 出处:网络
I am currently trying to debug my Crash-Handler, it is an external executable that gets called when my program finds an unhandled structured exception. I recompiled the crash-handler executable, and w

I am currently trying to debug my Crash-Handler, it is an external executable that gets called when my program finds an unhandled structured exception. I recompiled the crash-handler executable, and when I tested, I got a message: "Program too big to fit in memory".

After digging around for a bit, I found that this was being caused by the CreateProcess call within my unhandled exception filter. I found this post that says that this error message indicates that the executable is corrupted, however if I invoke the CrashHandler.exe from the command line, I get no such error.

Other Information:

  • I have tried rebuilding my application and the crash-handler multiple times in both debug and release mode.
  • I have tried giving the running thread 2 orders of magnitude more stack space.
  • I tested the same CrashHandler.exe in another application that was already using it, and there were no problems.
  • I tried using a previous version of the exe that worked before, but with the same result.
  • Restarting the system.

My Call to CreateProcess:

//Fire off the Handler
//HandlerArgs = "CrashHandler.exe arg1 arg2 arg3 etc..."
if(CreateProcess(NULL,开发者_如何学Go HandlerArgs, NULL, NULL, TRUE, CREATE_PRESERVE_CODE_AUTHZ_LEVEL | CREATE_SUSPENDED,
                 NULL, NULL, &StartupInfo, &NewProcessHandle))


Turns out that one of my post-build hooks was copying over the exe from The source control repository, and the file I had in the source control repository was actually the pdb. While testing I was copying directly to my running folder, and then the hook would copy the "corrupted" exe over again.

0

精彩评论

暂无评论...
验证码 换一张
取 消