Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0008855opensim[REGION] Scripting Enginepublic2021-01-27 13:182021-02-06 19:14
ReporterChris Weymann 
Assigned ToChris Weymann 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformOperating SystemOperating System Version
Product Version 
Target VersionFixed in Version0.9.2.0 dev 
Summary0008855: Cast Excaption at osGetNumberOfAttachments
DescriptionHello all,

I'm trying to use osGetNumberOfAttachments() to find out if I have something attached to the head. I have encountered the following problem.

The YEngine seems to have a problem with the return value of osGetNumberOfAttachments. I have checked it on different regions and with different script engines.
For testing I changed the script engine in the OpenSim.ini but also via the parameter //xengine:lsl in the first script line. Both had the same result: When I run the script with the YEngine I get a cast error.
Steps To ReproduceUse this script with the yengine:

default
{
    touch_start(integer i)
    {
        llOwnerSay(llList2CSV(osGetNumberOfAttachments(llDetectedKey(0), [ATTACH_HEAD])));
    }
}
Additional InformationWindows Server with YEngine:
[12:42] osGetNumberOfAttachmentsTest: [YEngine]: Exception while running dcbe1490-ca11-43f1-bdad-e7f124a8420d
[12:42] osGetNumberOfAttachmentsTest: InvalidCastException: Specified cast is not valid.
[12:42] osGetNumberOfAttachmentsTest: Prim: <Object>, Script: <New Script>, Location: Freyhain <89,182,23>
[12:42] osGetNumberOfAttachmentsTest: Script must be Reset to re-enable.
[12:42] osGetNumberOfAttachmentsTest: at OpenSim.Region.ScriptEngine.Shared.Api.OSSL_Api.osGetNumberOfAttachments(LSLString avatar, list attachmentPoints)
[12:42] osGetNumberOfAttachmentsTest: at OpenSim.Region.ScriptEngine.Shared.ScriptBase.ScriptBaseClass.osGetNumberOfAttachments(LSLString avatar, list attachmentPoints)
[12:42] osGetNumberOfAttachmentsTest: at default touch_start
[12:42] osGetNumberOfAttachmentsTest: at OpenSim.Region.ScriptEngine.Yengine.XMRInstAbstract.CallSEH()
[12:42] osGetNumberOfAttachmentsTest: at OpenSim.Region.ScriptEngine.Yengine.XMRInstance.StartEx()

Linux + Mono with YEngine:
[12:44] osGetNumberOfAttachmentsTest: [YEngine]: Exception while running 62c1c25a-84bf-422b-88bb-dd59553980f0
[12:44] osGetNumberOfAttachmentsTest: InvalidCastException: Specified cast is not valid.
[12:44] osGetNumberOfAttachmentsTest: Prim: <osGetNumberOfAttachmentsTest>, Script: <osGetNumberOfAttachmentsTest>, Location: Twix <126,126,22>
[12:44] osGetNumberOfAttachmentsTest: Script must be Reset to re-enable.
[12:44] osGetNumberOfAttachmentsTest: at OpenSim.Region.ScriptEngine.Shared.Api.OSSL_Api.osGetNumberOfAttachments (OpenSim.Region.ScriptEngine.Shared.LSL_Types+LSLString avatar, OpenSim.Region.ScriptEngine.Shared.LSL_Types+list attachmentPoints) [0x00064] in <0612203174e24a79be53dfec2ec07656>:0
[12:44] osGetNumberOfAttachmentsTest: at OpenSim.Region.ScriptEngine.Shared.ScriptBase.ScriptBaseClass.osGetNumberOfAttachments (OpenSim.Region.ScriptEngine.Shared.LSL_Types+LSLString avatar, OpenSim.Region.ScriptEngine.Shared.LSL_Types+list attachmentPoints) [0x00000] in <1e7c1c3c92414249a6b60022a8f30fd7>:0
[12:44] osGetNumberOfAttachmentsTest: at (wrapper dynamic-method) System.Object.default touch_start(OpenSim.Region.ScriptEngine.Yengine.XMRInstAbstract)
[12:44] osGetNumberOfAttachmentsTest: at OpenSim.Region.ScriptEngine.Yengine.XMRInstAbstract.CallSEH () [0x0003d] in <10dfdabab8794b2e9358a26c5ee2deda>:0
[12:44] osGetNumberOfAttachmentsTest: at OpenSim.Region.ScriptEngine.Yengine.XMRInstance.StartEx () [0x00007] in <10dfdabab8794b2e9358a26c5ee2deda>:0

Windows Server with XEngine:
[12:50] osGetNumberOfAttachmentsTest: 2, 2

Linux Server with XEngine:
[12:51] osGetNumberOfAttachmentsTest: 2, 2
TagsNo tags attached.
Git Revision or version number
Run ModeStandalone (1 Region) , Standalone (Multiple Regions) , Grid (1 Region per Sim) , Grid (Multiple Regions per Sim)
Physics EngineBulletSim, ubODE
Script EngineXEngine, YEngine
EnvironmentMono / Linux64, Mono / Windows
Mono Version6.x
Viewer
Attached Filespatch file icon 0001-dont-cast-LSL_Integer-to-int-in-osGetNumberOfAttachm.patch [^] (1,989 bytes) 2021-02-06 09:28 [Show Content]

- Relationships

-  Notes
(0037541)
Chris Weymann (reporter)
2021-02-06 09:29

I have found the issue. LSL_Integer cant cast to int. The xengine use int and yengine use LSL_Integer as filetype for parameters.
(0037543)
Chris Weymann (reporter)
2021-02-06 19:14

thanks @ubit
fixed in bb6f31039ee66669c986a81ad8f1e3a7772fb272

- Issue History
Date Modified Username Field Change
2021-01-27 13:18 Chris Weymann New Issue
2021-02-06 09:28 Chris Weymann File Added: 0001-dont-cast-LSL_Integer-to-int-in-osGetNumberOfAttachm.patch
2021-02-06 09:29 Chris Weymann Note Added: 0037541
2021-02-06 09:29 Chris Weymann Status new => patch included
2021-02-06 19:14 Chris Weymann Note Added: 0037543
2021-02-06 19:14 Chris Weymann Status patch included => resolved
2021-02-06 19:14 Chris Weymann Fixed in Version => 0.9.2.0 dev
2021-02-06 19:14 Chris Weymann Resolution open => fixed
2021-02-06 19:14 Chris Weymann Assigned To => Chris Weymann


Copyright © 2000 - 2012 MantisBT Group
Powered by Mantis Bugtracker