Skip to content

Intermittent crash in FUtilities.intForString #9096

Closed
@softwaresaiyajin

Description

[REQUIRED] Step 1: Describe your environment

  • Xcode version: 13.0
  • Firebase SDK version:8.9.1
  • Installation method: Swift Package Manager
  • Firebase Component: Database
  • Target platform(s): iOS

[REQUIRED] Step 2: Describe the problem

  • It appeared when we started using the SDK as dependency of one of our SPM package, before, we were using cocoapods and it was fine.
  • FirebaseDatabase entities get mapped when app is launched and it intermittently crashes in FUtilities.intForString

Steps to reproduce:

What happened? How can we make the problem occur?
This could be a description, log/console output, etc.

  • Happens when we launch the app since we starting mapping entities immediately
  • Attached (crashlog.txt) is the crash report

If you have a downloadable sample project that reproduces the bug you're reporting, you will
likely receive a faster response on your issue.

Relevant Code:

// TODO(you): code here to reproduce the problem
+ (NSNumber *)intForString:(NSString *)string {
    static NSCharacterSet *notDigits = nil;
    if (!notDigits) {
        notDigits = [[NSCharacterSet decimalDigitCharacterSet] invertedSet];
    }
    if ([string rangeOfCharacterFromSet:notDigits].length == 0) {
        NSInteger num;
        NSScanner *scanner = [NSScanner scannerWithString:string];
        if ([scanner scanInteger:&num]) {
            return [NSNumber numberWithInteger:num];
        }
    }
    return nil;
}

Screen Shot 2021-12-14 at 11 11 55 AM
crashlog.txt

Activity

google-oss-bot

google-oss-bot commented on Dec 14, 2021

@google-oss-bot

I found a few problems with this issue:

  • I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
  • This issue does not seem to follow the issue template. Make sure you provide all the required information.
rizafran

rizafran commented on Dec 14, 2021

@rizafran
Contributor

Thanks for reporting, @softwaresaiyajin. Could you try updating your SDK to the latest version and see if you'll still encounter the issue? If so, could you share an MCVE reproducing the issue?

softwaresaiyajin

softwaresaiyajin commented on Dec 15, 2021

@softwaresaiyajin
Author

Will try that

paulb777

paulb777 commented on Dec 15, 2021

@paulb777
Member

The crash might be related to some particular data in the database. Are you able to catch the crash in the debugger and explore what is triggering the crash.

As mentioned above, a reproducible example would be helpful for diagnosis.

softwaresaiyajin

softwaresaiyajin commented on Dec 20, 2021

@softwaresaiyajin
Author

Crash still happening in 8.10.0. I cannot provide a reproducible example as it's happening intermittently. Seems to be the same as this one: firebase/quickstart-unity#809.

12 remaining items

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

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Intermittent crash in FUtilities.intForString · Issue #9096 · firebase/firebase-ios-sdk