nical/guillotiere

Assertion fails when merging siblings during deallocation

Imberflur opened this issue · 4 comments

Any ideas for what is going wrong here?

Panic Payload: "assertion failed: `(left == right)`\n  left: `39`,\n right: `52`"
PanicInfo: panicked at 'assertion failed: `(left == right)`
  left: `39`,
 right: `52`', /home/pebeto/.cargo/registry/src/github.com-1ecc6299db9ec823/guillotiere-0.4.2/src/allocator.rs:1083:17

https://gitlab.com/veloren/veloren/issues/295

nical commented

Thanks for filing this bug. I don't have time to look into this in the next few days but I'll try to have a look soon.

nical commented

I kept quiet but I have spent a lot of time trying of reproduce the bug. Short of finding a way manually I have let the the allocator run in a fuzzer (cargo-fuzz) for a few days without finding any issues.

The only input that has been causing issues is passing zero or negative width or height to an allocation request, leading to something that triggers this assertion although one of the two operands was zero in my case. Other than that I am running out of ideas. I'll publish an update soon with a check check for empty/negative rects. If there is any way you can produce a test case that I could look at it would be great.

Unfortunately, I don't think I was ever able to reproduce this myself. Although from the reports I received, it seemed fairly deterministic. Maybe reproducibility is dependent on the size of the atlas? The good news is that I rewrote our usage so that is doesn't need to deallocate (which simplified it 🙂 ) so this isn't a pressing issue.

nical commented

I'll close this assuming the issue was caused by zero or negative width, since I wasn't able to come up with a test case via manual testing and fuzzing. Don't hesitate to open a new issue if the problem happens again.