Out of bounds write in lib\src\types\world\mod.rs #8
Labels
No labels
complexity
high
complexity
low
complexity
medium
importance
high
importance
low
importance
medium
type
bug
type
chore
type
feature suggestion
type
missing feature
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: thetxt/oxide#8
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
when first starting the server block place colision detection seems not to work
repeatedly placing blocks inside the player eventually leads to a out of bounds write which leads to a panic
after the panic the block placement seems to work as expected as well as doors and fence gates now start working
heres the code that has the issue
the issue is on line 182 in lib\src\types\world\mod.rs
here is the full stacktrace that clearly shows block_id being used to index into blocks but the length of blocks is 0
thanks for reporting this! At the moment that is still expected behavior as there isn't any logic yet that checks what is at the location of the new block. You can also overwrite blocks that already exist in a location.
Once the server panics the logic that's internal to the client doesn't get overwritten anymore, as no conflicting data is coming from the server anymore, so certain things look like they're properly working suddenly.
I will definitely get to this in the nearish future :)
actually Im not quite sure why this panic happens... It seems to be caused by trying to place a block in an empty chunk section
Upon closer inspection does it seem like all might not be good after the panic.
blocks placed and broken by other players just stop getting shared as well as commands no longer working
I'll keep looking into it
I think I fixed this in the branch 0.2.0
The panic was caused by an memory optimizations that didn't store block data for empty chunk sections. Fixed this by adding a check if the chunk section is empty and then initializing it with air blocks first, before writing to it