View Issue Details

IDProjectCategoryView StatusLast Update
0002108NoesisGUIUnitypublic2022-08-18 13:41
Reporterrachelle Assigned Tosfernandez  
PrioritynormalSeveritycrash 
Status feedbackResolutionopen 
Product Version3.1.0 
Target Version3.1 
Summary0002108: Index out of range exception in Noesis.View::KeyDown
Description

We have recently upgraded to NoesisGUI 3.1.0. We are now seeing this crash periodicially in our Unity client build in Noesis.View::KeyDown:

ArgumentOutOfRangeException
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index

System.ThrowHelper.ThrowArgumentOutOfRangeException
1
System.Collections.Generic.List1[T].get_Item System.Collections.ObjectModel.Collection1[T].System.Collections.IList.get_Item
Noesis.Extend.ListGet at line 2303
UnityEngine.Debug:LogException(Exception)
NoesisUnity:OnUnhandledException(Exception) at line 314
Noesis.Error:UnhandledException(Exception) at line 18
Noesis.Extend:ListGet(IntPtr, UInt32) at line 2310
Noesis.View:Noesis_View_KeyDown(HandleRef, Int32)
Noesis.View:KeyDown(Key) at line 307
NoesisView:ProcessEvent(Event, Boolean, Boolean) at line 1196
NoesisView:OnGUI() at line 1252

Potentially of note: as part of this upgrade, we needed to enable the new Unity input system in our build. We have other client-side dependencies that still require the old UnityEngine.Input system, so we currently have BOTH input systems enabled in our Player settings.

PlatformAny

Activities

sfernandez

sfernandez

2021-09-10 16:29

manager   ~0007429

I need more information to determine the cause, could you please modify the following code in our Extend.cs script (in Runtime/API/Core folder):

private static IntPtr ListGet(IntPtr cPtr, uint index)
{
try
{
var list = (System.Collections.IList)GetExtendInstance(cPtr);
object item = list != null ? list[(int)index] : null;
HandleRef itemPtr = GetInstanceHandle(item);
BaseComponent.AddReference(itemPtr.Handle); // released by native bindings
return itemPtr.Handle;
}
catch (Exception e)
{
var list = (System.Collections.IList)GetExtendInstance(cPtr);
Log.Error($"{list.GetType()}({list.Count}): Get({index})");
Error.UnhandledException(e);
return IntPtr.Zero;
}
}

Let's see what collection is giving errors, and if indices are totally wrong or not.

rachelle

rachelle

2021-09-11 00:53

reporter   ~0007435

I mis-diagnosed this as a crash; this is not actually crashing our client. I've added the logging you requested and am working on repro-ing the issue, but so far no luck. As soon as I'm able to repro it I'll share the resulting log output.

Issue History

Date Modified Username Field Change
2021-09-09 19:51 rachelle New Issue
2021-09-09 20:06 jsantos Assigned To => sfernandez
2021-09-09 20:06 jsantos Status new => assigned
2021-09-09 20:06 jsantos Target Version => 3.1.1
2021-09-10 16:29 sfernandez Status assigned => feedback
2021-09-10 16:29 sfernandez Note Added: 0007429
2021-09-11 00:53 rachelle Note Added: 0007435
2021-09-11 00:53 rachelle Status feedback => assigned
2021-09-15 20:56 jsantos Target Version 3.1.1 => 3.1.2
2021-11-29 14:13 sfernandez Target Version 3.1.2 => 3.1
2022-08-18 13:41 jsantos Status assigned => feedback
2025-10-10 13:29 jsantos Category Unity3D => Unity