last updated: March 1, 2010
Getting stack traces for server processes on Windows applies to 32-bit Gemstone/S.
If you encounter internal errors in GemStone processes, or if you have a situation where a GemStone process appears to be hanging, GemStone Technical Support will typically want to see a C level stack trace. This allows us to determine what code path resulted in the error. For hang situations, a series of stack traces several seconds apart will help in diagnosis – for example, very slow performance of long operations may appear to be a hang.
GemStone distributes the symbol files required to get meaningful stack traces on Windows. However, you will need to download WinDbg, or use another Windows tool to actually get the stack trace.
1. Download and install WinDbg
Go to https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/ and follow the link “Install Debugging Tools for Windows 32-bit Version”
This process has been tested with version 220.127.116.114, which is listed under Previous Versions. Click on the link “Install 32-bit version 18.104.22.1684 [16.9 MB]” and save to your local disk.
Run the installer, and install the complete package.
2. Start WinDbg
Launch WinDbg from the Start menu.
Set File>Symbol File Path to include your %GEMSTONE%/bin directory, which contains GemStone’s .pdb symbol files. For example, N:\installdir\bin
If you encounter errors relating to ntdll.dll, you may need to also add the following to the symbol path:http://msdl.microsoft.com/download/symbols
3. Attach to the process
Select the menu item File>Attach to a Process. Select the stoned.exe, gem.exe, or other GemStone process in the list, and press OK.
4. Get the stack trace
To get a stack, use the menu item View>Call Stack. This will open a window initially showing a call stack for the current thread, which is probably not interesting. Leave this windows open.
Go to the menu item View>Processes and Threads. This will open a window with the stoned executable on top and a list of the threads (identified by hex codes). When you select a different thread, the call stack window will be automatically updated.
One of the stacks will contain the main process thread, this will normally have “main” on the stack. For example, look for a frame stoned!main or gem!main.
Use the menu item Edit>Copy Window Text To Clipboard to copy the stack.
5. Detach and continue
You can use Debug>Detach Debuggee to detach from the process and allow it to continue running.
Since by invoking a debugger, you halt the system, use with caution.
If you are requested to get a number of stack traces separated by some time, remember that no time passes while stopped in a debugger. Detach Debuggee to allow it to continue, then re-attach to get the next stack.