-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[core] Fix layer impl cast in render layer implementations #15398
Conversation
/cc @zugaldia @chloekraw @julianrex @LukasPaczos this needs backporting, should be a straightforward cherry-pick |
This PR puts `impl()` functions definitions into a nameless namespace to provide internal linkage and to make sure that appropriate cast function is invoked.
c3e6f3b
to
9e236a9
Compare
@tmpsantos @pozdnyakov, thanks. Please add a changelog entry and request me for review on this changelog entry before merging. |
Done in the latest commit, please take a look. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pozdnyakov thanks! comments are in
platform/android/CHANGELOG.md
Outdated
@@ -10,6 +10,7 @@ Mapbox welcomes participation and contributions from everyone. If you'd like to | |||
- Add fallback support to local ideograph font families [#15255](https://github.com/mapbox/mapbox-gl-native/pull/15255) | |||
|
|||
### Bug fixes | |||
- Fixed possible crash caused by invoking of the wrong cast layer implementation function [#15398](https://github.com/mapbox/mapbox-gl-native/pull/15398). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add "a" before "possible crash"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since the crash is only "possible", the verb clause should be "that could be caused by"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete "of" --> "invoking the wrong"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the last four words sound better as: "layer casting implementation function." but let me know if this is incorrect
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
layer implementation casting function - it casts Layer::Impl
instances.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah yeah, that’s perfect, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
platform/ios/CHANGELOG.md
Outdated
@@ -19,6 +19,7 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONT | |||
|
|||
### Other changes | |||
|
|||
* Fixed possible crash caused by invoking of the wrong cast layer implementation function. ([#15398](https://github.com/mapbox/mapbox-gl-native/pull/15398)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comments as in android changelog
b0ec5d4
to
059fcd6
Compare
@pozdnyakov @tmpsantos could you clarify, which commit was this regression introduced in and which releases require a backport? |
It's 4b21560 . Also, the issue would affect only debug build configurations, where these casting functions do not get inlined. |
On Android, we're shipping only release builds of GL-native in public artifacts so this wouldn't need patching if I understand correctly. |
IMO still better to patch, in case someone is building SDK from source and with modified build flags. |
This wouldn't require patch releases though, only CPs to release branches, right? |
Capturing from a chat with @pozdnyakov, we tested That said, I'll let you @pozdnyakov @chloekraw to make the final call. If we'd like to be super-safe, we can schedule the patch releases as well. /cc @tobrun |
Here is the branch, reproducing the issue https://github.com/mapbox/mapbox-gl-native/tree/mikhail_reproduce_layer_impl_cast_problem |
This PR puts
impl()
functions definitions into a nameless namespaceto provide internal linkage and to make sure that appropriate cast function
is invoked.
The problem was discovered by sanitize bot https://circleci.com/gh/mapbox/mapbox-gl-native/316959