[ENH][GOODIE] OSProcess V3.0 (OSProcess for Windows)

David T. Lewis lewis at mail.msen.com
Sat Mar 16 13:30:10 UTC 2002


On Fri, Mar 15, 2002 at 03:51:43AM -0500, PhiHo Hoang wrote:
> David,
> 
> 	You may want to look into 'primitiveGetEnvironmentStrings' which
> calls 'stringFromCString(p)' and crashed the GC system. 
> 
> 	The call stack shows 'stringFromCString',
> 'instantiateClassindexableSize', 'sufficientSpaceAfterGC',
> 'incrementalGC', 'fullGC'. The problem is in this loop:

Very interesting.
How large is the environment on your Windows (Win2k?) system? Are
there more that 25 environment variables defined?

Here is what I think is happening:

Win32OSProcessPlugin>>primitiveGetEnvironmentStrings reads your
environment block. For each entry, it creates a Smalltalk String and
pushes it onto a special stack of "non-remappable" objects with
ObjectMemory>>pushRemappableOop:.

It looks like ObjectMemory>>pushRemappableOop: is using a stack which
has been allocated with 25 elements, and it has no error checking
to prevent stack overflows.

My guess is that you have more than 25 strings in your environment,
and that my code is stepping past the end of the stack and blowing
up the VM as a result.

The problem would not show up on my Win98 computer because I have
only a few environment variables defined. It does not show up on Unix
systems because I used a different method of getting the environment
in UnixOSProcessPlugin.

I'll put out some patches if a day or so. Thanks again for the debugging
help.

Dave

p.s. Just comment out the call to primitiveGetEnvironmentStrings in
WindowsOSProcessAccessor>>primGetEnvironmentStrings if you want to
get OSProcess working. There will probably be some things that don't
work right in CommandShell if you do this, but at least your VM should
stop crashing ;)




More information about the Squeak-dev mailing list