Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PLAT-7722] Include free disk space in crash reports #1256

Merged
merged 1 commit into from
Dec 13, 2021

Conversation

nickdowell
Copy link
Contributor

Goal

Make device.freeDisk accurate for crashes.

Currently crash errors report the disk space available at the time of sending.

Changeset

  • Adds low-level function to retrieve and calculate the equivalent of NSFileSystemFreeSize.
  • Adds disk usage stats to BSG_KSSystemInfo - this gets used for handled errors.
  • Adds disk usage stats to crash reports.

Async safety

This PR adds a call to fstat() in the crash handler.

This function is not documented as being async-safe but should be by virtue of being implemented as a syscall.

Testing

Manually verified that the calculated free space matches NSFileSystemFreeSize.

E2E tests verify that freeDisk is present in all types of error.

@github-actions
Copy link

github-actions bot commented Dec 9, 2021

Infer: No issues found 🎉

OCLint: No issues found 🎉

Bugsnag.framework binary size increased by 208 bytes from 1,253,320 to 1,253,528

Generated by 🚫 Danger

@nickdowell nickdowell merged commit fe4eb8c into next Dec 13, 2021
@nickdowell nickdowell deleted the nickdowell/fix-crash-freedisk branch December 13, 2021 15:18
@nickdowell nickdowell mentioned this pull request Jan 5, 2022
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.

3 participants