Iglistkit: IGListAdapter malloc: pointer being freed was not allocated

Created on 3 Apr 2017  路  14Comments  路  Source: Instagram/IGListKit

New issue checklist

General information

  • IGListKit version: 2.1.0
  • iOS version(s): 10.3
  • CocoaPods/Carthage version: 0.20.1
  • Xcode version: Version 8.3 (8E162)
  • Devices/Simulators affected: all

in method

- (void)performUpdatesAnimated:(BOOL)animated completion:(IGListUpdaterCompletion)completion {

of

IGListAdapter.m

there is a completion handler for performUpdates that does the following:

completion:^(BOOL finished) {
                                     // release the previous items
                                     weakSelf.previoussectionMap = nil;

for some reason I don't understand, in my current setup I get the following issue when I performUpdates:

malloc: *** error for object 0x7f90cd036000: pointer being freed was not allocated

I am unsure on how this is happening, but I don't understand how this can fail.
I get this both by calling adapter.performUpdates

and sometimes by navigating back from a controller to another (in this case the adapter could be deinitialized because it reacts to some data changes triggered on the previous viewController)

I am sorry I don't have any example project that I can show, I would just like to know if this is a known issue due to a setup I did wrong

question

Most helpful comment

@iOSUser110 I'd recommend opening a new issue to track what is happening, and make sure to include everything @racer1988 listed (thank you!!).

waiting for your reply .. i am stuck because of this :(

We're a very small team maintaining this in addition to our fulltime role, please give us at least a day to get back!

We've also included debugging tools like the debugger dump so that you can get an investigation started on your own, greatly increasing the time it takes for us to understand the problem and assist.

(lldb) [IGListDebugger dump]

All 14 comments

Hmmmm this is really bizarre. What is doing the deallocation? Do you have a stack and/or know what is trying to be deallocated?

FWIW I haven't ever seen this before.

Not observed on our project either. We use IGListKit in multiple different setups and configurations and we have never seen this (sorry this is not very helpful)

I will try to see if I can extract part of the code, and a stacktrace.

But the idea is that:

  • I do a network refresh
  • the data is saved in coredata
  • this triggers a performUpdates
  • All ViewModel objects used by IGListKit are regenerated.
  • Malloc crash

This happens with one of the example projects:
https://github.com/Instagram/IGListKit/blob/master/Examples/Examples-iOS/IGListKitExamples/SectionControllers/EmbeddedSectionController.swift

I suspect the issue could be that the section controller in the external collection view is rebuilt, and this removes the internal adapter of the EmbeddedSectionController from memory, while it is still processing some updates?

Note:
I only do performUpdates on the extenal adapter, never on the internal one.

@racer1988 How do you make the nested demo crash w/ this?

Also can you try pointing to master and see if the issue repros still?

I did not make the Demo Crash, but my code crashes only in that type of nested collection views.

I am redoing some work on my project and integrate things little by little to see if I find the culprits and I can isolate the issue in a demo project

going to close this for now, we can re-open if we determine this is an issue with the library

image

Crash on testing, occasionally. This time it's in test_whenDidUpdateAsyncReloads_withBatchUpdatesInProgress_thatReloadIsExecuted

I am getting the same kind of crash..I am trying to use adapter.datasource = self
On that it is getting the app freeze and cpu usage upto th 95 % .
after long time app carshed because of some memory issue.
Not getting the solution for this kindly look at this as early as possible ...

And this is happeining only when push from one controller to another

waiting for your reply .. i am stuck because of this :(

@iOSUser110 Could you please provide more details in order to identify the issue?

What version of XCode are you using?
What version of IGListKit?
Did you check that you are doing the setup and the push from the main thread?
Can you provide your project for testing?
If not, can you provide the IGListKit setup code?

Since you are saying your CPU goes up to 95%, it feels like there is a infinite recursion in your code, that could be, for example, performingUpdates while it is already performingUpdates maybe in another dispatch block

@iOSUser110 I'd recommend opening a new issue to track what is happening, and make sure to include everything @racer1988 listed (thank you!!).

waiting for your reply .. i am stuck because of this :(

We're a very small team maintaining this in addition to our fulltime role, please give us at least a day to get back!

We've also included debugging tools like the debugger dump so that you can get an investigation started on your own, greatly increasing the time it takes for us to understand the problem and assist.

(lldb) [IGListDebugger dump]

any one found solution for this ?

@iOSUser110 see my previous reply

Sent with GitHawk

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cikpis picture cikpis  路  16Comments

jessesquires picture jessesquires  路  19Comments

jessesquires picture jessesquires  路  16Comments

RamblinWreck77 picture RamblinWreck77  路  17Comments

racer1988 picture racer1988  路  16Comments