[Bug] Analytics Demo EXC_BAD_ACCESS when internet connection is flaky


#1

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.


#2

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


#3

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


#4

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


#5

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