Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question]*** -[NSTaggedPointerStringCStringContainer retain] called, not supposed to happen #24

Open
simonbromberg opened this issue Feb 10, 2016 · 2 comments

Comments

@simonbromberg
Copy link

If I call GDCoreDataConcurrencyDebuggingBeginTrackingAutorelease(), I get many logs saying

*** -[NSTaggedPointerStringCStringContainer retain] called, not supposed to happen

Any idea what this means, how to fix it, and if it is a problem what is the effect? Can't even find where this message is called in the library.

Thanks

@GrahamDennis
Copy link
Owner

GDCoreDataConcurrencyDebugging does a bunch of hackery to get its job done. The autorelease tracking works by retaining objects that are sent autorelease messages and keeping track of the stacktrace for the original callstack where autorelease was sent.

So if you have code that looks like:

GDCoreDataConcurrencyDebuggingBeginTrackingAutorelease();

[myTaggedPointerStringCStringContainer autorelease]; // I don't actually know what this class is, but it's probably something internal to Apple.

GDCoreDataConcurrencyDebuggingEndTrackingAutorelease();

then when autorelease is called on myTaggedPointerStringCStringContainer, it will be sent a retain message.

So the upshot is feel free to ignore this, but there are a couple of steps that could be taken to avoid this:

  1. Don't try to track autorelease for tagged-pointer objects. These aren't 'normal' objects, and it doesn't make sense to track autorelease for these.
  2. We only actually want to track autorelease for CoreData-related classes, primarily NSManagedObject. Restrict tracking of autoreleases to just these classes.

@GrahamDennis
Copy link
Owner

Both of these require changes to - (id)gd_autorelease at the bottom of GDConcurrencyCheckingManagedObject. Feel free to submit a PR for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants