Skip to content

New "Writing past the end of the buffer" issue in 1.5.1/1.5.2 (worked in 1.4.0) serializing a list of objects containing FixedString64Bytes #2655

@joelhoward0

Description

@joelhoward0

I have code that serializes a GameState type containing a list of StringContainers, each of which contains a single FixedString64Bytes. This worked in Netcode for Game Objects 1.4.0 - in the debugger, I see a FastBufferWriter with a capacity of 1300 bytes, which expands as I push in StringContainers past 1300 bytes.

In 1.5.2, this fails. In the debugger I see two instances of FastBufferWriter, one starting at a 1300 capacity, the other at 256. The one with 256 works until more bytes than that are needed, at which point instead of expanding it throws with a "writing past the end of the buffer" error. The one with 1300 expands as previously as GameState exceeds 1300 bytes.

I'm at a loss :/ I didn't see anything in the 1.5.1 or 1.5.2 changelog that seems related, and I don't understand why there are two separate FastBufferWriters writing this state, and why the smaller one blows up instead of expanding.

My smallest replication code so far is here: https://github.com/joelhoward0/unity-networking-sandbox/blob/4125f77151e5e475c1c76fa4a8184d84e3a3446e/Assets/Scripts/GameState.cs#L30.

Metadata

Metadata

Assignees

Labels

priority:highThis issue has high priority and we are focusing to resolve itstat:importStatus - Issue is going to be saved internallytype:bugBug Report

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions