March 2011 Archives

Bug in CStringConverter::WtoA().

| 0 Comments
There's a bug in CStringConverter::WtoA() when the default system code page is set to a multi-byte code page. The result is that the call will fail with an exception stating that "The data area passed to a system call is too small". This was due to some naive code page handling (or lack of handling) in the code that determined the required buffer size.

This bug will be fixed in release 6.4 of The Server Framework which does not currently have a release date. If you need the fix sooner please get in touch.

Automatic crash dump creation.

| 0 Comments
The next release of The Server Framework, 6.4, includes code which allows a server to create a crash dump whilst it is running. Typically you might want to do this if some strange and possibly fatal exception gets thrown. Crash dumps are a great way to debug a server that is failing in production, the server generates the dump when something goes wrong and you can then load up the dump on your development machine and your debugger will be sitting on the line that caused the problem. You can read all about crash dumps here.

Being able to enable automatic crash dump creation in a server means that you don't have to rely on external tools to generate the dumps for you. By simply adjusting your Config.h you can generate a crash dump whenever an SEH exception is caught. Your server may be able to continue to run but you're generating diagnostic data that will be useful to prevent the exceptions being generated. Likewise you can enable crash dump generation from purecalls, simply install the purecall handler and adjust your Config.h to enable the dump creation.

Of course you can also use the crash dump generation code in other areas of your code if you need to. You can tune how much data is included in the dump, and hence the size of the resulting file and you can determine where the files are generated. Of course the source is available so that you can tweak the crash dump generation if you want to.

Once you are building code that can generate crash dumps you will probably want to set up a symbol server to store the exe and pdb files for every release that you create so that the dumps that your clients send to you can be used to debug properly. A good introduction to setting up and using a symbol server can be found here.