Skip to content

Update ClassFinder to use objc_copyClassList instead of objc_getClassList#1175

Merged
praveek merged 1 commit intoadobe:dev-v5.6.1from
praveek:dev-v5.6.1
Aug 15, 2025
Merged

Update ClassFinder to use objc_copyClassList instead of objc_getClassList#1175
praveek merged 1 commit intoadobe:dev-v5.6.1from
praveek:dev-v5.6.1

Conversation

@praveek
Copy link
Copy Markdown
Contributor

@praveek praveek commented Aug 13, 2025

Issue: #1174

Using objc_copyClassList is safer than objc_getClassList because it returns the entire list of classes in a single, fully allocated buffer. With objc_getClassList, we make the call twice and the number of classes can change between calls as new classes are registered. Although the class count should only increase, we have observed crashes caused by accessing null pointers or corrupted memory. I suspect part of the buffer we provide to objc_getClassList isn’t being filled correctly, and switching to objc_copyClassList should improve stability by providing a complete, reliable buffer containing all classes.

https://developer.apple.com/forums/thread/700770

@praveek praveek changed the title Update ClassFinder to use objc_copyClassList instead of objc_getClass… Update ClassFinder to use objc_copyClassList instead of objc_getClassList Aug 13, 2025
@praveek praveek merged commit 35ba324 into adobe:dev-v5.6.1 Aug 15, 2025
15 checks passed
@joonmanji
Copy link
Copy Markdown

@praveek FYI. this crash seems to still be happening for us on 5.6.1

@praveek
Copy link
Copy Markdown
Contributor Author

praveek commented Aug 28, 2025

@joonmanji If you have a crash report, could you share it in #1174? Also, is this happening in a RN app or a native app, and could you provide the list of other dependencies as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants