HeapInspector-for-iOS icon indicating copy to clipboard operation
HeapInspector-for-iOS copied to clipboard

Everything freezes

Open alexbartisro opened this issue 8 years ago • 15 comments

When I run my app with HeapInspector, I start it in AppDelegate in didFinishLaunching, a couple of seconds in running it, the simulator freezes. Both the record and heap buttons, and everything in my app stops responding to inputs. Issue reproduces both on simulator and on device.

Debug navigator shows like 10-20% CPU activity and about 10mbps of ram, which is regular app usage.

alexbartisro avatar Mar 07 '17 09:03 alexbartisro

do you have backtrace recording enabled? try to disable backtrace record HINSPDebug.recordBacktraces(false)

tapwork avatar Mar 08 '17 13:03 tapwork

@tapwork tried with both, on and off, there's no difference.

alexbartisro avatar Mar 08 '17 13:03 alexbartisro

did you try pausing the program execution in Xcode (a couple times) to see where it hangs?

tapwork avatar Mar 08 '17 13:03 tapwork

@tapwork

OSSpinLockLock(&backtraceDictLock);

from

static inline void registerBacktraceForObject(void *obj, char *type)

alexbartisro avatar Mar 08 '17 13:03 alexbartisro

thanks... I will investigate it in the next two days. looks like the backtrace recording . You're probably using a large app, right?

tapwork avatar Mar 08 '17 13:03 tapwork

Ran it now with recordBacktrace(false) and in froze in the same place.

Edit: also many thanks @tapwork

alexbartisro avatar Mar 08 '17 13:03 alexbartisro

alright...I can see the problem...the check for backtracerecord should be much earlier in the flow. There are lots of OSSpinLockLock that might cause the freezings. I will check in detail tonight or tomorrow

tapwork avatar Mar 08 '17 14:03 tapwork

You're a gentleman, thanks!

alexbartisro avatar Mar 08 '17 14:03 alexbartisro

I just released https://github.com/tapwork/HeapInspector-for-iOS/releases/tag/1.0.1 could you try this version (backtrace recording = disabled)

tapwork avatar Mar 08 '17 17:03 tapwork

Hello @tapwork

So I've manually added it and the good news are:

  • app ui is not frozen at launch
  • I can move the inspector by the black vertical bar now

And the bad news:

  • Everything freezes again when I tap on record in the same place as above
  • If I tap on "Heap" (after I restart the app) it crashes in HINSPHeapStackInspector.m at line 157 ([objects addObject:string];)

alexbartisro avatar Mar 09 '17 08:03 alexbartisro

@trusk89 thanks for helping, I will need some time to check this in detail. (next week or so) I'll keep you updated

tapwork avatar Mar 10 '17 07:03 tapwork

I have exactly the same issue, but no idea. swift 3.2 project.

yunzixun avatar Jan 18 '18 07:01 yunzixun

Same issue here.

bkrijgsman avatar Aug 10 '18 12:08 bkrijgsman

Currently I don't have the time to go into detail. I need to rethink the whole record feature

tapwork avatar Aug 21 '18 12:08 tapwork

I see the same issue when trying to add the SDK. Is this resolved?

Swagat-Mishra-Bose avatar Apr 09 '19 14:04 Swagat-Mishra-Bose