_invoke_watson() is the internal Microsoft C runtime function that crashed your program. This is what made you take a look at this mini pump. Doesnβt tell you anything interesting, you need to look at the stack to see how it got there. The problem started with:
AKC!swprintf_s<260>+0x25
Note the posttext _s the function name, this is a protected version for swprintf (). This ensures that sprintf () cannot write beyond the end of the buffer. He wrote down the end of the buffer, which caused a crash. You can also see the buffer size on behalf of the template, 260 characters.
This is a magic number on Windows, this is the value of MAX_PATH. It provides you with a pretty good theory of why the program crashed, it was probably suggested that you deal with a file name containing more than 259 characters. Not infrequently, C and C ++ programs in general are very difficult to work with file systems in Windows, capable of creating paths up to 32,767 characters in length. The backgrounder is here .
In addition to adding checks to your program, to ensure that this limit is not exceeded, you will give better diagnostics by telling the client about the re-organization of your data and avoiding storing files in deeply nested directories, this is the easiest workaround.
source share