• 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-3349
Type: Bug Bug
Status: Resolved Resolved
Resolution: Duplicate
Priority: Critical Critical
Assignee: Unassigned
Reporter: herina Bode
Votes: 0
Watchers: 1
Operations

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

MONO : llRemoteLoadScriptPin run time error when updating a suspended script

Created: 02/Oct/08 04:08 AM   Updated: 25/Nov/08 12:49 PM
Return to search
Component/s: Scripts
Affects Version/s: None
Fix Version/s: None

Issue Links:
Duplicate
 
Relates


 Description  « Hide
When trying to update with llRemoteLoadScriptPin on a suspended script (after a call to llEmail for example which suspend script for 20 seconds), an error occur :

System.Reflection.TargetParameterCountException: Number of parameter does not match expected count.
at System.Reflection.Binder.ConvertArgs (System.Reflection.Binder binder, System.Object[] args, System.Reflection.ParameterInfo[] pinfo, System.Globalization.CultureInfo culture) [0x00000]
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000]
at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000]
at LindenLab.SecondLife.LslUserScript.OnEvent (ScriptEvent evt) [0x00000]
at LindenLab.SecondLife.Script.Run (ScriptEvent evt) [0x00000]

It doen't appear in non-mono scripts, error is on the old script, the new one is correctly installed.



 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Darien Caldwell added a comment - 03/Oct/08 03:31 PM - edited
This Bug should be under SVC, not VWR, but I don't see a way to change that. This could be an important clue to all the Crash issues if repeatable. I'll try to reproduce as soon as I get my neck above water.

Darien Caldwell added a comment - 03/Oct/08 04:07 PM - edited
I tried to reproduce this, but could not create the described issue.

Script called 'Email_Script':

default
{
state_entry()

{ llSetRemoteScriptAccessPin(1111); llSay(0,"New script init."); }

touch_start(integer total_number)

{ llSay(0,"Sending Email"); llEmail("YOUR_EMAIL@WHATEVER.COM","Test Email","This is just a test."); llSay(0,"Email Suspend Done."); }

}

Script Called "Updater":

default
{
touch_start(integer total_number)

{ llSensor("suspended_object","",SCRIPTED|PASSIVE,20,PI); }

no_sensor() { llOwnerSay("I can't find the object 'suspended_object'"); }
sensor(integer total_number) { llSay(0,"updating..."); llRemoteLoadScriptPin(llDetectedKey(0), "Email_Script", 1111, TRUE, 1); }

}

Place a copy of the "Updater" script and a copy of the "Email_Script" script into a prim called "Updater". Set the "Email_Script" to not running.
Place a copy of the "Email_Script" into a prim called "suspended_object". Make sure its set to running.

To create the conditions described, touch the "suspended_object", it will send an email and suspend. While it's suspended touch the "Updater" and it will replace the suspended script with a new copy.

I was unable to produce any error.


herina Bode added a comment - 07/Oct/08 02:44 AM
well you are right and this is a little bit more complicated

I will try (with my bad english) to explain.

first there is an updater object with this 3 scripts:

/////////////////// updater_script

default
{
touch_start(integer total_number)

{ llSensor("sleeptest","", SCRIPTED|PASSIVE, 20, PI); }

no_sensor() { llOwnerSay("I can't find the object 'sleeptest'"); }
sensor(integer total_number) { llSay(0,"updating..."); llRemoteLoadScriptPin(llDetectedKey(0), "sleep_script", 1111, TRUE, 1); llRemoteLoadScriptPin(llDetectedKey(0), "sleep_eng", 1111, TRUE, 1); llSay(0,"update done."); }
}

//////////////////// sleep_script //////////////////////////////// (non running state in prim)

integer LM_SLEEP = 9;
integer LM_SLEEP_REFUS = 10;
integer nbt = 0;

//*************************************************

//*************************************************
Init()
{
llSetRemoteScriptAccessPin(1111);

nbt = 0;
llSetTimerEvent(5);

llMessageLinked(LINK_THIS, LM_SLEEP, "Test1", NULL_KEY);
llMessageLinked(LINK_THIS, LM_SLEEP, "Test2", NULL_KEY);
llMessageLinked(LINK_THIS, LM_SLEEP, "Test3", NULL_KEY);
llMessageLinked(LINK_THIS, LM_SLEEP, "Test4", NULL_KEY);
}
//*************************************************

//*************************************************
default
{
state_entry()

{ Init(); }

on_rez(integer prm)

{ Init(); }

changed(integer change)
{
if (change & CHANGED_OWNER)
{ llResetScript(); }
}

timer()
{ llSetTimerEvent(1); llMessageLinked(LINK_THIS, LM_SLEEP, "Test_" + (string)nbt, NULL_KEY); if ( nbt > 10) llSetTimerEvent(0); nbt++; }

link_message(integer sender, integer num, string str, key id)
{ if (num == LM_SLEEP_REFUS) llMessageLinked(LINK_THIS, LM_SLEEP, str, id); }
}

//////////////////// sleep_eng ///////////////////////////// (non running state in prim)

integer LM_SEND_SLEEP = 1000;

integer LM_SLEEP = 9;
integer LM_SLEEP_REFUS = 10;
integer LM_SLEEP_OK = 11;
integer LM_REQUEST_NUM = 21;
integer LM_SLEEP_READY = 22;

integer Running;
string msg;

//*****************************************************************
// initialisation Programme principal
//*****************************************************************
init()
{
Running = FALSE;
msg = "";
}
//*****************************************************************
// Programme principal
//*****************************************************************
default
{
state_entry()
{ init(); }

on_rez(integer start_param)
{ init(); } }

link_message(integer sender, integer num, string str, key id)
{
if (num == LM_SLEEP)
{
if ( Running == FALSE)
{ Running = TRUE; msg = str; llMessageLinked(LINK_THIS, LM_REQUEST_NUM, "", NULL_KEY); llMessageLinked(LINK_THIS, LM_SLEEP_OK, str, id); }
else
{ llMessageLinked(LINK_THIS, LM_SLEEP_REFUS, str, id); }
}
else if (num == LM_SLEEP_READY)
{
if ( Running == TRUE)
{ llOwnerSay("Send sleep test to " + llGetSubString(str, 9, -1) + " (" + str + ") : " + msg); llMessageLinked(LINK_THIS, LM_SEND_SLEEP + (integer)llGetSubString(str, 9, -1), msg, NULL_KEY); Running = FALSE; }
}
}
}

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

another prim to update called "sleeptest", it contains the two previous scripts : sleep_script and sleep_eng
and 10 identical scripts named sleep_scr001, sleep_scr002, sleep_scr003, sleep_scr004, etc...

//////////////////// sleep_scr0xx /////////////////////////////

integer LM_REQUEST_NUM = 21;
integer LM_SLEEP_READY = 22;
integer NumLinkMail = 0;

//*****************************************************************
// initialisation Programme principal
//*****************************************************************
init()
{
NumLinkMail = 1000 + (integer)llGetSubString(llGetScriptName(), 9, -1);
}
//*****************************************************************
// Programme principal
//*****************************************************************
default
{
state_entry()
{
integer i = llGetStartParameter();
if ( i > 0)
{ llOwnerSay("updating " + llGetScriptName()); }
init();
}

on_rez(integer start_param)
{ init(); }

changed(integer change)
{
if (change & CHANGED_OWNER)
{ llResetScript(); } }
}

link_message(integer sender, integer num, string str, key id)
{
if (num == NumLinkMail)

{ llOwnerSay( llGetScriptName() + " " + str + " is sleeping...."); llSleep(20); llOwnerSay(llGetScriptName() + " awaked"); }

else if ( num == LM_REQUEST_NUM)
llMessageLinked(LINK_THIS, LM_SLEEP_READY, llGetScriptName(), "");
}
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

When rezzing the "sleeptest" object all is fine, it is calling the llSleep function, dispatching through the scripts and no error occurs in Mono and LSL complie.
When updating, in LSL mode, no problem, in Mono you will see the errors described earlier.

I hope to have been clear and that could be useful for you. I hope it is not a bug from me too
.


Darien Caldwell added a comment - 07/Oct/08 05:06 PM - edited
I was able to reproduce the issue using your example. I"m just going to have to work on simplifying it. It's rather scary as all 10 scripts eventually crashed!

I see the difference between your example and mine, it's not the script being updated that crashed, but rather other scripts which are sleeping.

A completely off the cuff guess, The sleeping scripts have pending link message events from the two other scripts. When those two scripts are updated using llRemoteLoadScriptPin(), their events are removed from the queue. But the sleeping scripts aren't informed, or miss being told this, and try to run the now missing events.

Edit: nevermind about that above, other tests show no issues with events from scripts that change on the fly. I've been pretty unsuccessful at simplifying the example, simpler models don't produce the error. I"m wondering if it's a case of too many linked message events? Does the queue still drop events once it reaches the 64 event queue limit I wonder? And does Mono handle that right?


herina Bode added a comment - 07/Oct/08 11:35 PM
Smiles, a little bit scary, but 10 was not necessary, I think 1 or 2 is enough, purpose was to minimize the time of a test and to maximize chances to get an error.
Not sure it is the 64 events queue limit (if it is still true under mono) as there is no problem when rezzing the sleeptest object from inventory to inworld, no link message is lost and I suppose there is more than 64 in 20 seconds. It is probably something around events sended by an updated, and now missing, script. Maybe a try to return to an inexistant point, in C it could be a stack error or a call to a invalid pointer, in C# I don't know.
A workaround could be to call the llResetScript function just after the call to llSleep, it is hiding the bug not fixing it.

Periapse Linden added a comment - 28/Oct/08 12:52 PM
Anything you can do to simplify the repro will increase the chances of a dev picking it up.
With over a dozen Mono issues, and a grabbag of other LSL JIRA, the team has to triage. All else being equal, easy to repro issues bubble up to the top of the priority queue.

Darien Caldwell added a comment - 29/Oct/08 08:22 PM
I went to the beta grid to check this against Server Version 1.25. At first I made sure still failed on 1.24, and it did. TPed over to a 1.25 server and re-started the experiment. I was unable to recreate the issue there.

herina, I would suggest connecting to the preview grid and trying your specific application. The sim I used which is running 1.25 is here:
http://slurl.com/secondlife/Abbotts/150/148/71

You can find information for connecting to the preview grid here:
http://wiki.secondlife.com/wiki/Preview_Grid

I'm happy to say this issue appears resolved with server version 1.25.


Strife Onizuka added a comment - 30/Oct/08 01:41 AM
Ah, this is a duplicate of SVC-2975 which already has a fix pretty far down the pipeline.

herina Bode added a comment - 30/Oct/08 04:47 AM
In the beta grid, running 1.25 server version, this error seems to be fixed , that is right it was a duplicate of SVC-2975, I didn't noticed it.

thanks to all