0

I am developing an application in Xcode 8.1. It is used to find printers inside the network. It uses cpp files also for printer searching. But i got one error

malloc: *** error for object 0x6080000099f0: Invalid pointer dequeued from free list
*** set a breakpoint in malloc_error_break to debug

I enabled zombie to catch this exception but fails.Also i added malloc error break but fails. Added try catch but it shows error break inside try block. Please help me how to catch this exception and if someone already face this issue please help me how to solve this.

Jio
  • 1,146
  • 1
  • 9
  • 22
  • Have you tried to step through the code to see where it error happens? – NathanOliver Jan 23 '17 at 15:08
  • Yes. But its shows in the main file. in the Debug session it is not showing any specific file. – Jio Jan 23 '17 at 15:09
  • @Jio Did you try [this](http://stackoverflow.com/questions/14045208/how-to-set-a-breakpoint-in-malloc-error-break-to-debug)? – Steeve Jan 23 '17 at 15:10
  • Yes @Steeve But it is not exactly points which pointer that i am tried to dequeued. – Jio Jan 23 '17 at 15:13
  • @Jio You should have a stack when it breaks, doesn't it give any hints on where the error happens? Yes it won't tell you where the memory corruption happened but maybe it can tell you what call to free or delete fails for what pointer. – Steeve Jan 23 '17 at 15:16
  • No hint @steeve. It shows some threads and objc_release – Jio Jan 23 '17 at 15:29
  • Looks like you have corrupted the memory manager's internal data structures. It's not an exception that you can't catch (the process is so broken that it can't continue), and catching one wouldn't help much anyway because the ultimate cause of it may may have occurred long before this happens. – molbdnilo Jan 23 '17 at 15:30
  • @Jio Can you enable guard malloc in your scheme settings? That usually helps me finding the culprit. – Steeve Jan 23 '17 at 15:34
  • @molbdnilo yes. When i tried to fetch the printers from network it will not happens in the first time. When i tried multiple times it brakes. :( – Jio Jan 23 '17 at 15:38
  • @Steeve will check. Thanks – Jio Jan 23 '17 at 15:42
  • @Jio Any luck fixing the problem? – Steeve Jan 30 '17 at 09:11
  • No luck. Problem still exist @Steeve – Jio Jan 31 '17 at 15:50
  • @Steeve i fixed that issue by using analyse tool in xcode. I went through each exception and finally find the memory leakage. Thanks for your support – Jio Feb 03 '17 at 08:04
  • @Jio If you have the time, can you share your findings with the community in a form of an aswer to this question? – Steeve Feb 03 '17 at 08:15

0 Answers0