Mac Terminal - 'pointer being freed was not allocated' error when opening terminal - macos

I get the following message when opening the terminal on mac
Last login: Tue Mar 11 14:33:24 on console
login(291,0x7fff78af9310) malloc: * error for object 0x7f974be006f0: pointer being freed was not allocated
* set a breakpoint in malloc_error_break to debug
[Process completed]
... and I don't seem to be able to escape it. I've been having some weird permissions problems with Adobe CC - could the two be symptoms of a single problem?

It looks like you don't have the right permissions on the /usr/bin directory.
Solution for OS X 10.11 (El Capitan) and later:
Install Onyx 3.1.3 app (Free analog of Disk Utility)
Choose 'Maintenance' -> 'Permissions' -> 'Execute'.
Solution for older versions of OS X:
Open 'Disk Utility' app -> Press 'Repair Disk Permissions'.
It will set default permissions for the /usr/bin directory.
If this step doesn't help try this:
Delete com.apple.terminal.plist from the ~/Library/Preferences folder;

Running on Mac OS X Mavericks just
Open "Disk Utility" app -> Press "Repair Disk Permissions"
Solved the problem
I couldn't find any com.apple.terminal.plist in the ~/Library/Preference folder

I had a similar issue while running OSX 10.11.6. I got a similar error when I ran certain commands, but it did not force bash to exit. It just aborted the command.
I tried running Onyx and repairing disk permissions via command line with no results (along with about another 100 or so desperate "fixes").
Eventually, I tried upgrading to a newer version of bash, which fixed the problem. To do this:
brew install bash
sudo -s
echo /usr/local/bin/bash >> /etc/shells
chsh -s /usr/local/bin/bash
Restart the computer.
I write this in the hopes that if someone else has this error they have one more fix to try!

I tried running the Disk Utility and it kept crashing. I had to run it from OSX Recovery Mode.
You can enter OSX Recovery Mode during system boot by holding down CMD ⌘+R as your mac is booting up. Choose Disk Utility when it reaches the Recovery Options screen.

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.

Related

Unable to open LiClipse 6.1.0 on MacOS/Catalina (10.15.3)

I have downloaded LiClipse 6.1.0 from http://www.liclipse.com/download.html three times (to ensure that I don't have a corrupt/damaged file) and installed it on a MacPro Notebook with MacOS Catalina (10.15.3). I have followed the installation instructions at http://www.liclipse.com/download.html for Native Mac OS Install, but every time I get "“LiClipse.app” is damaged and can’t be opened. You should move it to the Trash."
Since it gets installed without any problem, I think that downloaded file is not corrupted/damaged, but when opening it I always get the warning about its being damaged even when I have run sudo spctl --master-disable to enable apps from "Anywhere" to run.
I would appreciate if anyone who had succeeded in opening it on a MacPro/Catalina would share his/her steps. Thanks.
You can try removing the quarantine flag (when Mac downloads a file it marks it as quarantined and it won't run unless it has an Apple signature -- which LiClipse doesn't have, so, Apple is making it always a bit harder to run files you download).
To remove the quarantine flag, run:
xattr -d com.apple.quarantine <FILE>
(<FILE> being /Applications/LiClipse.app and maybe /Applications/LiClipse.app/MacOS/LiClipse too -- I don't really have Catalina to check).

Xcode stuck on "Installing components..."

Xcode keeps getting stuck on "Installing components...", it stops at around 40%. I've let it sit for a whole night, reinstalling it from the App Store and searching for solutions on the internet, but all with no succes.
When I Force Quit and restart Xcode, it does the same thing except that the progress bar immediately jumps to 100% but after that it won't budge. I can only get back to the 40% when i restart my computer.
I have Xcode version 9.4 and i'm running macOS High Sierra (10.13.5).
Question asked when starting the app
Installation stuck at 40%
Installation stuck at 100%
Edit: I've fixed it by deleting some .kext files that were messing things up. Found the following on an Apple Community post:
Open Terminal in /Applications/Utilities
Enter "system_profiler SPExtensionsDataType > ~/Desktop/kextList.txt" without the quotes and hit return(this will take a while to run).
There should now be a kextList.txt file on your desktop, open it and press both the "Apple(Command)" and "F" keys to bring up the find.
In the find field insert "Obtained from: Not Signed" Copy the destination to the .kext file to a list for use later.
Browse your drive to /System/Library/Extensions and remove any of the unsigned kext files.
Reboot and you should be all set.
Starting MacOS in Safe Mode and the starting Xcode should fix the issue. I tried in MacOS High Sierra 10.13.6 and it worked perfectly.

"restricted" folder/files in OS X El Capitan

After upgrading from OS X Yosemite to OS X El Capitan Developer Preview, I tried to edit /System/Library/LaunchDaemons/ssh.plist to change the default SSH port to a custom one. This is the process I've been using for a couple of years.
The problem is that El Capitan doesn't allow me to change anything in this folder (not even with "sudo"). The folder and its files are marked as "restricted" when I list the contents with "ls -lO". The same folder listing in previous versions of OS X does not show "restricted".
Is this something new to OS X El Capitan? How can I edit files/folders that are "restricted"?
I found out this is due to a new feature introduced in El Capitan called "SIP" (System Intregrity Protection).
Read more here: https://forums.developer.apple.com/thread/4731?q=SIP
Unfortunately, no one suggested a way of editing "restricted" files/folders without actually disabling SIP.
You can also temporarily disable SIP the following way
reboot
as soon as you hear the "Mac sound" on the grey screen, press Cmd+R to enter Recovery mode
Open Utilities->Terminal
Run the command csrutil disable
Reboot, you'll land in the normal OS with SIP disabled
do all the changes you'd like to do
Reboot again
as soon as you hear the "Mac sound" on the grey screen, press Cmd+R to enter Recovery mode
Enable SIP with csrutil enable
Reboot again
done
Until 10.11 unprotects certain files in /System/Library or allows you to do it yourself, the only way without disabling SIP would be to make a different service by coping the file somewhere else, like:
sudo cp /System/Library/LaunchDaemons/ssh.plist /Library/LaunchDaemons/ssh.plist
And then instead of using the Sharing panel in System Preferences, you would manage the service yourself:
sudo launchctl unload /Library/LaunchDaemons/ssh.plist
sudo launchctl load -w /Library/LaunchDaemons/ssh.plist
I would suggest you try adding whatever arguments you need to a plist in /Library/Preferences/. For example, in my case I needed to make a slight alteration to mDNSResponder to add the AlwaysAppendSearchDomains flag. As suggested by "bwells" on the Apple developer forums, I just had to do
sudo launchctl unload /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist
sudo defaults write /Library/Preferences/com.apple.mDNSResponder.plist AlwaysAppendSearchDomains -bool YES
sudo launchctl load /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist
This is a much cleaner approach and persists across reboots and should also survive an upgrade (at least during the betas my manual changes after disabling SIP were overwritten). Note, as far as I know this is new to El Capitan.
You can also leave SIP enabled while disabling the filesystem management. Reboot in recovery mode and run:
csrutil enable --without fs
This will allow you to change permissions as needed.
Just boot into "Recovery" mode by pressing "CMD+R" while rebooting.
Open Terminal
Your disk will be mounted in /Volumes/Macintosh HD
Delete files via "rm" : you have absolute control in that terminal.
I use carbon copy cloner to make clonable backups... and have several in rotation.
According to mike at bombich "SIP only applies to the volume you're currently booted from, so [one can] boot from the backup volume to delete [files]".
I did use johannes' answer (recovery drive, csrutil enable/disable), but that requires reboot —> recovery drive —> turn sip off —> reboot —> delete crap —> reboot —> recovery drive —> turn sip back on —> reboot ... four reboots.
But booting from a clone and seeing the original drive as a secondary drive would allow you to delete problematic files in two reboots... yes?
You can "by pass" the SIP protection by modifying permissions on file via Finder app for the system group.
modifying permissions
It worked fine for me even after reboot, i'm running
ProductName: Mac OS X
ProductVersion: 10.11
BuildVersion: 15A284

my terminal can't run on mac os 10.9?

I used to install something from github,I stoped it and I can't open iterm-2 too
and I open my Bash ,it appeared
Command not found: /usr/local/bin/bash
[Could not create a new process and open a pseudo-tty.]
I can't input any words.
What should I change?
Google is full of others asking for help with this problem and half-baked solutions, including reboots (re-login should do it if env changed), reinstall (why?) etc.
Looks like a clone of I messed up my terminal environment on Mac OS X and was wondering how to fix it judging by inability to start bash from /usr/local/bin. System default should be in /bin or /usr/bin.
Your terminal (console or iterm2) may have an option to specify shell explicitly, used that.

Can't launch anything from terminal after uninstalling fink! Mac Lion

I've got a big problem, I can't launch anything from the terminal, not python, not emacs (or aquamacs), not even 'which'.
I was using homebrew to try to install ffmpeg and was having difficulties so I decided to pay attention to the warning that always come up advising me to uninstall fink. I removed the sw directory from my root directory, which is what the fink website told me to do and was confirmed on many blogs and message boards after a quick google search.
And since then nothing has worked, I'm almost certain that this was the cause of the problem because after removing sw I immediately tried home brew again and it said 'brew: command not found'. I get the same warning with any and every program I try to launch.
I use Mac OS Lion on a 6 year old MacBook.
Any ideas?
You probably busted your PATH. You can use absolute paths to commands until you get it fixed. For example:
/bin/mv ~/.profile ~/.profile.bak
/bin/mv ~/.bash_profile ~/.bash_profile.bak
Then open a new Terminal window, where standard things should now work. and repair your profile script.

Resources