Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0008026opensim[REGION] Scripting Enginepublic2016-09-20 13:462016-09-21 15:16
Reportermewtwo0641 
Assigned To 
PrioritynormalSeveritymajorReproducibilityrandom
StatusnewResolutionopen 
PlatformOperating SystemOperating System Version
Product Versionmaster (dev code) 
Target VersionFixed in Version 
Summary0008026: "Runtime Error in script... Could not load type 'list' from assembly..." Script fails to function
DescriptionI recently updated to latest OS release (v0.8.2.1 as of this writing) from OS 0.8.0 and have come across a bunch of objects that I've scripted simply fail to function or only partially function. Some of them are objects rezzed in world and others are attachments. I also observe this same behavior in the latest master.

The objects that cease functioning flood the console with exceptions "Runtime Error in script... Could not load type 'list' from assembly..." similar to the ones posted in the 'Additional Information' section. There seem to be two types, a Runtime error posted in white text (These scripts function until a certain part of the script is triggered), and an XEngine exception posted in red text (These scripts won't function at all).

As previously mentioned some of the affected scripts partially work and will fail when the script reaches a certain point. I suspect that this point has to do with the use of llParseString2List() and llParseStringKeepNulls() possibly in conjunction with llList2String(). The reason I suspect this is because every time I've seen the errors it has always been at the point in those scripts where these calls are made (This would make sense to me since those calls deal with List types).

A simple example of this would be

Script 'A' has a line similar to this:

llMessageLinked(LINK_SET, 0, "some_command|some_parameter", NULL_KEY);

Script 'B' handles it like this:

link_message(integer snum, integer num, string str, key id)
{
    //Runtime error happens somewhere in this area. The console is flooded with the errors once per attempt to trigger this code but it never successfully executes

    list info = llParseString2List(str, ["|"], []);
    string cmd = llList2String(info, 0);
    string param = llList2String(info, 1);

    if(cmd == "some_command")
        llSay(0, param);
}

I've tried a few things to rectify the situation on my own but I can't seem to come to a solution:

1. Reset the scripts (Viewer won't even attempt to reset them; it just sits there with a blank reset scripts floater)

2. Delete the contents of ScriptEngines and assetcache before starting OS to force recompile of scripts

3. Make sure DeleteScriptsOnStartup is set to true (0000002 Should have taken care of this but for the sake of testing)

4. Try a brand new database and freshly downloaded and newly configured from scratch OpenSim instance; load previously created objects from IAR file

None of these attempts seemed to help.
Steps To ReproduceThis is fairly tricky to reproduce since as far as I can tell this doesn't happen on newly written and compiled scripts, only on older scripts that were written prior to this issue and are already in the database upon update to newest release.

My path to updating was basically this:

1. Download fresh copy of latest release
2. Configure from scratch (Didn't copy over any old config files)
3. Hook OpenSim MySQL connector config to previous 0.8.0 database
4. Start OpenSim up; everything works fine except for the problematic scripts

===================
Extra steps taken:
===================

A. For testing with master code I repeated the above steps except that I pulled a fresh copy from git master and compiled first as Step 1. No changes other than configuration had been made.

B. To test from a fresh database I repeated Steps 1 and 2, but at Step 3 I configured it to point to a brand new blank database, then resumed at Step 4. After verifying OS started up and can log in correctly I loaded a backup IAR of my stuff and the script errors still show up.
Additional Information=========================
Errors
=========================

2016-09-20 05:15:15,096 DEBUG (STP:XEngine:46) - OpenSim.Region.ScriptEngine.Shared.Instance.ScriptInstance [SCRIPT INSTANCE]: Runtime error in script Config v1.0.0 (event link_message), part Jaw 02c3cdc0-d492-4f43-90bf-9d8bf0f607d7 at <225.9479, 60.6769, 22.36477> in Monte Cristo
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeLoadException: Could not load type 'list' from assembly 'CommonCompiler_compiled_02db6111-b07a-4d68-8cb4-437b44d331f9, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' due to value type mismatch.
   at SecondLife.Script.default_event_link_message(LSLInteger snum, LSLInteger num, LSLString str, LSLString id)
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at OpenSim.Region.ScriptEngine.Shared.ScriptBase.Executor.ExecuteEvent(String state, String FunctionName, Object[] args) in c:\Users\Admin\Desktop\opensim\OpenSim\Region\ScriptEngine\Shared\Api\Runtime\Executor.cs:line 197
   at OpenSim.Region.ScriptEngine.Shared.ScriptBase.ScriptBaseClass.ExecuteEvent(String state, String FunctionName, Object[] args) in c:\Users\Admin\Desktop\opensim\OpenSim\Region\ScriptEngine\Shared\Api\Runtime\ScriptBase.cs:line 97
   at OpenSim.Region.ScriptEngine.Shared.Instance.ScriptInstance.EventProcessorInt() in c:\Users\Admin\Desktop\opensim\OpenSim\Region\ScriptEngine\Shared\Instance\ScriptInstance.cs:line 888
   
   
2016-09-20 05:35:07,938 ERROR (STP:XEngine:2) - OpenSim.Region.ScriptEngine.XEngine.XEngine [XENGINE]: Could not load previous SecondLife.Script from assembly CommonCompiler_compiled_3dcf0ad7-0618-45b5-9d0a-0d61c2fdd791 in Monte Cristo. Not starting. Exception
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeLoadException: Could not load type 'list' from assembly 'CommonCompiler_compiled_3dcf0ad7-0618-45b5-9d0a-0d61c2fdd791, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' due to value type mismatch.
   at SecondLife.Script..ctor()
   --- End of inner exception stack trace ---
   at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
   at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache)
   at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean skipCheckThis, Boolean fillCache)
   at System.Activator.CreateInstance(Type type, Boolean nonPublic)
   at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
   at System.Activator.CreateInstance(String assemblyName, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityInfo, StackCrawlMark& stackMark)
   at System.Activator.CreateInstance(String assemblyName, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
   at System.AppDomain.CreateInstance(String assemblyName, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
   at System.AppDomain.CreateInstanceAndUnwrap(String assemblyName, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
   at OpenSim.Region.ScriptEngine.XEngine.XEngine.DoOnRezScript(Object[] parms) in c:\Users\Admin\Desktop\opensim\OpenSim\Region\ScriptEngine\XEngine\XEngine.cs:line 1386


2016-09-21 03:36:19,841 DEBUG (STP:XEngine:2) - OpenSim.Region.ScriptEngine.Shared.Instance.ScriptInstance [SCRIPT INSTANCE]: Runtime error in script Ball v2.0.1 (event listen), part ~ball b22048ba-b0b2-41d3-a49b-c01ed12aa54f at <129.4429, 125.7375, 21.48657> in Monte Cristo
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.MissingMethodException: Method not found: 'list OpenSim.Region.ScriptEngine.Shared.ScriptBase.ScriptBaseClass.llParseString2List(System.String, list, list)'.
   at SecondLife.Script.default_event_listen(LSLInteger channel, LSLString name, LSLString id, LSLString message)
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at OpenSim.Region.ScriptEngine.Shared.ScriptBase.Executor.ExecuteEvent(String state, String FunctionName, Object[] args) in c:\Users\Admin\Desktop\opensim\OpenSim\Region\ScriptEngine\Shared\Api\Runtime\Executor.cs:line 197
   at OpenSim.Region.ScriptEngine.Shared.ScriptBase.ScriptBaseClass.ExecuteEvent(String state, String FunctionName, Object[] args) in c:\Users\Admin\Desktop\opensim\OpenSim\Region\ScriptEngine\Shared\Api\Runtime\ScriptBase.cs:line 97
   at OpenSim.Region.ScriptEngine.Shared.Instance.ScriptInstance.EventProcessorInt() in c:\Users\Admin\Desktop\opensim\OpenSim\Region\ScriptEngine\Shared\Instance\ScriptInstance.cs:line 888
TagsNo tags attached.
Git Revision or version number
Run Mode Standalone (Multiple Regions)
Physics EngineODE
Script Engine
Environment.NET / Windows64
Mono VersionNone
ViewerN/A
Attached Files

- Relationships

-  Notes
(0031141)
mewtwo0641 (reporter)
2016-09-21 01:42

Found another related (I think) exception: Exception has been thrown by the target of an invocation. ---> System.MissingMethodException: Method not found: 'list OpenSim.Region.ScriptEngine.Shared.ScriptBase.ScriptBaseClass.llParseString2List(System.String, list, list)'.

Full exception added to Additional Information section
(0031142)
UbitUmarov (administrator)
2016-09-21 02:22

sorry what is the version?
master (dev code) as indicated in Product Version, or 0.8.2.1 ?
(0031144)
UbitUmarov (administrator)
2016-09-21 08:56

you may need to compile those scripts
but before make sure TrustBinaries = false in OpenSim.ini (or line is commented)
(0031145)
mewtwo0641 (reporter)
2016-09-21 12:30
edited on: 2016-09-21 12:37

This happens on both v0.8.2.1 Release as well as latest master code; I apologize for the confusion.

What I've found out though with setting TrustBinaries = false is that the scripts do indeed start working (after making sure to clear out the ScriptEngines directory before starting OS)

However the effect doesn't seem "permanent". If setting TrustBinaries = true again the issue comes back.

If this is a compilation issue then I am a bit confused as to why this setting makes a difference if the ScriptEngines folder is completely deleted before starting OpenSim (and if DeleteScriptsOnStartup = true). Shouldn't those scripts be re-compiled at startup in that case?

I don't observe this issue occurring on versions prior to the ones listed at the top of this note; on the OS version I had been running previously before updating it (v0.8.0) this issue did not occur in either case of TrustBinaries being set true or false; it would work with either setting of it.

(0031146)
UbitUmarov (administrator)
2016-09-21 13:25

seems TrustBinaries also works on scripts stored on the DB, so if true a stored binary is used.
Not being a fix you should reconsider the use of TrustBinaries, it is a dangerous option unless you run all the regions of your grid (and not HG)
even so we possible should only allow it on region crossings
(0031147)
mewtwo0641 (reporter)
2016-09-21 13:54

I do only use that option on my own grid (standalone, no HG, and no one but myself has access to the console/OpenSim instance and the hardware it runs on) and never use it in a public environment (Such as on OSGrid). While I do understand the dangers and risk associated with it, it does have its use for closed trusted grid (i.e. not public) settings but it seems broken now in this form.
(0031148)
UbitUmarov (administrator)
2016-09-21 14:12

ok.
meanwhile I did ask other devs and there was a major change to lsl List from 0.8 to 0.8.2 that makes older binaries incompatible.

TrustBinaries = true is finding those old binaries.
so you say that if:
- you delete bin/ScriptEngines folder contents (DeleteScriptsOnStartup = true isn't good on this since doesn't delete all data)
- start the region with TrustBinaries = false.
- do a backup command on console after region fully ready (just in case)
- shutdown
- restart with TrustBinaries = true

the errors still show up?
(0031149)
mewtwo0641 (reporter)
2016-09-21 15:16

That is correct. My steps to test that are as follows:

Test 0000001:
1. Delete /bin/ScriptEngines directory
2. Set TrustBinaries = false
3. Start OpenSim
    Result: Scripts work fine; ran backup command after region ready and before shut down before next test.

Test 0000002:
1. Run backup command and then shut down OpenSim
2. Set TrustBinaries = true
3. Start OpenSim
    Result: Scripts work fine for this instance except for any newly rezzed scripts that are introduced to the simulator that had not already been re-compiled in the previous test (See the following additional steps)
4. Run backup command and then shut down OpenSim
5. Delete /bin/ScriptEngines directory
6. Start OpenSim
   Result: Errors appear again

Conclusion: TrustBinaries = false works as intended but changing back to TrustBinaries = true results in errors if the /bin/ScriptEngines directory is deleted and then OpenSim is ran again.

- Issue History
Date Modified Username Field Change
2016-09-20 13:46 mewtwo0641 New Issue
2016-09-21 01:41 mewtwo0641 Additional Information Updated View Revisions
2016-09-21 01:41 mewtwo0641 Additional Information Updated View Revisions
2016-09-21 01:42 mewtwo0641 Note Added: 0031141
2016-09-21 02:22 UbitUmarov Note Added: 0031142
2016-09-21 08:56 UbitUmarov Note Added: 0031144
2016-09-21 12:30 mewtwo0641 Note Added: 0031145
2016-09-21 12:37 mewtwo0641 Note Edited: 0031145 View Revisions
2016-09-21 13:25 UbitUmarov Note Added: 0031146
2016-09-21 13:54 mewtwo0641 Note Added: 0031147
2016-09-21 14:12 UbitUmarov Note Added: 0031148
2016-09-21 15:16 mewtwo0641 Note Added: 0031149


Copyright © 2000 - 2012 MantisBT Group
Powered by Mantis Bugtracker