Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0008407opensim[REGION] Scripting Enginepublic2018-11-12 17:402018-12-13 05:17
Reportermewtwo0641 
Assigned Tomewtwo0641 
PrioritynormalSeveritymajorReproducibilitysometimes
StatusconfirmedResolutionno change required 
PlatformOSOS Version
Product Version0.9.0.1 
Target VersionFixed in Version 
Summary0008407: YEngine (and possibly XEngine) fails to compile some pre-existing scripts with null error
DescriptionOn some preexisting scripts YEngine (and possibly XEngine) fails to compile giving an error of "Value can not be null." It only seems to happen if there is nothing on line 0 of a script. Traditionally I have avoided using line 0 at all because of problems in the past when OpenSim had support to use C# and Java as a language in scripts and line 0 was used to tell the compiler which language we were using.

So basically most of my scripts look something like this:

0 (There is nothing at all on this line; Blank space)
1 //Some comments
2 //Maybe some more comments
3 Some variables
4
5 default
6 {
7
8 }

The affected scripts compile and work just fine on XEngine and as far as I can tell YEngine has only had this problem very very recently (In the past few days) and prior to a few days ago those scripts have been working just fine in YEngine.

Edit: This may not just be an issue with YEngine... When I switched back to XEngine (Being sure to remove my ScriptEngines directory contents first of course) I got a lot of these type errors:

Object: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.MissingMethodException: Method not found: 'Void OpenSim.Region.ScriptEngine.Shared.ScriptBase.ScriptBaseClass.llDialog(System.String, System.String, list, Int32)'.

   at SecondLife.Script.showMenu(LSLString message, LSLString av)

   at SecondLife.Script.handleTouch(LSLString av)

   at SecondLife.Script.default_event_touch_start(LSLInteger total_number)

   --- 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.Scr
TagsNo tags attached.
Git Revision or version number
Run Mode Grid (Multiple Regions per Sim)
Physics EngineubODE
Environment.NET / Windows64
Mono VersionNone
Viewer
Attached Files

- Relationships

-  Notes
(0033469)
UbitUmarov (administrator)
2018-11-12 17:49

Possible something else
tested (master) with one and more empty lines at start with no error

ill check llDialog
(0033470)
mewtwo0641 (reporter)
2018-11-12 17:52
edited on: 2018-11-12 17:52

I did test this with a brand new script and no error; The errors seem to only happen on scripts that were written prior to some recent change in the past few days on master.

(0033471)
UbitUmarov (administrator)
2018-11-12 17:56

also could not repo issues with llDialog
a test script compiled and worked on both engines

make sure you only have one engine with Enable = true and the other false ( ofr now at least
also the correct:
DefaultScriptEngine = "XEngine" or DefaultScriptEngine = "YEngine"
(0033472)
UbitUmarov (administrator)
2018-11-12 18:01
edited on: 2018-11-12 18:20

first argument of lldialog is key not string
but even
        key user = llDetectedKey(0);
        string aa =(string)user;
        llDialog(aa, "\

did work on X and Y

(0033474)
UbitUmarov (administrator)
2018-11-12 18:16

did you delete ScriptEngines on the correct bin folder? ( just asking ;) )
(0033475)
UbitUmarov (administrator)
2018-11-12 18:18

the lldialog and other functions did change, you do need to delete ScriptEngines
(0033476)
mewtwo0641 (reporter)
2018-11-12 18:19

I did make sure to delete the correct ScriptEngines folders :) and I also verified that I do have my OpenSim.ini setup with the proper Enable options set.

After returning back to YEngine from XEngine (And having deleted the script engines directories for both X and Y) The issue seems to be gone now... Very weird. I can only assume perhaps something in the ScriptEngine directories got corrupted or confused in the past few days somehow?

I think this might just be a case of something got messed up somehow in the ScriptEngines folders without my knowing about it and it might be that OpenSim didn't like the result of that. I do apologize if this is a legitimate case of user error.

Will keep an eye on it for a while and report any changes.

Thank you for having a look Ubit :)
(0033477)
mewtwo0641 (reporter)
2018-11-12 18:20

Whoops, wrote my previous comment before you commented about llDialog() changing recently. That makes a lot more sense now :)
(0033478)
UbitUmarov (administrator)
2018-11-12 18:21

Ok
Y is more hard on syntax than X, it may refuse several scripts that where "ok" on X
(0033479)
mewtwo0641 (reporter)
2018-11-12 18:26
edited on: 2018-11-12 18:34

I had noticed that with YEngine; Had to fix a couple of my scripts that were OK on XEngine but when YEngine pointed out there was an error it was a realization of "How did this even work to begin with and why did XEngine allow this to happen?" So I think the more strict syntax of YEngine can be a good thing; But I was still completely confused on why it seemed to suddenly hate having a blank line 0 before I deleted my ScriptEngines folder (A second time).

(0033494)
Ferd Frederix (reporter)
2018-11-14 10:42

That blank line might have some unicode in it on line 0, if the script was edited in Wordpad. The first few bytes contain a UTF-8 indicator.
(0033510)
mewtwo0641 (reporter)
2018-11-15 17:42

@Ferd Frederix - I always use the in-viewer script editor when I write scripts and I did try backspacing on line 0 to make sure there really was nothing there and even backedspaced the entire script so that there was actually code on that line... When I did, it compiled fine, but soon as I put it back to its original state (Nothing on line 0, By using the Enter/Return key to drop every thing back down one line) it failed to compile again. Removing the script engines folder seemed to have fixed the issue though.

I am going to close the issue and assume user error on my part for now but still keep an eye on it.
(0033534)
mewtwo0641 (reporter)
2018-11-23 20:04
edited on: 2018-11-23 20:08

It seems like there is more to this issue than simply forgetting to delete the ScriptEngines directory. It seems to happen whenever I switch from YEngine to XEngine and isn't limited to just llDialog(). I made sure to delete the ScriptEngines directory when it happened a few moments ago but the issue now still persists and I've shutdown OS, deleted the ScriptEngines directory, and restarted OS a few times now to no avail... So I have no idea what I did to actually fix the issue last week when I posted this mantis (Assuming deleting the ScriptEngines folder wasn't the entire reason the issue was fixed).

I changed the issue to "confirmed" because I wasn't sure how to re-open it... Didn't see an option for it.

Some LSL error output from the viewer when the issue shows up:

AO v1.0.2: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.MissingMethodException: Method not found: 'LSLString OpenSim.Region.ScriptEngine.Shared.ScriptBase.ScriptBaseClass.llStringTrim(LSLString, LSLInteger)'.

   at SecondLife.Script.SetAOAnim(LSLString CurAnimType, LSLString NewAnim)

   at SecondLife.Script.PickRandomAnim(LSLString cmd, list animations)

   at SecondLife.Script.MainInit()

   at SecondLife.Script.default_event_on_rez(LSLInteger params)

   --- 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, O
AO v1.0.2: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.MissingMethodException: Method not found: 'LSLString OpenSim.Region.ScriptEngine.Shared.ScriptBase.ScriptBaseClass.llStringTrim(LSLString, LSLInteger)'.

   at SecondLife.Script.RefreshAO(LSLString anim)

   at SecondLife.Script.default_event_changed(LSLInteger change)

   --- 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, Obj
AO v1.0.2: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.MissingMethodException: Method not found: 'Void OpenSim.Region.ScriptEngine.Shared.ScriptBase.ScriptBaseClass.llDialog(LSLString, LSLString, list, Int32)'.

   at SecondLife.Script.showMenu(LSLString message, LSLString av)

   at SecondLife.Script.handleTouch(LSLString av)

   at SecondLife.Script.default_event_touch_start(LSLInteger num)

   --- 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.
AO v1.0.2: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.MissingMethodException: Method not found: 'LSLString OpenSim.Region.ScriptEngine.Shared.ScriptBase.ScriptBaseClass.llStringTrim(LSLString, LSLInteger)'.

   at SecondLife.Script.SetAOAnim(LSLString CurAnimType, LSLString NewAnim)

   at SecondLife.Script.PickRandomAnim(LSLString cmd, list animations)

   at SecondLife.Script.handleEvent(LSLString id)

   at SecondLife.Script.timerTick()

   at SecondLife.Script.default_event_timer()

   --- 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.Reflecti
AO v1.0.2: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.MissingMethodException: Method not found: 'Void OpenSim.Region.ScriptEngine.Shared.ScriptBase.ScriptBaseClass.llDialog(LSLString, LSLString, list, Int32)'.

   at SecondLife.Script.showMenu(LSLString message, LSLString av)

   at SecondLife.Script.handleTouch(LSLString av)

   at SecondLife.Script.default_event_touch_start(LSLInteger num)

   --- 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.

(0033535)
BillBlight (developer)
2018-11-23 20:28

can you post the script? I'd like to know what causes this, I have 15 regions running YEngine, and only ever had a couple of scripts fail ... Would love to know exactly what script calls/settings/variables are triggering this ..
(0033536)
SnootsDwagon (reporter)
2018-11-23 20:34
edited on: 2018-11-23 20:37

I have tested the "existing script" concept. It may be true, however, when I copied the script text, deleted the script and pasted the script text to a new script, the same issues happened (the script continued to malfunction or refuse to compile).

This leads me to consider two possibilities:
1) There are hidden characters or attributes in the first script that copy/paste over to the second script or

2) There is a problem with the object containing the script (ie, "broken object")

I tested the second possibility by doing a drag/copy and deleting the original object. This failed to fix the problem. So I then took the item to inventory, deleted the rezzed object and rezzed the inventory copy (rezzed a "new" object). Sometimes the problem then vanished, sometimes it didn't.

At this time we have an object on ElvenSong region named "Fred". It is an eyeball on a tall stand that is supposed to follow anyone within 96m. The script ceases operation on a regular basis (sometimes it works, then just stops working). Once it stops working, no effort will get it to work again.

This leads me to believe (based on observational evidence) there is a deep system bug either in the region or scripting engine that causes scripts / objects to "break" without warning or notification. Of course, the very nature of such a problem will be extremely difficult to find. Such would require deep-dive coding, with the main problem being the extremely random nature of this issue.

The advantage with FRED is this: it's currently not working. So examining deep code and trying to find out WHY Fred isn't working might reveal the core cause of this problem.

Whatever it is, it's erratic, random, and causes perfectly good code to cease functioning. As noted above I have seen this happen again and again especially in the case of scripts using llDialog(). Here is a detailed manifestation.

1. I try to run the script
2. I receive a bogus llDialog() error of varying types and the script fails
3. I go into the script, add a space at the end of a line anywhere to force the script into ready-to-save state
4. Save the script
5. The script compiles and works properly, the llDialog() error gone-- but other than adding the space, nothing in the script text was changed.

In my experience this indicates a core script engine issue-- one that is likely going to be difficult to find. It is possible it is manifesting itself in multiple ways, many of which are indicated in prior comments.

(0033537)
mewtwo0641 (reporter)
2018-11-23 21:16
edited on: 2018-11-23 21:18

I'm unfortunately not able to post the script since it is part of a project I'm working on for a client. However it's not just one or two scripts that do this that I have observed; It seems to happen with every script... At least attachment scripts.

I do know that objects (some, if not all?... Maybe it's only attachments.) have their scripts bytecode and/or state stored in their XML serialization and I am wondering if this could be a possible source of the issue? As in, the object was previously serialized with XEngine bytecode and state, switch to YEngine and for some reason there's no errors, everything appears fine, but when switching back to XEngine (making sure to delete the ScriptEngines directory of course) and it just really doesn't like that too much and errors all over the place.

I'm also unsure that even if I was able to post the script, that it would do much good for testing, because a recompile seems to fix it (Even though clearing the ScriptEngines directory doesn't). However recompile is annoying and time-consuming at best (For instance, recompiling a large number of objects to get them working again. Or scripted objects that contain scripted objects and then you have to pull out all the contents just to recompile those too, then put them back in and recompile any scripts that were in the base object) and not always possible at worst (No mod objects and/or scripts).

(0033538)
SnootsDwagon (reporter)
2018-11-24 00:03
edited on: 2018-11-24 06:36

Currently the best method I know of to detect those types of issues is to move the code to an external text system (such as Notepad++), then copy/paste it from there back into a totally new script (and a new object if possible. See if that fixes it.

One of the most frustrating (and possibly related) issued I've faced over the years is "broken prims"... a creation which does not work and does not work, but if everything is replaced (including the object itself), it works fine. The original object was "broke"... some undefinable thing that the system lost track of something (no telling what) and the object itself prevents anything in it from being operational, including scripts. When the object is destroyed and a new one built, the exactly same scripted contents work just fine.

We have seen slam-bit issues come in from SL and Inworldz. There could be something even deeper that is failing to recognize standard script operational parameters-- nullifying Fred's ability to follow avatars and script with llDialog() to work properly-- even though the code itself is just fine.

(0033539)
SnootsDwagon (reporter)
2018-11-24 06:48

A random idea hit me out of the blue this morning, based primarily on the activity of "Fred" (mentioned above).

We have a script that works... the just suddenly stops working, for no discernible reason. No amount of working on it will fix it. Using Occam's Razor: the script engine stopped paying attention to that object. From the viewpoint of the system, the script no longer exists, the scripted object no longer exists, the script engine stops trying to run scripts for that object.

That's the only thing I can think of that makes any sense in this.

Note this still doesn't explain the false-error-reporting issue on llDialog(), but it could explain other issues. Just a thought, shooting in the dark.
(0033540)
mewtwo0641 (reporter)
2018-11-24 07:48

Is the object "Fred" running under a simulator running XEngine or YEngine? I haven't noticed these issues under YEngine but OS gives me fits with many of the symptoms described throughout this mantis whenever I switch it back over to XEngine for whatever reason I may have at the time. The first day I had posted this mantis I had thought that deleting the ScriptEngines directory was what fixed everything but it seems like a case of "I just got lucky" in that instance and it must have been something else I did (Either purposefully or not) that fixed it and I have no idea what that might have been.
(0033541)
SnootsDwagon (reporter)
2018-11-24 08:27

I'm using Xengine. I'll try switching to YEngine to see if it makes a difference.
(0033542)
SnootsDwagon (reporter)
2018-11-24 08:56

Well, I was *going* to try Yengine, but the following notes gave me pause:

  ;; DANGER, do not use with HG, don't leave regions running alone with it.
  ;; TPs or crossings to/from Xengine will full recompile scripts losing state.
  ;; attachment scripts may misbehave, cars will stop on crossings, etc.

Yeah... I think I'll stick with Xengine. ;D
(0033543)
mewtwo0641 (reporter)
2018-11-24 19:27

LOL yeah it is a pretty scary warning :P Though I haven't encountered any major issues with it (Course I don't run HG) aside from this mantis.
(0033627)
mewtwo0641 (reporter)
2018-12-13 02:12

On XEngine this still seems to be an issue in master. I can go back to an earlier revision (Maybe about a month ago) and it works fine. Deleting the contents of ScriptEngines folder seems to help with objects rezzed in world but it does nothing to fix attachment objects that are affected by it. There are a lot of exceptions thrown in the console about System.MissingMethodException and it seems to be having trouble resolving random parts of the scripts such as their events, methods, types, etc. I don't think it would be helpful to post the exceptions I've got this time since they're all fairly identical to the ones previously posted in this mantis, only the particular event, method, or type is changed per exception.

If I switch back over to YEngine it seems to work fine; so I am confused why going back to XEngine is giving me so much trouble (After making sure of the correct engine settings of Enabled = true/false for the ones I want to use and not use, The correct engine I want to use is uncommented in Startup section and the one I don't want to use is commented, and also deleting the respective script engines folders before starting OS back up of course)
(0033628)
UbitUmarov (administrator)
2018-12-13 05:17

do not forget to set default engine also

- Issue History
Date Modified Username Field Change
2018-11-12 17:40 mewtwo0641 New Issue
2018-11-12 17:47 mewtwo0641 Summary YEngine fails to compile some pre-existing scripts with null error => YEngine (and possibly XEngine) fails to compile some pre-existing scripts with null error
2018-11-12 17:47 mewtwo0641 Description Updated View Revisions
2018-11-12 17:48 mewtwo0641 Description Updated View Revisions
2018-11-12 17:49 UbitUmarov Note Added: 0033469
2018-11-12 17:52 mewtwo0641 Note Added: 0033470
2018-11-12 17:52 mewtwo0641 Note Edited: 0033470 View Revisions
2018-11-12 17:56 UbitUmarov Note Added: 0033471
2018-11-12 18:01 UbitUmarov Note Added: 0033472
2018-11-12 18:05 UbitUmarov Note Added: 0033473
2018-11-12 18:16 UbitUmarov Note Added: 0033474
2018-11-12 18:18 UbitUmarov Note Added: 0033475
2018-11-12 18:19 mewtwo0641 Note Added: 0033476
2018-11-12 18:20 UbitUmarov Note Edited: 0033472 View Revisions
2018-11-12 18:20 UbitUmarov Note Deleted: 0033473
2018-11-12 18:20 mewtwo0641 Note Added: 0033477
2018-11-12 18:21 UbitUmarov Note Added: 0033478
2018-11-12 18:26 mewtwo0641 Note Added: 0033479
2018-11-12 18:27 mewtwo0641 Note Edited: 0033479 View Revisions
2018-11-12 18:34 mewtwo0641 Note Edited: 0033479 View Revisions
2018-11-14 10:42 Ferd Frederix Note Added: 0033494
2018-11-15 17:42 mewtwo0641 Note Added: 0033510
2018-11-15 17:42 mewtwo0641 Status new => resolved
2018-11-15 17:42 mewtwo0641 Resolution open => no change required
2018-11-15 17:42 mewtwo0641 Assigned To => mewtwo0641
2018-11-23 20:04 mewtwo0641 Note Added: 0033534
2018-11-23 20:04 mewtwo0641 Status resolved => confirmed
2018-11-23 20:08 mewtwo0641 Note Edited: 0033534 View Revisions
2018-11-23 20:08 mewtwo0641 Relationship added related to 0008406
2018-11-23 20:28 BillBlight Note Added: 0033535
2018-11-23 20:34 SnootsDwagon Note Added: 0033536
2018-11-23 20:35 SnootsDwagon Note Edited: 0033536 View Revisions
2018-11-23 20:37 SnootsDwagon Note Edited: 0033536 View Revisions
2018-11-23 21:16 mewtwo0641 Note Added: 0033537
2018-11-23 21:18 mewtwo0641 Note Edited: 0033537 View Revisions
2018-11-24 00:03 SnootsDwagon Note Added: 0033538
2018-11-24 03:56 UbitUmarov Relationship deleted related to 0008406
2018-11-24 06:36 SnootsDwagon Note Edited: 0033538 View Revisions
2018-11-24 06:48 SnootsDwagon Note Added: 0033539
2018-11-24 07:48 mewtwo0641 Note Added: 0033540
2018-11-24 08:27 SnootsDwagon Note Added: 0033541
2018-11-24 08:56 SnootsDwagon Note Added: 0033542
2018-11-24 19:27 mewtwo0641 Note Added: 0033543
2018-12-13 02:12 mewtwo0641 Note Added: 0033627
2018-12-13 05:17 UbitUmarov Note Added: 0033628


Copyright © 2000 - 2012 MantisBT Group
Powered by Mantis Bugtracker