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.

ValueExtractor has some edge cases breaking IL2CPP builds

See original GitHub issue

Environment

  • Code source: Package manager
  • Code version: “io.extendreality.zinnia.unity”: “1.16.0”
  • Platform version: Unity 2019.2.21f1
  • 3rd party dependencies: None

Steps to reproduce

  • Create a new project,
  • Add a script to the main scene that does the following
using UnityEngine;
using Zinnia.Data.Operation.Extraction;

public class Example : MonoBehaviour
{
    void Start()
    {
        // We force the type to appear
        Debug.Log(typeof(SurfaceDataCollisionPointExtractor));
    }
}
  • Save the scene
  • Set scripting backend to IL2CPP and build

Expected behavior

Should build.

Current behavior

IL2CPP compilation error.

It seems that ValueExtractor has some edge cases that breaks the AOT scripting restrictions causing the build to fail.

I tried setting Stripping level to high and it still won’t build.

Also, the class that I used to reproduce the error is SurfaceDataCollisionPointExtractor, but some other classes, like SurfaceDataCollisionDataExtractor don’t cause this problem, so it seems to be a problem with the type RaycastHit.

Part of the log which seems useful says:

error C2440: ‘type cast’: cannot convert from ‘int’ to RaycastHit_t19695F18F9265FE5425062BBA6A4D330480538C3’

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:30 (18 by maintainers)

github_iconTop GitHub Comments

3reactions
hawkwoodcommented, May 20, 2020

I opened a case with Unity and just got the following response:

—-

It looks like there is invalid IL code in Zinnia.Runtime.dll. The problem happens in the Zinnia.Data.Operation.Extraction.ValueExtractor<TResultElement,TSourceElement,TEvent,TEventElement>.ClearSource method. In this case, TSourceElement is UnityEngine.RaycastHit. The C# code for ClearSource (from ILSpy) is:

[CompilerGenerated] public void ClearSource() { Source = (TSourceElement)null; }

Since UnityEngine.RaycastHit is a struct, it is not nullable, and therefore cannot be set to a value of null.

I don’t believe this is something we can correct on the Unity side.

1reaction
Bullrichcommented, May 22, 2020

I just tried with the new version and couldn’t replicate the issue anymore. Thank you very much for the fix!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Develop v0.1.0 by monry · Pull Request #43
Breaking Changes. * Send `UniRx.Unit` into connecting flows instead of `Message` to omit data messaging. ### Implementations. * Implement ValueExtractor.
Read more >
io.extendreality.zinnia.unity
> There is an edge case where the CollisionNotifier will still attempt to get a list of Notifiers when the object has been...
Read more >
Why Facebook's api starts with a for loop
This vulnerability is called JSON hijacking, and allows websites to extract the JSON data from those API's. Origins. In JavaScript 1.5 and ...
Read more >
Semantic Analysis and Computational Modeling of Legal ...
This thesis introduces a methodological and conceptual framework, incorporating estab- lished theories from legal theory, to provide software- ...
Read more >
IMPORTANT NOTE TO READER:
IMPORTANT NOTE TO READER: The following document contains excerpts from the Central Gulf Coast aquifer. Groundwater Availability Model (GAM) ...
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