szeged / webrender

A GPU-based renderer for the web
https://doc.servo.org/webrender/
Mozilla Public License 2.0
45 stars 7 forks source link

Workaround for long rendy backtraces #285

Closed mmatyas closed 5 years ago

mmatyas commented 5 years ago

This patch implements the Drop trait for Device<hal::Backend>, which fixes the very long rendy-related backtraces that occur on errors and crashes.

Note: Because fields can't be moved out of types which implement the Drop trait (eg. in drop()), some of them were made into Option as a workaround. I'd be happy to update the code if there's a better way to implement this.

zakorgy commented 5 years ago

@kvark the long backtrace is created because rendy-memory allocators have these relevant fields, and as it's is described in relevant we can't just drop those allocators, we have to call their dispose function, which we do in our Device::deinit. However if we run into a crash we don't call this dispose, just drop the heaps field, and this causes these relevant fields yell at us, spamming the backtrace with a lot of errors.

kvark commented 5 years ago

Thanks @zakorgy ! It looks like a problem with Relevant to me. I filed to https://github.com/omni-viral/relevant/issues/1 to discuss.

zakorgy commented 5 years ago

I will close this because the issue is fixed in https://github.com/szeged/webrender/pull/287