question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

On Unpause (5/5 runs) - StraightLineCast has 0 length array

See original GitHub issue

Environment

Unity 2020.3.16f1

  • Code source: Zinnia
  • Code version: 1.40
  • Platform version: Android 10 ( API 29) , Pico VR ( old/new Unity SDK)
  • 3rd party dependencies: None

Steps to reproduce

  1. Create simple rig with CameraRigs.TrackedAlias and 2 interactable pointers
  2. Add Straight Pointers for left/right hand. Make it always visible. Set activations so that the activation event is always processed (pointer is always active)
  3. Build Android Project and run on Pico
  4. Launch App
  5. Press Home button to navigate to Pico Quick System Menu. Wait for few seconds.
  6. Go back to your app ( continue your app)
  7. Sometimes it will throw out of boundary exceptions. ( 5/5) tries

This is also reproducible on Quest 1.

Expected behavior

It should have a check for length before using indecies.

Current behavior

ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index ?, line 0, in System.ThrowHelper.ThrowArgumentOutOfRangeException ?, line 0, in System.ThrowHelper.ThrowArgumentOutOfRangeException ?, line 0, in System.Collections.Generic.List`1[T].set_Item ?, line 0, in Zinnia.Cast.StraightLineCast.GeneratePoints ?, line 0, in Zinnia.Cast.StraightLineCast.DoCastPoints ?, line 0, in Zinnia.Process.Moment.MomentProcess.ProcessNow ?, line 0, in Zinnia.Process.Moment.MomentProcessor.Process ?, line 0, in UnityEngine.Camera+CameraCallback.Invoke

Briefly describe what is actually happening. image

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ExtendReality-Botcommented, Feb 5, 2022

🎉 This issue has been resolved in version 1.45.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

1reaction
studentutucommented, Feb 2, 2022

@thestonefox found out the cause - public RaycastHit? TargetHit - is not being cleared on disable.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What happens if I define a 0-size array in C/C++?
An array cannot have zero size. ISO 9899:2011 6.7.6.2: If the expression is a constant expression, it shall have a value greater than...
Read more >
Zero Length (Using the GNU Compiler Collection (GCC))
A zero-length array can be useful as the last element of a structure that is really a header for a variable-length object:
Read more >
Array: length - JavaScript - MDN Web Docs
The length data property of an Array instance represents the number of elements in that array. The value is an unsigned, 32-bit integer...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found