Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

stack/heap collisions caused by llSetScriptState()?

Hugo Dalgleish
Registered User
Join date: 14 May 2006
Posts: 27
09-09-2006 17:29
In one of the projects I'm working on I have a complex script that's stopped and started by a shorter script.

The shorter one uses llSensorRepeat() to see if there's an avatar within a certain distance and will set the bigger script running (with llSetScriptState()) if someone comes within the range of llSensorRepeat(). Once the avatar leaves the llSensorRepeat() range it stops the bigger one, again with llSetScriptState().

However, I've noticed that I get a lot of stack/heap collision errors when using the two together and testing with llGetFreeMemory() shows there to be anywhere between 4.6K and 2K of free memory in the bigger script right before the collisions occur (which is making me doubt that it really is running out of memory).

If I leave the smaller script out and just let the bigger one run I don't seem to get the stack/heap collisions.

So, does anyone know if llSetScriptState() can cause stack/heap collisions in the script it's supposed to stop and start?
Travis Lambert
White dog, red collar
Join date: 3 Jun 2004
Posts: 2,819
09-10-2006 00:05
I haven't seen any stack heap issues myself when using llSetScriptState() - however...

I have noticed that llSensor() seems to completely lose its mind after being activated with llSetScriptState() - especially if there was a stale sensor request left over from when the script was previously brought offline.

Perhaps its the Sensor call that's freaking out - maybe debug its output & see what you get?
_____________________
------------------
The Shelter

The Shelter is a non-profit recreation center for new residents, and supporters of new residents. Our goal is to provide a positive & supportive social environment for those looking for one in our overwhelming world.