servo / mozangle

Mozilla’s fork of Google ANGLE, repackaged as a Rust crate
Other
40 stars 21 forks source link

Heads-up: UB due to misuse of mem::zeroed will soon lead to panic #43

Closed RalfJung closed 3 years ago

RalfJung commented 4 years ago

Here, this crate causes UB by "Producing an invalid value". Concretely, it creates a ShBuiltInResources with mem::zeroed(). In the near future the call to mem::zeroed() will panic to avoid UB, and our crater run determined that this crate will be affected.

The reason that type cannot be zero-initialized is that 0 is not a valid value for ShArrayIndexClampingStrategy, which is the type of one of the fields of ShBuiltInResources.

staktrace commented 3 years ago

With rust 1.48 this error is now happening, blocking the servo/webrender repo from getting updates from mozilla-central. See https://github.com/servo/webrender/pull/4168#issuecomment-731373901