Comments (5)
Can you provide a reproducer for this issue?
Both size
and value
should be initialized (size to 0 by flecs_cmd_new
, value by flecs_enqueue
), so I think something else might be causing this. I also tried to initialize the result of ecs_vec_append_t
with random data, which also didn't reproduce the issue.
from flecs.
Yesterday's description of the crash was not very clear
`
void flecs_stack_free(
void *ptr,
ecs_size_t size)
{
// crash when cmd->is._1.size > ECS_STACK_PAGE_SIZE
if (size > ECS_STACK_PAGE_SIZE) {
// but ptr is stack ptr when EcsCmdEvent
ecs_os_free(ptr);
}
}
`
I'll try to reproduce this problem
from flecs.
Here are code will crash on my pc (Win11), flecs v3.2.9
`
#include <flecs.h>
#include <iostream>
static const uint64_t PLAYER_SIZE = 8888;
static const uint64_t EFFECT_SIZE = 10;
static const uint64_t PLAYER_COUNT = 20;
static const uint64_t EFFECT_COUNT = 20;
struct Player{
char data[PLAYER_SIZE] = {};
};
struct Effect {
char data[EFFECT_SIZE] = {};
};
int main() {
flecs::world world;
world.component<Player>();
world.component<Effect>();
world.system<Player>()
.each([](flecs::entity p, Player){
Effect effect = {};
for(int i = 0; i< EFFECT_COUNT;++i) {
p.world().event<Effect>()
.ctx(effect)
.id<Player>()
.entity(p)
.enqueue();
}
});
world.observer<>()
.event<Effect>()
.term<Player>()
.each([](flecs::entity){
std::cout << "do effect" << std::endl;
});
world.defer_begin();
for(int i = 0; i< PLAYER_COUNT; ++i) {
auto player = world.entity();
player.set<Player>({});
}
world.defer_end();
// ecs_log_set_level(3);
world.app().target_fps(20).run();
return 0;
}
`
ps : if change PLAYER_COUNT = 1, EFFECT_COUNT =1, will crash on malloc function or free function (in random). maybe same reason cause whem memry is bad
from flecs.
That reproduced! Thanks :)
from flecs.
Fixed!
from flecs.
Related Issues (20)
- Correct way to manually specify entity ids HOT 2
- Assignment within conditional expression error HOT 1
- When deleting an entity, the next created entity gets a bad ID (FLECS 3.2.9) HOT 1
- observer loss event HOT 2
- [Question] Best way to share a component between differents entities HOT 3
- README link is broken HOT 1
- Compilation failed with errors when declaring 'free' as a macro. HOT 1
- Explorer hierarchy incomplete HOT 6
- free(): invalid pointer when using sorted query with std::list HOT 1
- Bug or question - HOT 1
- Lockstep support, or deterministic calculations. HOT 7
- filter_builder() assert fail, when use term().or_() HOT 2
- Queries with Or terms and wildcard terms cause internal error HOT 1
- entity::set(T*) writes garbage HOT 1
- ECS crash after conditionally adding to an entity when using Explorer HOT 7
- flecs crashes at startup when using clang built from git
- I get exception errors in ms visual studio 2019 before the main function HOT 7
- Unintuitive behavior of setting entity names as numbers HOT 3
- Enabling or disabling a component between defer_suspend and defer_resume keeps the world deferred after progress
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flecs.