Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Changes in new LSL VM w.r.t. flushing event queues on script reset?

Ziggy Puff
Registered User
Join date: 15 Jul 2005
Posts: 1,143
09-08-2008 10:43
I recently found a bug in one of my products that I'm pretty sure wasn't there before. Basically, there's one script that picks up chat messages and forwards them as link messages to everything else in the root prim. Then another script in the root prim is responsible for taking some action based on the link messages, which generates link messages to the child prims. One of the commands is 'reset', which is meant to reset every script in the product, and is handled more or less like this:

link_message(...
...
else if (str == "reset";)
{
llSleep(1.0);
llMessageLinked(LINK_SET, 0, "reset", ...
llSleep(1.0);
llResetScript();
}

... or something like that. Since I used LINK_SET, I end up dropping a link message into my own queue. But this used to not be a problem, because the sleep + script reset used to flush this script's event queue. Now, it looks like the event queue isn't being flushed. Or, something else is going on. But basically, what happens is that this script ends up in an infinite loop of waking up and resetting itself.

The fix is simple, use LINK_ALL_OTHERS or LINK_ALL_CHILDREN or whatever. But I'm more interested in the wider implications of what's going on. One possibility is that I'm smoking crack, and it's always worked this way. But I'm pretty sure I tested this reset functionality, and I'd think I'd notice if hitting the reset button locked up the whole product. So, I also don't think this is some other bug of mine where I've set up some kind of link message feedback/echo and that's the source for the repeated link messages (I added a link message sniffer and verified that there's an endless stream of 'reset' link messages).

I haven't tested it further, but I figured I'd put it out here so someone else could try it out and tell me what they find/think. A simple test would be to have a state_entry that sent a link message to yourself and then reset, then see if the link message handler reports anything.
Escort DeFarge
Together
Join date: 18 Nov 2004
Posts: 681
09-08-2008 12:50
This and some related issues are being tracked in Jira see -- SVC-2990, SVC-2751 and SVC-2980

The first two have LL DEV tickets so expect a fix fairly promptly.

hth
/esc
_____________________
http://slurl.com/secondlife/Together
Ziggy Puff
Registered User
Join date: 15 Jul 2005
Posts: 1,143
09-08-2008 13:29
Ah, thanks. Looks like my case is fully covered there.