Question

We are currently testing a bugfix for an old VB6 application, the initial version of the program would get the PID and store it in an int, and then write it to the database. This works fine until your application gets assigned a PID higher than 32768, in which case you get overflow and the application dies.

We fixed this by changing everything to long, instead of int. but now we have a problem testing. We only see this problem rarely in our production environments (but with devastating effect when it occurs), and never in testing. I've tried to provoke a high PID by spawning a ton of programs, but I never managed to get it past PID 25000.

I did find a tool called HighPid (http://winprogger.com/?p=29) but sadly it doesn't seem to deliver on it's promises. So does anyone out there have a similar (but working) tool, or some other trick to force a high PID on a windows server?

Was it helpful?

Solution

Launch 32767 dummy really light-weight processes? ;-) 100kb*32k = 3.2Gb, so RAM should not limit you.

OTHER TIPS

You could look at it from a different perspective and instrument the function that retrieves the process id, something like (pseudocode):

function GetPID()
{
    // ... retrieve process id

    #if DEBUG
      return pid + 32000;
    #else
      return pid;
    #endif
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top