Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only.

    Please, do not make any changes to your username or email addresses at during this transition time.

    It's still possible to reply to existing private message conversations during the migration, but any new replies you post will be missing after the main migration is complete. We'll do our best to migrate these messages in a follow-up step.

    On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live.

    Read our full announcement for more information and let us know if you have any questions.

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


    Jan 30, 2019
    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.

  2. AbdulAlgharbi


    Unity Technologies

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