« September 2007 | October 2007 Archives | November 2007 »
I spent a little time looking at an x64 port of my debugging tools library at the weekend. Since this requires me to set breakpoints and manipulate process memory and image files and all sorts I expected it to be a little more complex to port than the higher level sockets code and the bulk of my Win32 code. So far things are going reasonably well, but I've just come across a strangeness with DebugSetProcessKillOnExit(TRUE) in an x86 debugger that's running an x86 process on an x64 machine. It seems like when the debug thread terminates the debugged process doesn't…

x64 Debugger, ExceptionCode == 0x4000001f

| 1 Comment
I should be finishing some docs for the x64 release of The Server Framework... But this is more interesting... When running my Win32 debugging code on x64, this time when compiled natively as x64 code and when debugging an x64 CLR process, I've been getting an 'unexpected' ExceptionCode in an EXCEPTION_DEBUG_EVENT. The code is 0x4000001f and, after some searching around, it seems that it's a STATUS_WX86_BREAKPOINT event and I sometimes get these instead of EXCEPTION_BREAKPOINT events... This is a bit of a surprise, some breakpoints that I've set generate the expected debug event and some generate the 0x4000001f one... This isn't too…

WOW64 Win32 DebugAPI and managed code

| 0 Comments
It seems that I've located the "issues" in my Debug Tools library. This library is used in my TickShifter (time control) tool and my native Win32 Deadlock Detection tool. Due to how I wanted to control the debugged processes start up and how I needed to halt the debugged process at a particular time there were some hoops that I found I had to jump through. Those hoops have changed shape; either because of differences between Vista and XP or due to x64 and the WOW64 layer, I'm not sure which yet. Anyway, when starting a native process under the…

x64, IOCP, Socket Server framework

| 7 Comments
The x64 version of our I/O completion port based, networking client and server framework, The Server Framework, is now shipping. This is the licensed version of the free server framework that's available here. An overview of the licensed version can be found here. The changes from that version to the latest version can be found here. The documentation for this version is available online, here. Please be patient, the docs are a work in progress and I know they could be better. This release sees a first cut at full documentation for all of the example servers; see here. Apart from the…

Summary of x64 Win32 Debug API issues

| 0 Comments
I've finished porting my debugging tools support libraries to x64 now and thought it was worth putting up a summary of the issues that I've noticed: A 32bit exe can't start a 64bit exe for debugging - pretty obvious really. When a 64bit debugger is running a 32bit debugee the debugger seems to get TWO "loader breakpoints" one when the 64bit dlls are loaded and a second when the 32bit dlls have been loaded. In a 32bit debugger running on WOW64 a call to DebugSetProcessKillOnExit() succeeds but doesn't seem to do what it's supposed to do. When a CLR process…

Being wrong.

| 1 Comment
This week I've spent some of the time being wrong, which has proven useful as I've learned quite a lot and clarified my understanding of a situation. It all began when I had a bug report from a client who claimed that an obscure internal part of The Server Framework wasn't working as he expected it to...…

IOBuffer allocation strategy...

| 2 Comments
Whilst being wrong this week I reviewed some of the other socket server entries on this site and was reminded of an item that's on a todo list somewhere by a comment on this posting from Matt: "What do you think about using VirtualAlloc to allocate page-aligned memory for the receive buffers? Would it reduce the number of locked pages? I mean if you allocate a buffer of 'page size' using 'new[]' it is very likely that the buffer uses 2 pages instead of 1." This sounds sensible and the change is easy to make, in Buffer.cpp... void *CBuffer::operator new(…

Continuing a theme...

| 4 Comments
Continuing last week's theme of being wrong, 'M' pointed out to me in a comment on my posting about changing the memory allocation strategy for the IO buffer allocator that I actually have a bit more work to do... I'd forgotten that VirtualAlloc() allocates in terms of the memory allocation granularity of the operating system.... So, at present, the quick and dirty fix that I posted is allocating buffers in blocks of at least 64k of memory... They are, at least, page aligned ;) Thanks for pointing out the error of my ways, comments like this are one of the…

OnSocketReleased() weirdness

| 4 Comments
I ran into an unexpected issue with OnSocketReleased() yesterday whilst writing a connection filter for a client. OnSocketReleased() is a callback method in The Server Framework that allows you to 'do stuff' at the last possible moment of a connection's lifetime. It's guaranteed to be the last callback ever called for a connection and it's guaranteed not to be called until all references to a connection have been released; so you can't get caught out by other threads still processing other last minute connection shutdown events. Since, by the time OnSocketReleased() is called the connection is dead, you only get passed a…

Performance counters that don't show up in perfmon

| 0 Comments
My current server development for a client has been going well but this week I finally got to the point where I wanted to look at the peformance counters it was presenting and they weren't showing up in perfmon. My daily development for most projects is on my x64 box and I was building the server in x86 mode and although it was registering its counter DLL correctly it was an x86 DLL and the x64 perfmon can't load x86 counter dlls. This is something that I knew all about from when I was developing the new version of the…
« September 2007 | October 2007 Archives | November 2007 »

About this Archive

This page is an archive of entries from October 2007 listed from newest to oldest.

September 2007 is the previous archive.

November 2007 is the next archive.

I usually write about C++ development on Windows platforms, but I often ramble on about other less technical stuff...

Find recent content on the main index or look in the archives to find all content.

I have other blogs...

Subscribe to feed The Server Framework - high performance server development
Subscribe to feed Lock Explorer - deadlock detection and multi-threaded performance tools
Subscribe to feed l'Hexapod - embedded electronics and robotics
Subscribe to feed MegèveSki - skiing