Description
Tested versions
All 3.x up to 6c3f393 at least.
System information
All
Issue description
In 3.x, ObjectID
is 64 bit, however it turns out there are a few places that are storing / passing these ids as 32 bit values.
This can lead to haywire behaviour when ObjectID
overflows 32 bit due to object churn (the id is currently incremented on each new object).
Steps to reproduce
Examples:
- [3.x] Fix
EditorNode::push_item
using 32 bit forObjectID
#107613 PhysicsServer::body_attach_object_instance_id(RID p_body, uint32_t p_id)
PhysicsServer::body_get_object_instance_id()
godot_instance_from_id
(GDNative basically is handlingObjectID
as 32 bit)EditorNode::_edit_current()
Minimal reproduction project (MRP)
N/A
Discussion
4.x moved over to using an ObjectID
class, and it may be worth trying to see whether this is possible in 3.x to catch these errors at compile time, as otherwise these kind of bugs are difficult to track down in an automated way. I tried this a while back but got stuck, but it may be worth perservering.
4.x version:
"ObjectID converted to a structure, fixes many bugs where used incorrectly as 32 bits."
cf8c679
So the 32 bit bugs were noticed but never fixed in 3.x.
I noticed this during a rewrite of ObjectDB
which requires the full 64 bits, and it was detecting these errors where the values were being truncated.
Metadata
Metadata
Assignees
Type
Projects
Status