Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Project Tiny 0.26.0: ArgumentException in Windows build when calling AddComponent on ECB

Discussion in 'Project Tiny' started by yossi_horowitz_artie, Jul 2, 2020.

  1. yossi_horowitz_artie

    yossi_horowitz_artie

    Joined:
    Jan 30, 2019
    Posts:
    87
    I just reported this using the Unity Bug Reporter, but I thought I'd also mention it here:

    I'm working in Project Tiny 0.26.0. I have an ISystemStateComponentData which contains a struct which contains an IntPtr. I'm adding the component to an entity in a for-each acion inside of a ComponentSystem using the PostUpdateCommands entity command buffer.

    When I do this and run a Windows .Net build:
    - If the build configuration has burst enabled, it crashes without much of an explanation. If the visual studio debugger is attached to the build, visual studio crashes as well!
    - If the build configuration does not have burst enabled, I get an argument exception: "SetComponentData can not be called with a zero sized component and must have same size as sizeof(T)."

    The size of my component is 8 bytes (if I remember correctly). Because this problem was not happening in an earlier version of Tiny in which the Windows builds were 32-bit rather than 64 bits, my theory is that when the upgrade to 64 bits took place, the Type Manager was never told that IntPtrs are now 8 bytes instead of 4.

    I'm able to work around this problem for now by using a UInt64 in my struct instead of an IntPtr, but I would like to keep my code safe for compilation targeting both 32 bit and 64 bit platforms if possible.

    Thanks!
     
  2. AbdulAlgharbi

    AbdulAlgharbi

    Unity Technologies

    Joined:
    Jul 27, 2018
    Posts:
    319
    Thanks for reporting this I'll take a look and file a bug
    Sorry for the late respond
     
    NotaNaN likes this.