[Pythonmac-SIG] malloc error with imaplib or socket on OS X

Bob Ippolito bob at redivi.com
Tue Mar 1 16:39:51 CET 2005

On Mar 1, 2005, at 9:01 AM, Chris Miles wrote:

> Hi, I have recently come across what looks like a serious bug with  
> Python on OS X.  While writing a program using imaplib to connect to  
> some IMAP4 servers I encountered a MemoryError exception with a  
> malloc() error which was easily reproducible with my data at the time.  
>  The malloc error was:
> *** malloc: vm_allocate(size=9252864) failed (error code=3)
> *** malloc[1522]: error: Can't allocate region
> A thread on comp.lang.python shows that this bug has been encountered  
> by others as well.
> http://groups-beta.google.com/group/comp.lang.python/browse_thread/ 
> thread/cd5a8f28b021c269/cf7e574e3bc566df
> I tested my program on my standard OS X 10.3 Python (2.3) as well as a  
> build of 2.4 and found the same MemoryError.  (btw: I had plenty of  
> free RAM at the time.  Over 1/4 of 1GB on a powerbook G4)
> I tested the exact same program connecting to the exact same IMAP4  
> server (Exchange actually) on a Linux box and it worked fine (actually  
> a Linux host running in VPC on the very same Mac).
> The data that was causing the MemoryError was a 9 MB mail message on  
> the IMAP server.  After I deleted this message the program on the Mac  
> ran fine.  The other messages were max 1 MB in size and there were  
> about 114 of them.  (The program downloads every message from a user's  
> IMAP account, amongst other things.)
> Attached is a full Traceback of the MemoryError (as formatted by  
> iPython).
> Is this a known issue, or should I submit it somewhere?

You can try it on Python CVS and see if it has been fixed.  The bug in  
question is <http://python.org/sf/1092502>.


More information about the Pythonmac-SIG mailing list