Skip to content

Fix Crashlytics abort on binary image records with a non-numeric base or size - #16547

Open
JayPatel095 wants to merge 3 commits into
firebase:mainfrom
JayPatel095:fix/16519-symbolresolver-nonnumeric-base
Open

Fix Crashlytics abort on binary image records with a non-numeric base or size#16547
JayPatel095 wants to merge 3 commits into
firebase:mainfrom
JayPatel095:fix/16519-symbolresolver-nonnumeric-base

Conversation

@JayPatel095

Copy link
Copy Markdown
Contributor

Discussion

Fixes #16519.

FIRCLSSymbolResolver drops binary image records whose base/size are missing or NSNull, then sorts with [base1 compare:base2] without checking base is a number. If its a string NSNumber sends objCType to it and the process dies with an uncaught NSInvalidArgumentException. This happens on Crashlytics'queue while processing a report at launch, so an app doesn't catch it, and Crashlytics reports its own abort as an application crash.

This replaces both checks with a single isKindOfClass:[NSNumber class] test on base and size. It covers the old cases ([nil isKindOfClass:] is NO; NSNull is not an NSNumber) and also rejects strings, arrays, and dictionaries, which abort the comparator the same way. A string size is dropped too, it passes the current fliter but crashes later in loadedBinaryImageForPC: on -[NSString unsignedIntegerValue]. No public API change.

Testing

xcodebuild test -scheme FirebaseCrashlytics-Unit-unit -destination 'platform=iOS Simulator,name=iPhone 17'

Added testLoadingBinaryImagesWithStringBaseValue, a fixture with one string base which crashes the current code and is skipped after the change, like the existing null case.

@gemini-code-assist

Copy link
Copy Markdown
Contributor
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

@JayPatel095

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request fixes a crash in FIRCLSSymbolResolver when processing binary image records with non-numeric base or size values by ensuring they are instances of NSNumber. It also adds a corresponding unit test and test data. The feedback suggests extracting the base and size dictionary lookups into local variables to avoid redundant lookups and improve readability.

Comment thread Crashlytics/Crashlytics/Models/FIRCLSSymbolResolver.m Outdated
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@JayPatel095
JayPatel095 force-pushed the fix/16519-symbolresolver-nonnumeric-base branch from 8f91bf4 to 9455f4e Compare August 25, 2026 02:28
@JayPatel095

Copy link
Copy Markdown
Contributor Author

Attempt number 3!

@paulb777

Copy link
Copy Markdown
Member

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request fixes a crash in FIRCLSSymbolResolver when processing binary image records with non-numeric base or size values (such as strings) by ensuring they are instances of NSNumber. It also adds a unit test and corresponding test data to verify this behavior. The feedback suggests strengthening the new unit test by asserting that the invalid entry is skipped and valid entries are successfully loaded, rather than just verifying that the load method succeeds without crashing.

Comment thread Crashlytics/UnitTests/FIRCLSSymbolResolverTests.m
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Crashlytics aborts in FIRCLSSymbolResolver when a binary image record has a non-numeric base

2 participants