Terminal Error: pointer being freed was not allocated *** set a breakpoint in malloc_error_break to debug - Unable to Repair Permissions I'm getting an error when I open Terminal saying:

login(495,0x7fff77186000) malloc: *** error for object 0x7f8cdad0b780: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug

[Process completed]


I've read in several forums that this is usually a permissions issue and used to be able to be solved by using the Repair Permissions functionality in Disk Utility. Unfortunately, as of El Capitan, this functionality has been removed and is only accessible via Terminal by default. This has left me with a bit of a cyclical problem. 

As an alternative, I have tried repairing permissions with Onyx, however this simply freezes midway through the process.

I'm not sure if this is related but I'm also unable to download an OS X El Capitan (10.11.4) update from the Mac App Store - I click update, click Download &amp; Restart from the dropdown, it says "0 bytes of 1.56 GB - Calculating..." then nothing happens and the Update button reappears. I've read that OS X has started trying to repair permissions during updates which is why I suspect this may be related.

I've made a few efforts to use the repair permissions terminal command from Recovery Mode however Terminal has told me that it doesn't recognise the command - perhaps I'm doing something wrong here. 

Please let me know if anyone has come across this issue before or has any advice - thanks very much!
I had the same problem with my dev machine. After several hours of trying anything other than a reinstall I finally realized that was the only choice. It should have been the FIRST choice. SO EASY!


Back up the critical data (just in case) 
Enter the recovery mode by pressing cmd+r at start up
Choose "Reinstall Mac OS X"


That's it. When my computer restarted I was prompted for my Apple ID credentials and then my user loaded like normal, with a working Terminal, even. I didn't need to reinstall / restore anything. The whole process (including the user folder backup) took about 45 min.

Final step, remove all of the sketchy utilities installed trying to fix this without a reinstall.