[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Possible memory corruption problem

From: Eli Zaretskii
Subject: Re: Possible memory corruption problem
Date: Mon, 06 Feb 2006 21:13:45 +0200

> From: Piet van Oostrum <address@hidden>
> Date: Mon, 06 Feb 2006 16:36:01 +0100
> I have had a few occasions when my mailboxes got corrupted.
> I read my normal email with VM, and mail from mailing lists with gnus. I
> have CVS emacs compiled about a month ago, running on Mac OS X 10.4.4.
> A few cases now, the last of which was last weekend, the mailboxes that I
> had open got completely mixed up. I lost my INBOX (primary VM mailbox)
> completely last night, and some of its messages where found in the middle
> of another mailbox that I had open. The mixup also occurred around last
> Christmas with VM and gnus mailboxes mixed up. Sometimes the corrupted
> mailboxes appeared to contain garbage text from other files.

Sounds like some snafu with relocating buffers.  See below.

> I have tried to find the common circumstances when this happens and it
> aeems to me that it happens when the machine is low on virtual memory
> (including swap space).

Emacs should display a warning when the system is low on memory.  Does

> So I suspect that some part of Emacs' buffer and memory management
> fails to check the result of malloc calls or something similar.

I'd rather suspect something else: that some library function on your
platform is passed a pointer to buffer text, and that library function
calls malloc internally, which (especially when Emacs needs to
allocate a large amount of memory) causes Emacs to relocate buffer
text, which could easily invalidate the pointer(s) used by that
library function.

> I have written a test program and it appears that Mac OS X's malloc
> and realloc correctly return NULL when the process runs out of
> memory.

Does Emacs indeed use system malloc on your platform?  Or does it use

reply via email to

[Prev in Thread] Current Thread [Next in Thread]