Closed sixprime closed 4 months ago
I was able to reduce the scenario to:
struct Foo
{
int id;
};
int main()
{
flecs::world world;
auto snapshot1 = flecs::snapshot(world);
snapshot1.take();
world.component<Tag>();
snapshot1.restore();
return 0;
// crashes in v3 on world destruct
}
Another repro:
ecs_world_t* world = ecs_mini();
ECS_COMPONENT(world, foobar);
ecs_entity_t e = ecs_new_id(world);
ecs_add(world, e, foobar);
ecs_set(world, e, foobar, { 10 });
ecs_snapshot_t* snap = ecs_snapshot_take(world);
ecs_entity_t f = ecs_new_id(world);
ecs_add(world, f, foobar);
ecs_set(world, f, foobar, { 11 });
ecs_snapshot_restore(world, snap);
ecs_entity_t c = ecs_new_id(world);
ecs_add(world, c, foobar);
ecs_set(world, c, foobar, { 11 });
ecs_fini(world);
Closing issue, as the snapshot feature has been removed from v4.
Describe the bug Internal Flecs crash on invalid pointer after trying to update the world following a snapshot restore.
To Reproduce Cf minimal repro source code below :
Expected behavior I'm expecting the world state to be properly restored and in a state where I can keep using it.
Additional context Flecs version used : 2.6.4. But also crashes with a different callstack on Flecs 3.0.1.