Getting "malloc" (error code=12)

swmckay

Registered
mac mini
10.5.8
1 GB 667 Mhz DDR2 SDRAM

Hello all,

I opened Terminal today and the following message popped up about a hundred times:


login(4687) malloc: *** mmap(size=2931998720) failed (error code=12)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug

I believe this is causing my litte box to act a little quirky.

Any guidance is greatly appreciated!
 

DeltaMac

Tech
The error shows that something on your Mac is attempting to allocate approximately 3 GB to some memory location, and is failing.
I think it's either a memory leak in some app that you are using, or a poorly programmed code running in Xcode.
What OTHER app are you using, in addition to the terminal?
If you are writing code, using Xcode, for example, your post might be better in the programming area, such as HERE: http://macosx.com/forums/software-programming-web-scripting/
 

swmckay

Registered
Deltamac, thanks for the quick reply.

Just to be sure, I rebooted and only opened Terminal and found the following again:

login(180) malloc: *** mmap(size=2931998720) failed (error code=12)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug

I don"t have any other apps open that i can find.

I am building a site using Joomla, but none of that is open at the moment.

Any further assistance is appreciated.
 

DeltaMac

Tech
Well - something continues trying to allocate memory incorrectly
Your Activity Monitor might be helpful to see what processes are actually running, and if any stop responding. Be sure to click the drop down to show All Processes, and not just My Processes. You can click on the header to sort by CPU usage, or Memory use, or whatever you like. That may give you a clue about some process that might be acting up for you.
You said that your mini is acting a little quirky... Can you expand on what you mean by that?

Here's what I would try, if I had your mini.
Download and reinstall the current combined OS X updater for your system. Get that here: http://support.apple.com/kb/DL866
The combined updater can often fix strange issues that might appear in OS X from time to time.
Another possible help would be to upgrade your installed RAM memory. You can double the RAM in your mini, and perhaps go higher, depending on which mini you have.
 

swmckay

Registered
The quirky issues:

When I attempt to log out it removes all of the icons but freezes at the wallpaper. I would manually power off and it would take forever to boot back to the login screen (I have a few extra accounts for the kids). Also, going into and out of screensaver it freezes and I have to hard reboot. I reinstalled the 10.5.8 update from the link you provided and it seems to have resolved these issues. Thank you for that tip.

Other remaining problems are generally apps will freeze like: mail, system preferences, terminal, finder for no particular reason. It will take some use to determine if this pops up again. But I am still getting the same error as originally when I open terminal...

The only other issue I think it might be is I recently added a Seagate external HD via USB. I was able to manually back everything up but Time Machine never worked so I turned it off. When I when I looked at the Active Processes, the Seagate process was the only one not responding. So, I am focusing in on that for now...
 
Last edited:

DeltaMac

Tech
After various manual power offs, you might expect that the hard drive directories need attention.
Boot to your OS X installer DVD, and run Disk Utility from the Utilities menu.
Then, run the Repair Disk from that Disk Utility window - different from Repair Disk Permissions.
If you don't have your installer DVD, you can restart holding Command-S. That will boot you into single-user mode. At the prompt, type fsck -fy
Then press enter, and you will see results of a Disk Repair. Should take a couple of minutes to complete, then type mount -uw /
There's a space between the t and the -, also a space between the w and the /
Press enter, and the prompt should return.
Type reboot, and press enter again for a restart.
Those couple of steps, plus the restart will do some minor maintenance of your system, and may help out with the odd behaviour that you have right now.
 

swmckay

Registered
Deltamac,

Thanks for all of your assistance. I've followed all of the steps above. the disk was good, I ran the maintenance as well. I still get the original error in Terminal and some apps freeze up resulting in a manual re-boot. I think the only thing left is adding some RAM. Thanks again!
 

DeltaMac

Tech
You continue to mention that you see that error in your Terminal.
Opening terminal just takes you to a command line
What command are you running in terminal that shows that login error?
Do you, instead, mean that you see that error listed in your console - probably from your system.log?
One more question - How much free space do you have on your internal hard drive?
 

swmckay

Registered
Hello,

When I open Terminal, I don't get a chance to enter any commands. When I first open it, it pauses for 2-3 seconds then displays:


login(1952) malloc: *** mmap(size=2931998720) failed (error code=12)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug

about a hundred times maybe more, then it stops and displays:

You have mail.
mac:~ myname$

I just tried opening Console and it pinwheels me.

Hard drive is 74.21 GB with 18.44 GB free
 

swmckay

Registered
Hello,

When I open Terminal, I don't get a chance to enter any commands. When I first open it, it pauses for 2-3 seconds then displays:


login(1952) malloc: *** mmap(size=2931998720) failed (error code=12)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug

about a hundred times maybe more, then it stops and displays:

You have mail.
mac:~ myname$

I just tried opening Console and it pinwheels me.

Hard drive is 74.21 GB with 18.44 GB free
 

DeltaMac

Tech
I searched for info about "login error in terminal", and this may be one of those situations where running a Permissions repair might be worth your time.
Open your Disk Utility, click on your hard drive, and click Repair Disk Permissions.
Restart your Mac when that completes.
Might be a quick test to try Terminal after that restart.
 
Top