• All submissions to this site are governed by Second Life Project Contribution Agreement. By submitting patches and other information using this site, you acknowledge that you have read, understood, and agreed to those terms.
Issue Details (XML | Word | Printable)

Key: SVC-3102
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Scouse Linden
Reporter: Silicon Plunkett
Votes: 3
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
2. Second Life Service - SVC

Scripts do not "pick up where they left off" from llSetScriptState() in Mono

Created: 19/Sep/08 01:46 PM   Updated: 02/Feb/09 03:52 PM
Return to search
Component/s: Scripts
Affects Version/s: 1.24 Server
Fix Version/s: None

Environment: N/A
Issue Links:
Relates
 

Linden Lab Issue ID: DEV-20886
Linden Lab Internal Branch: mono-post-1-24-6-fixes


 Description  « Hide
In Mono, if a script is set to not running during a function call, subsequent code is not run when script execution continues.
This occurs only when the script is disabled via llSetScriptState(). How the script is resumed is irrelevant.

Proof of concept:

Test()
{
    llOwnerSay("Set me to running.");
    llSetScriptState(llGetScriptName(),0);
    llOwnerSay("You won't see this text in Mono");
}

default
{
    state_entry()  { Test(); }
}

Note that in LSL2, llSetScriptState is asynchronous, so the text will get spit out before the script stops running.
That REALLY needs to be fixed. In Mono, the text will never see the light of day.

Even this will fail:

Test()
{
    llOwnerSay("Set me to running.");
    llSetScriptState(llGetScriptName(),0);
    while(1) llOwnerSay("You won't see this in Mono");
}

This bug effectively breaks synchronous cross-script communication, and WILL break scripts that rely on
llSetScriptState() to disable/enable modules and plugin scripts.

Suggestion:

  • Make llSetScriptState() synchronous in LSL2 (as it should be in the first place).
  • Make sure subsequent code executes in Mono when the script resumes.
  • PLEASE PLEASE PLEASE Fix this!


 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Periapse Linden added a comment - 22/Sep/08 03:14 PM
I confirmed the behavior in both LSL2 (asynchronous) and Mono (doesn't pick up after script resumes).

I actually don't recommend changing LSL2, as that behavior change might break content, but we should ensure proper behavior for Mono.

Importing into internal JIRA.


Scouse Linden added a comment - 10/Oct/08 03:22 AM - edited
Seems to be related that this script is stopping itself. This combination seems to work.

New Script

integer i = 0;

default
{
    state_entry()  
    { 
        while(1)
        {
            llOwnerSay("Test " + (string)i++);
            llSleep(1);
        }
    }
}

New Script 1

integer touched = 0;
default
{
    touch_start(integer total_number)
    {
        llSay(0, "Touched.");
        if (touched == 0)
        {
            touched = 1;
            llSetScriptState("New Script",0);
        }
        else
        {
            touched = 0;
            llSetScriptState("New Script",1);      
        }
    }
}

Scouse Linden added a comment - 10/Oct/08 04:51 AM
New behaviour causes Mono to stop immediately after the call to stop

LSL follows the existing behaviour where it stops shortly after the call

You won't see this text in Mono, until you resume. But you might see it before in LSL.

Test()
{
    llOwnerSay("Set me to running.");
    llSetScriptState(llGetScriptName(),0);
    llOwnerSay("You won't see this text in Mono, until you resume.");
    llOwnerSay("You won't see this text in Mono, until you resume.");
    llOwnerSay("You won't see this text in Mono, until you resume.");
    llOwnerSay("You won't see this text in Mono, until you resume.");
    llOwnerSay("You won't see this text in Mono, until you resume.");
    llOwnerSay("You won't see this text in Mono, until you resume.");
    llOwnerSay("You won't see this text in Mono, until you resume.");
    llOwnerSay("You won't see this text in Mono, until you resume.");
}

default
{
    state_entry()  { Test(); }
}

Periapse Linden added a comment - 02/Feb/09 03:52 PM
Fix deployed to agni as part of 1.25.3