> Swat doesn't like my program. When I click new file it dies with a stack
> overflow. Glue says "Stack/uninitialized data size: 5016" The program
works
> just fine in Ensemble with "stack 5000". I tried bumping it up to 6000,
and
> even 10000 but swat still crashes. Doesn't even make it to the initialize
> file method.
I tend to believe that this might be the first problem to tackle, even
though it could be unrelated to your VM file troubles. This is because for
any type of "bad handle crash" problem (which is what your VM example looks
like from the distance), Swat is making debugging so much easier, because
it will usually point you right at the offending command - and error
messages of Swat (especially on the EC target) almost never occur without a
good reason. [In some cases, this reason is not in your code, but in Geos,
but even this is often a useful information...]
Did you try doing a "backtrace" or a "where" after the stack failure?
Depending on the way you are sending messes to some objects, you could have
created an unwanted recursion, or at least something that takes up much
more stack than one would expect as an ordinary C programmer. :-)
For example, if you @send a message to an object on the same thread, the
system may actually execute this as a @call (unless you specified
forceQueue) immediately, adding to the stack usage of your current
procedure.
Also, when building a UI tree, Geos often goes through deeply nested
structures of message calls, and a corrupt tree could probably lead to an
infinite recursion quite easily...
ciao marcus
ps: The only things I'm really missing in the EC mechanism of Geos are
strong class-typechecking and a kind of automatic inclusion of
ECCheckBounds() around *every* pointer that is being deref'ed in GOC.
Anyway, I believe Borland C is lacking a necessary pointer-deref hook in
the code generation for this, at least in the versions I have seen so far.
(Microsoft C seems to offer something like this in the non-optimizing
version, but for some reason, MSC support has never been fully developed).