Skip to content

Crash in RollbarNotifier/Sources/RollbarReport/Report/Address.swift operator #363

@fabianmuecke

Description

@fabianmuecke

Describe the bug
I just ran into a situation where my app would always crash immediately on startup because of an arithmetic overflow in the - operator of Address.

This crash prevented the original crash report from being sent, so there was no recovering from this situation other than reinstalling the app so the previous crash report was no longer there on app start. This has me very worried for how many users might run into this in production without us ever knowing, because their crash reports will also never be uploaded unless they try to uninstall and reinstall the app.

Unfortunately I do not have a crash report of the incident, just a screenshot I took after attaching a debugger to see why the app was crashing.

To Reproduce
Steps to reproduce the behavior:

  1. Have a crash report with odd addresses
  2. Call Rollbar.initWithConfiguration(_:)
  3. See it crashing in Address.swift line 55 due to arithmetic overflow of the address.

Expected behavior
Rollbar shouldn't crash when it finds unexpected data / addresses.

Screenshots
Image

Rollbar-Apple SDK version: v3.3.3

Calling the SDK from (x-mark all suitable):
[ ] Objective-C
[x] Swift
[ ] Other:

Runtime environment (please complete the following information as applicable):

  • Device: MacBook Pro (M1 Max)
  • OS: macOS
  • OS version: 15.4.1

Smartphone (please complete the following information):

  • Device: iPhone 14 Pro
  • OS: iOS 18.4.1

Additional context
I quickly tried a Copilot suggestion of using overflow safe &- instead of - for the address subtraction, and all tests were still succeeding, plus my app stopped crashing, so maybe this is a possible fix?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions