unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: Possible memory corruption problem
Date: Mon, 06 Feb 2006 21:13:45 +0200	[thread overview]
Message-ID: <u7j885mhi.fsf@gnu.org> (raw)
In-Reply-To: <m24q3ca49q.fsf@ordesa.cs.uu.nl> (message from Piet van Oostrum on Mon, 06 Feb 2006 16:36:01 +0100)

> From: Piet van Oostrum <piet@cs.uu.nl>
> 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
it?

> 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
gmalloc?

  reply	other threads:[~2006-02-06 19:13 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-06 15:36 Possible memory corruption problem Piet van Oostrum
2006-02-06 19:13 ` Eli Zaretskii [this message]
2006-02-06 22:14   ` Piet van Oostrum
2006-02-13  4:40   ` Richard M. Stallman
2006-02-14  4:35     ` Eli Zaretskii
2006-02-14  7:56       ` Piet van Oostrum
2006-02-14  9:29         ` Aidan Kehoe
2006-02-15  4:39           ` Richard M. Stallman
2006-02-16 13:21             ` Piet van Oostrum
2006-02-20 18:42               ` Richard M. Stallman
2006-02-14 22:17       ` Richard M. Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=u7j885mhi.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).