Git Product home page Git Product logo

Comments (5)

ashare80 avatar ashare80 commented on May 27, 2024

Hmm maybe there's a race condition that's causing the loop to be run more than once. I'll look into it.

If you can recreate the bug, could you check to see which object is causing the problem from the memory location (0x7ffa01ae89b8) in the debugger?

from tsclustermapview.

yorgosg avatar yorgosg commented on May 27, 2024

will do, thanks!

On Feb 11, 2015, at 01:02 , Adam Share [email protected] wrote:

Hmm maybe there's a race condition that's causing the loop to be run more than once. I'll look into it.

If you can recreate the bug, could you check to see which object is causing the problem from the memory location (0x7ffa01ae89b8) in the debugger?


Reply to this email directly or view it on GitHub.

from tsclustermapview.

jpmhouston avatar jpmhouston commented on May 27, 2024

I've also seen crashes in initAnnotationPools: when running in the simulator, this is one of them I've seen a few times, when called from mapView:regionDidChangeAnimated::

if (!_clusterAnnotationsPool) {
    _clusterAnnotationsPool = [[NSMutableSet alloc] initWithCapacity:numberOfAnnotationsInPool];
    for (int i = 0; i < numberOfAnnotationsInPool; i++) {
        ADClusterAnnotation * annotation = [[ADClusterAnnotation alloc] init];
        [_clusterAnnotationsPool addObject:annotation];
    }

    toAdd = _clusterAnnotationsPool.allObjects;  <----- here
}

The message printed to the lldb console:
Description of exception being thrown: '*** -[__NSPlaceholderArray initWithObjects:count:]: attempt to insert nil object from objects[450]' Warning: hit breakpoint while running function, skipping commands and conditions to prevent recursion.

And interestingly, while 180 is passed in and numberOfAnnotationsInPool is 360, clusterAnnotationsPool has 617 objects. Printing this object in lldb at this point shows 556 ADClusterAnnotation objects and 61 "(null)"! Could it be multiple threads trying to modify clusterAnnotationsPool and corrupting it? [Answer: YES!! see the Edit at the end]

At the time of this crashed on the main thread, another thread was running the tree building queue and seems to be starting TSClusterOperations, I don't happen to see anything that touches clusterAnnotationsPool.

Edit: I just saw a different crash, and both the main thread and the tree building queue were both in initAnnotationPools:! So yes, I'd guess that these crashes are all because clusterAnnotationsPool gets modified by multiple threads simultaneously. Should locks or similar mechanism be added to prevent this, at what level of granularity? Or is a minor redesign warranted to adjust what's done in background threads?
For now, I'm deferring my call to setRegion:animated: on the main thread to hopefully avoid this (deferring it until the first call to mapViewDidFinishRenderingMap: having the effect of rendering the world map then zooming in)

from tsclustermapview.

ashare80 avatar ashare80 commented on May 27, 2024

@jpmhouston thanks for pointing this out. I'll try to get out a fix asap

from tsclustermapview.

ashare80 avatar ashare80 commented on May 27, 2024

@jpmhouston Just pushed new version see if that resolves the issue

from tsclustermapview.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.