-
Notifications
You must be signed in to change notification settings - Fork 667
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: When we find a `DexClass` via `type_class(DexType::get_type(name))`, then we must be careful! Since we never actually remove classes from the index referenced by `type_class`, the class might be 1) external, 2) internal (in scope), or... 3) formerly internal, but meanwhile removed, and no longer in scope! In RMU, this has been happening forever, and it's usually benign. Except... if the removed class used to have annotation, which we have meanwhile also removed; and if the annotation had fields, then we actually released the field's memory. And attempting to access that later blows up. And this has recently become a problem, as some of the removed classes had indeed (Kotlin) annotations. This fixes the problem by making sure that RMU never inspects already removed classes. You might ask how we can possibly be referencing a removed class --- if there's a reference, then it shouldn't have been removed! However, there are many diverse ways of removing a class (the *RMUs can be, and are (!) configured with different ignore sets; RMU is not the only optimization that removes classes), and referencing a class (some optimization might introduce a new string that happens to match the name of removed class). So that's an orthogonal issue (that we still should look into). Reviewed By: ssj933 Differential Revision: D51837577 fbshipit-source-id: cd4d1002bb1d592e13f13681a0869df72a25d41e
- Loading branch information
1 parent
c2c4bb7
commit dba8805
Showing
4 changed files
with
18 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters