[Bug] Analytics Demo EXC_BAD_ACCESS when internet connection is flaky

There seems to be a bug in JUCE Modules/juce_analytics/destinations/juce_ThreadedAnalyticsDestination.cpp that manifests when internet goes away temporarily and the exponential back off occurs.

Steps to reproduce on macOS:

using the demo : https://docs.juce.com/master/tutorial_analytics_collection.html

  1. disconnect internet
  2. start demo
  3. watch a couple of “nw_socket_connect connectx failed: [64] Host is down” messages pass
  4. reconnect internet
  5. EXC_BAD_ACCESS that stems from eventQueue.pop_front(); on line 118

It’s not confined to macOS though.

Are you using the very latest version of JUCE? This bug was fixed one or two weeks ago.

OK great I’ll try that, I had updated JUCER but forgot to pull the repository

I’ve tried with master and develop branches of JUCE and still have same behaviour in the demo.

Hi Richie (& Fabian)
I experience the same issue as you describe. I have tested with JUCE 5.2 and the latest (from yesterday), with the same crash. As you can see from the screenshot the code in the juce_ThreadedAnalyticsDestination is trying to pop elements that are non existing. In this case the eventsToSend.size() was 8 but the eventQueue.size was only 3. I also experienced this issue when connecting/disconnecting the internet connection.
Best regards
John

Fixed on the develop branch.

Could you please give this a try? If all’s well then I’ll cherry pick it to the master branch.

Hi t0m
I have tested it for more than a hour now, and I did not see the issue. I think its fixed now.
Thanks a lot
John

Also working fine for me too after denying a few attempts then allowing them through, thanks @t0m :slight_smile:

This fix is also on master now.

1 Like