What is "unknown software exception (0xc00000fd)" error and how to avoid it?

7

I have created an AHK script named code_2, compiled it and placed it into my Startup folder so that it would automatically start running each time I turn on the computer.

The script checks a website for new updates and whenever an update on the website is detected, it downloads those updates using UrlDownloadToFile.

At first the script seemed to work fine, but recently I started receiving the following messages from my computer after my script has been running for about 15 minutes:

C:\Documents and Settings\Administrator\「開始」功能表\程式集\啟動\code_2.exe: code_2.exe - 應用程式錯誤

應用程式發生例外 unknown software exception (0xc00000fd) 於位置 0x7c92eddc。

請按 [確定] 終止程式

請按 [取消] 進行程式偵錯

Any idea what this message is all about? (Sorry for the Chinese here, but I'd think that if you know this message by its number, you should be familiar with the contents.)

Anyway, here is the translated message:

C:\Documents and Settings\Administrator\Start Menu\Programs\Startup\code_2.exe: code_2.exe - Application Error

The exception unknown software exception (0xc00000fd) occurred in the application at location 0x7c92eddc.

Click on OK to terminate the program
Click on CANCEL to debug the program

windows
winapi
exception
asked on Stack Overflow Oct 14, 2011 by brilliant • edited Aug 31, 2018 by bwDraco

1 Answer

16

I believe that 0xc00000fd is a stack overflow exception (http://support.microsoft.com/kb/315937). Without seeing your script, it is hard to say for sure what is going wrong, but this sort of thing is generally caused by recursing too deeply. I would check your script for any recursive functions and make sure that they are exiting before reaching too great a depth.

It's possible you're actually allocating too much on the stack. I'm not familiar with AHK, but it's possible the compiler is allocating a large amount of data (probably local variables) on the stack, too. If you define a large number of (or a number of large) local variables, this could happen.

It's also possible that the stack/memory is somehow getting corrupted, although this seems less likely to be the case when using a scripting language. It might be more likely when accessing native API from a scripting language, depending on how that is done.

The last possiblity I'm going to suggest here is that you're calling some API and causing it to allocate a lot of stack space as well, possibly by passing in bad parameters. Again, without knowing more specifics (especially what it's doing when it hits that exception), it's hard to say for sure.

I can think of some other reasons, but they're even less likely.

answered on Stack Overflow Oct 14, 2011 by user995048

User contributions licensed under CC BY-SA 3.0