You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm getting three different runtime (i guess) error depending on absolutely normal code changes
Failure Information (for bugs)
I was trying to implement ECS library. But at some point got stuck on this.
Steps to Reproduce
The error is really flaky and unpredictable. It may disappear on any code change. So please, try to reproduce by cloning the repo (branch: crap) and running make, repo: https://github.com/tymbaca/ecs/tree/crap
In cmd/main.odin there are 3 different main procedures, each will result in corresponding error:
package main
import".."import"core:fmt"import rl "vendor:raylib"
WORLD := ecs.new_world(Component)
main :: proc() {
mainSegFault() // <- change to any of main* proc below
fmt.println("at the end of main") // this will not run
}
mainBus :: proc() {
ecs.create_entity(
&WORLD,
Player_Control{},
Movement{speed = 1.0},
Box{size = {40, 50}, color = rl.RED},
Transform{},
)
fmt.println("after entity create")
}
mainIlligal :: proc() {
ecs.create_entity(
&WORLD,
Player_Control{},
Movement{speed = 1.0},
/* Box{size = {40, 50}, color = rl.RED}, Transform{},*/
)
fmt.println("after entity create")
}
mainSegFault :: proc() {
ecs.create_entity(
&WORLD,
Movement{speed = 1.0},
Box{size = {40, 50}, color = rl.RED},
Transform{},
Player_Control{}, // moved this to last position
)
fmt.println("after entity create")
}
mainOK :: proc() {
ecs.create_entity(
&WORLD,
// Movement{speed = 1.0},// Box{size = {40, 50}, color = rl.RED},
Transform{}, // this runs well LOL// Player_Control{},
)
fmt.println("after entity create")
}
The ecs.create_entity is pretty much a dummy:
// create_entity creates new entity with specified components, adds it to world and returns it
create_entity :: proc(world: ^World($T), components: ..T) {
// nothing happens here
}
I guess there is something wrong with the combination of generic type World -> Union type Component -> component: ..T
Failure Logs
make: *** [run] Segmentation fault: 11
make: *** [run] Bus error: 10
make: *** [run] Illegal instruction: 4
The text was updated successfully, but these errors were encountered:
Context
odin report
output:Expected Behavior
Expected healthy compile and run
Current Behavior
I'm getting three different runtime (i guess) error depending on absolutely normal code changes
Failure Information (for bugs)
I was trying to implement ECS library. But at some point got stuck on this.
Steps to Reproduce
The error is really flaky and unpredictable. It may disappear on any code change. So please, try to reproduce by cloning the repo (branch:
crap
) and runningmake
, repo: https://github.com/tymbaca/ecs/tree/crapIn
cmd/main.odin
there are 3 different main procedures, each will result in corresponding error:The ecs.create_entity is pretty much a dummy:
I guess there is something wrong with the combination of
generic type World
->Union type Component
->component: ..T
Failure Logs
The text was updated successfully, but these errors were encountered: