Skip to content

Variable _debug isn't thread safe #290

@RaimundasSakalauskas

Description

@RaimundasSakalauskas

I am investigating on a crash happening in appirater. Firebase lists it as: -[Appirater incrementUseCount] + 434. If we assume that the stacktrace is accurate, it shows this line:

if (_debug)
     NSLog(@"APPIRATER Use count: %@", @(useCount));

Before we call Appirater.appLaunched(true) we are setting Appirater.setDebug(false) on a main thread. Looking at the code, I can see that static variable _debug is used without any thread safety around it.

BTW, this only happens to 0.03% of our users so chances of reproducing that are fairly low :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions